Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1394786

Re: [BUG] drivers/tty: read() on a noncanonical blocking tty randomly fails when VMIN > received >= buf

From Julio Guerra <julio@farjump.io>
Newsgroups linux.kernel
Subject Re: [BUG] drivers/tty: read() on a noncanonical blocking tty randomly fails when VMIN > received >= buf
Date 2016-05-05 01:30 +0200
Message-ID <rveoW-4Yr-19@gated-at.bofh.it> (permalink)
References <rve5A-4JL-15@gated-at.bofh.it> <rve5A-4JL-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>> When a tty (here a slave pty) is set in noncanonical input and blocking read modes, a read() randomly blocks when:
>> "VMIN > kernel received >= user buffer size > 0".
>>
>> The standard says that read() should block until VMIN bytes are received [1][2]. Whether this is an implementation defined case not really specified by POSIX or not, it should not behave randomly (otherwise it really should be documented in termios manpage).
>
> This is not a bug.
>
> From the termios(3) man page:
>
>        * MIN > 0; TIME == 0: read(2) blocks until the lesser of MIN bytes or the number of bytes requested are avail‐
>          able, and returns the lesser of these two values.
>

This does not appear in my man...

Anyway, how do you explain the random behavior then?

-- 
Julio Guerra

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [BUG] drivers/tty: read() on a noncanonical blocking tty randomly  fails when VMIN > received >= buf Peter Hurley <peter@hurleysoftware.com> - 2016-05-05 01:10 +0200
  Re: [BUG] drivers/tty: read() on a noncanonical blocking tty randomly  fails when VMIN > received >= buf Julio Guerra <julio@farjump.io> - 2016-05-05 01:30 +0200
    Re: [BUG] drivers/tty: read() on a noncanonical blocking tty randomly  fails when VMIN > received >= buf Peter Hurley <peter@hurleysoftware.com> - 2016-05-05 03:00 +0200
  Re: [BUG] drivers/tty: read() on a noncanonical blocking tty  randomly fails when VMIN > received >= buf One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-05-05 12:10 +0200
    Re: [BUG] drivers/tty: read() on a noncanonical blocking tty randomly  fails when VMIN > received >= buf Peter Hurley <peter@hurleysoftware.com> - 2016-05-05 17:30 +0200

csiph-web