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)
Wed, Oct 15, 6:26 AM
Unknown Object (File)
Aug 23 2025, 8:55 AM
Unknown Object (File)
Aug 19 2025, 12:42 AM
Unknown Object (File)
Aug 12 2025, 7:31 PM
Unknown Object (File)
Aug 9 2025, 8:39 PM
Unknown Object (File)
Jul 29 2025, 10:41 AM
Unknown Object (File)
Jul 29 2025, 7:49 AM
Unknown Object (File)
Jul 29 2025, 7:33 AM
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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable