The man page of recvmsg(2) does not mention that recvmsg() can legitimately return 0 in the case that the socket has closed and no received data is pending. See the RETURN VALUE section in SUSv2: http://pubs.opengroup.org/onlinepubs/007908799/xns/recvmsg.html How-To-Repeat: man recvmsg
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=571df2c64a3c1af1fe011303ec08e391e887ecbc commit 571df2c64a3c1af1fe011303ec08e391e887ecbc Author: Felix Johnson <fjohnson@felix-johnson.com> AuthorDate: 2025-02-13 03:40:59 +0000 Commit: Alexander Ziaee <ziaee@FreeBSD.org> CommitDate: 2025-02-13 03:54:14 +0000 recv.2: Explain how recv functions can return 0 Clarify the RETURN VALUES section with improved structure, the condition of the return value 0, and the setting of errno. PR: 174581 Reviewed by: jhb, ziaee Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48955 lib/libsys/recv.2 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)