[PATCH 2/3] network: recvmsg and sendmsg standard compliance (BZ#16919)

Rich Felker dalias@libc.org
Thu Apr 21 17:15:00 GMT 2016


On Mon, Mar 28, 2016 at 11:34:00AM -0300, Adhemerval Zanella wrote:
> POSIX specifies that both msghdr::msg_iovlen and msghdr::msg_controllen
> to be of size int and socklen_t respectively.  However Linux defines it as
> both size_t and for 64-bit it requires some adjustments to make the
> functions standard compliance.
> 
> This patch fixes it by creating a temporary header and zeroing the pad
> fields for 64-bits architecture where size of size_t exceeds the size of
> the int.
> 
> Also the new recvmsg and sendmsg implementation is only added on libc,
> with libpthread only containing a compat symbol.

Just a heads-up: this needs a bug report/patch to the Linux man-pages
project as well, since they're currently documenting the wrong types.
The documented types should probably be fixed to align with the
standard, with a note about them previously being wrong added to the
NOTES section.

Rich



More information about the Libc-alpha mailing list