open.2, read.2, write.2: Clarify that O_NONBLOCK is a no-op for regular files and block devices

Reported-by: Mike Hayward <hayward@loup.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-05-11 12:03:43 +02:00
parent eee5da1663
commit 9f629381c9
3 changed files with 21 additions and 0 deletions

View File

@ -511,6 +511,17 @@ Neither the
nor any subsequent operations on the file descriptor which is
returned will cause the calling process to wait.
Note that this flag has no effect for regular files and block devices;
that is, I/O operations will (briefly) block when device activity
is required, regardless of whether
.B O_NONBLOCK
is set.
Since
.B O_NONBLOCK
semantics might eventually be implemented,
applications should not depend upon blocking behavior
when specifying this flag for regular files and block devices.
For the handling of FIFOs (named pipes), see also
.BR fifo (7).
For a discussion of the effect of

View File

@ -100,6 +100,11 @@ The file descriptor
refers to a file other than a socket and has been marked nonblocking
.RB ( O_NONBLOCK ),
and the read would block.
See
.BR open (2)
for further details on the
.BR O_NONBLOCK
flag.
.TP
.BR EAGAIN " or " EWOULDBLOCK
.\" Actually EAGAIN on Linux

View File

@ -112,6 +112,11 @@ The file descriptor
refers to a file other than a socket and has been marked nonblocking
.RB ( O_NONBLOCK ),
and the write would block.
See
.BR open (2)
for further details on the
.BR O_NONBLOCK
flag.
.TP
.BR EAGAIN " or " EWOULDBLOCK
.\" Actually EAGAIN on Linux