Page MenuHomeFreeBSD

unix: change error code for recvmsg() failed due to RLIMIT_NOFILE
ClosedPublic

Authored by glebius on Jun 28 2022, 9:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 14, 6:43 PM
Unknown Object (File)
Fri, Nov 14, 6:43 PM
Unknown Object (File)
Fri, Nov 14, 6:43 PM
Unknown Object (File)
Fri, Nov 14, 4:04 PM
Unknown Object (File)
Wed, Nov 12, 12:48 AM
Unknown Object (File)
Mon, Nov 3, 9:05 PM
Unknown Object (File)
Mon, Nov 3, 9:02 PM
Unknown Object (File)
Mon, Nov 3, 9:02 PM
Subscribers

Details

Summary

Instead of returning EMSGSIZE pass the error code from fdallocn() directly
to userland. That would be EMFILE, which makes much more sense. This
error code is not listed in the specification[1], but the specification
doesn't cover such edge case at all. Meanwhile the specification lists
EMSGSIZE as the error code for invalid value of msg_iovlen, and FreeBSD
follows that, see sys_recmsg(). Differentiating these two cases will make
a developer/admin life much easier when debugging.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvmsg.html

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46163
Build 43052: arc lint + arc unit