aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2014-02-11 11:13:36 +0100
committerMichael Kerrisk <mtk.manpages@gmail.com>2014-02-11 11:13:36 +0100
commit9798ddfd58eabb7c7e706d7dffb66accf942d138 (patch)
treeab31041f5a6937ee7d27466691f513c50cb1058f
parentea62994487591c3b4ca4eabbee3a5e8d44764a44 (diff)
downloadman-pages-9798ddfd58eabb7c7e706d7dffb66accf942d138.tar.gz
recv.2: Describe the various cases where the return value can be 0
Reported-by: 未卷起的浪 <ayjj_8109@qq.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man2/recv.212
1 files changed, 10 insertions, 2 deletions
diff --git a/man2/recv.2 b/man2/recv.2
index 884862a5ea..45dba6b1d0 100644
--- a/man2/recv.2
+++ b/man2/recv.2
@@ -403,8 +403,16 @@ if an error occurred.
In the event of an error,
.I errno
is set to indicate the error.
-The return value will be 0 when the
-peer has performed an orderly shutdown.
+
+When a stream socket peer has performed an orderly shutdown,
+the return value will be 0 (the traditional "end-of-file" return).
+
+Datagram sockets in various domains (e.g., the UNIX and Internet domains)
+permit zero-length datagrams.
+When such a datagram is received, the return value is 0.
+
+The value 0 may also be returned if the requested number of bytes
+to receive from a stream socket was 0.
.SH ERRORS
These are some standard errors generated by the socket layer.
Additional errors