diff --git a/man2/recv.2 b/man2/recv.2 index 7b04f89d2..5b403594c 100644 --- a/man2/recv.2 +++ b/man2/recv.2 @@ -78,8 +78,9 @@ With a zero .I flags argument, .BR recv () -is equivalent to -.BR read (2). +is generally equivalent to +.BR read (2) +(but see NOTES). Also, the following call recv(sockfd, buf, len, flags); @@ -515,6 +516,19 @@ and .B MSG_WAITALL flags. .SH NOTES +If a zero-length datagram is pending, +.BR read (2) +and +.BR recv () +with a +.I flags +argument of zero provide different behavior. +In this circumstance, +.BR read (2) +has no effect (the datagram remains pending), while +.BR recv () +consumes the pending datagram. + The .I socklen_t type was invented by POSIX.