lkml.org 
[lkml]   [1998]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: patch for 2.1.103 n_tty.c
On Thu, May 28, 1998 at 12:09:48PM -0400, Bill Hawes wrote:
> I received a problem report that the 2.1.xx kernels will block for input
> on a 0 length read from a tty, instead of returning immediately. In
> other cases (e.g fs reads) there's a test for count == 0 to return
> immediately, and apparently 2.0.xx kernels don't block.

Hmm, the same happens for a pipe_read. In linux-2.0.x that one
also returned immediatly (due to the check on 0 in sys_read).
But an read of a pipe (0 bytes as count) still blocks...

I'm nt sure what the proper semantics for the read call are.
Shouldn't it at least be the same for all read's? pipe,
tty, fs, network, unix?

> The attached patch adds a test for nr == 0 before waiting for input.
> This actually simplifies the code somewhat, as there were three separate
> places that had to test for nr == 0 as a special case.

It fixes one of the places where the test for count==0 was needed,
in the other places (pipes e.g.) is still blocks, leading to an
inconsistant behaviour.

Met vriendelijke groet,
Pauline Middelink
--
PGP Key fingerprint = DE 6B D0 D9 19 AD A7 A0 58 A3 06 9D B6 34 39 E2
For more details look at my website http://www.polyware.nl/~middelin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.069 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site