Fix sys/socket.h namespace issues from sys/uio.h inclusion (bug 21426)
Zack Weinberg
zackw@panix.com
Tue Apr 25 17:41:00 GMT 2017
On Tue, Apr 25, 2017 at 12:58 PM, Joseph Myers <joseph@codesourcery.com> wrote:
>
> This patch moves the struct iovec definition to a new
> bits/types/struct_iovec.h header and includes that from sys/socket.h
> instead of including the whole of sys/uio.h.
This change looks good to me. I have closely related changes on the
zack/headers-cleanups branch (addressing UIO_MAXIOV/IOV_MAX) but it
looks like we independently created the exact same
bits/types/struct_iovec.h, so the merge won't be a problem.
> So there is a question of whether sys/socket.h should continue to include
> sys/uio.h under some conditions, such as __USE_XOPEN or __USE_MISC or
> __USE_XOPEN || __USE_MISC, for greater compatibility with code that
> (wrongly) expects this optional inclusion to be present there. (I
> think the three affected files in glibc should still have explicit
> sys/uio.h inclusions added in any case, however.)
readv/writev are used rarely enough that I think we can skip it, at
least until we start getting complaints.
zw
More information about the Libc-alpha
mailing list