All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: Ed Vance <EdV@macrolink.com>
Cc: "'rwhite@pobox.com'" <rwhite@pobox.com>,
	"'Theodore Tso'" <tytso@mit.edu>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: n_tty.c driver patch (semantic and performance correction) (a ll recent versions)
Date: Fri, 26 Jul 2002 15:17:23 +0100	[thread overview]
Message-ID: <20020726151723.F19802@flint.arm.linux.org.uk> (raw)
In-Reply-To: <11E89240C407D311958800A0C9ACF7D13A789A@EXCHANGE>; from EdV@macrolink.com on Wed, Jun 26, 2002 at 10:48:30AM -0700

On Wed, Jun 26, 2002 at 10:48:30AM -0700, Ed Vance wrote:
> Does the spec say that VMIN behavior depends on the size of a 
> blocking read? No, it says that the read completes when VMIN or 
> more characters have been received. If VMIN is three and two 
> characters have been received, completing a blocking read of any 
> size is a violation. Should we also add a "read buffer size" 
> parameter to select and poll, etc. so they can report that read 
> data is available before satisfying VMIN, too? 
> 
> Ted, Russell, please weigh in on this. 

I just found this mail again.  Yes, I agree with your interpretation,
which reflects the code we presently have, as well as my reading of
SuS.  The SuS is quite clear that "A pending read shall not be
satisfied until MIN bytes are received".  It doesn't say "A pending
read shall not be satisfied until MIN bytes or the number of requested
bytes in read() are received"

In addition, it also says "MIN represents the minimum number of bytes
that should be received when the read() function returns successfully."
Successful completion for read() is defined as "Upon successful
completion, read() shall return a non-negative integer indicating the
number of bytes actually read."

So, for _any_ read() to a terminal with MIN set, for this call to
return data (ie, success) MIN bytes must have been received.

(Note that the behaviour where the number of bytes > MIN seems to be
a little vague, SuS just talks about "block the calling thread until
_some_ data becomes available" for the blocking case.)

I'd be interested to know if Ted agrees with my position here; he is
the author of the tty code, and is presently looking at that area.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


  parent reply	other threads:[~2002-07-26 14:14 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-26 17:48 n_tty.c driver patch (semantic and performance correction) (a ll recent versions) Ed Vance
2002-06-26 20:42 ` Russell King
2002-06-27 16:37 ` Robert White
2002-06-27 16:37 ` Robert White
2002-07-26 14:17 ` Russell King [this message]
2002-07-27 22:07   ` Robert White
2002-07-27 23:11     ` Russell King
2002-07-27 23:21     ` Andries Brouwer
2002-07-28  2:34       ` Robert White
2002-07-28  3:01         ` Stevie O
2002-07-28 13:34         ` Andries Brouwer
2002-07-28 20:04         ` Alan Cox
2002-07-30  7:41           ` Robert White
2002-07-28 20:04         ` Alan Cox
2002-07-28  2:36       ` Robert White
  -- strict thread matches above, loose matches on Subject: below --
2002-07-31 16:58 Ed Vance
2002-07-31 16:58 Ed Vance
2002-07-30 17:07 Ed Vance
2002-07-30 17:07 Ed Vance
2002-07-31  5:31 ` David Lawyer
2002-07-29 21:46 Ed Vance
2002-07-30  7:50 ` Robert White
2002-06-28 18:12 Ed Vance
2002-06-17 17:27 Ed Vance
2002-06-18  2:00 ` Robert White
2002-06-18 13:05   ` Stuart MacDonald
2002-06-18 13:05     ` Stuart MacDonald
2002-06-18  2:00 ` Robert White

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020726151723.F19802@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=EdV@macrolink.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rwhite@pobox.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.