HomeFreeBSD

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

Description

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

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

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

Details

Provenance
glebiusAuthored on May 25 2022, 8:29 PM
Reviewer
markj
Differential Revision
D35316: sockets: return EMSGSIZE if control part of message is too large
Parents
rG23402c83f4fc: tests/unix_passfd: sending many and too many SCM_RIGHTS
Branches
Unknown
Tags
Unknown