Page MenuHomeFreeBSD

sockets: return EMSGSIZE if control part of message is too large
ClosedPublic

Authored by glebius on May 25 2022, 7:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 22, 2:19 AM
Unknown Object (File)
Fri, Apr 18, 4:11 AM
Unknown Object (File)
Fri, Mar 28, 3:08 AM
Unknown Object (File)
Fri, Mar 28, 3:08 AM
Unknown Object (File)
Mar 25 2025, 12:12 PM
Unknown Object (File)
Mar 14 2025, 11:00 PM
Unknown Object (File)
Mar 12 2025, 4:24 PM
Unknown Object (File)
Feb 28 2025, 4:00 AM
Subscribers

Details

Summary

Specification doesn't list an explicit error code for the control
size specified by msg_control being too large. But it does list
EMSGSIZE as error code for "message is too large to be sent all at
once (as the socket requires)". It also lists EINVAL as code for
the "The sum of the iov_len values overflows an ssize_t." Given
how generic and uninformative EINVAL is, the EMSGSIZE is more
appropriate.

https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendmsg.html

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable