tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

documenting when recv(2) returns 0



Hi

POSIX.1 requires recv(2) to return 0 for connected sockets when no more
data is available and the connexion was closed. We do it but we do not 
document it. What about this chnage?

Index: recv.2
===================================================================
RCS file: /cvsroot/src/lib/libc/sys/recv.2,v
retrieving revision 1.29
diff -U 2 -r1.29 recv.2
--- recv.2      27 Jun 2011 08:21:08 -0000      1.29
+++ recv.2      1 Feb 2012 08:44:49 -0000
@@ -96,4 +96,6 @@
 set to
 .Er EAGAIN .
+If no data is available and the remote peer was shut down, 
+0 is returned.
 The receive calls normally return any data available,
 up to the requested amount,
@@ -231,5 +233,6 @@
 .Sh RETURN VALUES
 These calls return the number of bytes received, or \-1
-if an error occurred.
+if an error occurred. For connected sockets whose remote peer was shut down,
+0 is returned when no more data is available.
 .Sh ERRORS
 The calls fail if:
-- 
Emmanuel Dreyfus
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index