HomeFreeBSD

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

Description

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

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

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D35640

Details

Provenance
glebiusAuthored on Jun 29 2022, 4:42 PM
Reviewer
markj
Differential Revision
D35640: unix: change error code for recvmsg() failed due to RLIMIT_NOFILE
Parents
rGbaf8f20a4af4: Split out vfp_new_thread
Branches
Unknown
Tags
Unknown