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
F163256258: D35640.id107559.diff
Tue, Jul 21, 11:54 AM
F163249575: D35640.id107502.diff
Tue, Jul 21, 10:13 AM
F163245684: D35640.id.diff
Tue, Jul 21, 9:22 AM
Unknown Object (File)
Sun, Jul 19, 8:24 PM
Unknown Object (File)
Sat, Jul 18, 4:11 PM
Unknown Object (File)
Sat, Jul 18, 3:52 AM
Unknown Object (File)
Sat, Jul 11, 2:18 AM
Unknown Object (File)
Wed, Jul 8, 10:19 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