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)
Fri, Mar 14, 11:00 PM
Unknown Object (File)
Wed, Mar 12, 4:24 PM
Unknown Object (File)
Fri, Feb 28, 4:00 AM
Unknown Object (File)
Jan 30 2025, 1:09 AM
Unknown Object (File)
Jan 27 2025, 5:02 PM
Unknown Object (File)
Jan 27 2025, 4:54 PM
Unknown Object (File)
Jan 13 2025, 3:15 AM
Unknown Object (File)
Nov 1 2024, 11:15 PM
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