mirror of https://github.com/mkerrisk/man-pages
recv.2, send.2: Explain some subtleties of MSG_DONTWAIT versus O_NONBLOCK
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
b6c261c4db
commit
630b4cac33
17
man2/recv.2
17
man2/recv.2
|
@ -109,12 +109,21 @@ flag of
|
|||
.BR MSG_DONTWAIT " (since Linux 2.2)"
|
||||
Enables nonblocking operation; if the operation would block,
|
||||
the call fails with the error
|
||||
.BR EAGAIN " or " EWOULDBLOCK
|
||||
(this can also be enabled using the
|
||||
.BR EAGAIN " or " EWOULDBLOCK .
|
||||
This provides similar behavior to setting the
|
||||
.B O_NONBLOCK
|
||||
flag with the
|
||||
flag (via the
|
||||
.BR fcntl (2)
|
||||
.B F_SETFL
|
||||
.BR fcntl (2)).
|
||||
operation), but differs in that
|
||||
.B MSG_DONTWAIT
|
||||
is a per-call option, whereas
|
||||
.B O_NONBLOCK
|
||||
is a setting on the open file description (see
|
||||
.BR open (2)),
|
||||
which will affect all threads in the calling process
|
||||
and as well as other processes that hold file descriptors
|
||||
referring to the same open file description.
|
||||
.TP
|
||||
.BR MSG_ERRQUEUE " (since Linux 2.2)"
|
||||
This flag
|
||||
|
|
16
man2/send.2
16
man2/send.2
|
@ -191,11 +191,21 @@ Enables nonblocking operation; if the operation would block,
|
|||
.B EAGAIN
|
||||
or
|
||||
.B EWOULDBLOCK
|
||||
is returned (this can also be enabled using the
|
||||
is returned.
|
||||
This provides similar behavior to setting the
|
||||
.B O_NONBLOCK
|
||||
flag with the
|
||||
flag (via the
|
||||
.BR fcntl (2)
|
||||
.B F_SETFL
|
||||
.BR fcntl (2)).
|
||||
operation), but differs in that
|
||||
.B MSG_DONTWAIT
|
||||
is a per-call option, whereas
|
||||
.B O_NONBLOCK
|
||||
is a setting on the open file description (see
|
||||
.BR open (2)),
|
||||
which will affect all threads in the calling process
|
||||
and as well as other processes that hold file descriptors
|
||||
referring to the same open file description.
|
||||
.TP
|
||||
.BR MSG_EOR " (since Linux 2.2)"
|
||||
Terminates a record (when this notion is supported, as for sockets of type
|
||||
|
|
Loading…
Reference in New Issue