glibc/misc
Joseph Myers 9fe3c80c7c Fix sys/socket.h namespace issues from sys/uio.h inclusion (bug 21426).
sys/socket.h includes sys/uio.h to get the definition of the iovec
structure.

POSIX allows sys/socket.h to make all sys/uio.h symbols visible.
However, all of sys/uio.h is XSI-shaded, so for non-XSI POSIX this
results in conformtest failures (for sys/socket.h and other headers
that include it):

    Namespace violation: "UIO_MAXIOV"
    Namespace violation: "readv"
    Namespace violation: "writev"

Now, there is some ambiguity in POSIX about what namespace
reservations apply in this case - see
http://austingroupbugs.net/view.php?id=1127 - but glibc convention
would still avoid declaring readv and writev, for example, for feature
test macros that don't include them (if only headers from the relevant
standard are included), even if such declarations are permitted, so
there is a bug here according to glibc conventions.

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 fixes the namespace
issue; however, three files in glibc that were relying on the implicit
inclusion needed to be updated to include sys/uio.h explicitly.  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.)

Tested for x86_64.

	[BZ #21426]
	* misc/bits/types/struct_iovec.h: New file.
	* misc/Makefile (headers): Add bits/types/struct_iovec.h.
	* include/bits/types/struct_iovec.h: New file.
	* bits/uio.h (struct iovec): Replace by inclusion of
	<bits/types/struct_iovec.h>.
	* sysdeps/unix/sysv/linux/bits/uio.h (struct iovec): Likewise.
	* socket/sys/socket.h: Include <bits/types/struct_iovec.h> instead
	of <sys/uio.h>.
	* nptl/tst-cancel4.c: Include <sys/uio.h>
	* posix/test-errno.c: Likewise.
	* support/resolv_test.c: Likewise.
	* conform/Makefile (test-xfail-POSIX2008/arpa/inet.h/conform):
	Remove.
	(test-xfail-POSIX2008/netdb.h/conform): Likewise.
	(test-xfail-POSIX2008/netinet/in.h/conform): Likewise.
	(test-xfail-POSIX2008/sys/socket.h/conform): Likewise.
2017-04-25 17:52:47 +00:00
..
bits Fix sys/socket.h namespace issues from sys/uio.h inclusion (bug 21426). 2017-04-25 17:52:47 +00:00
sys Remove C++ namespace handling from glibc headers. 2017-03-16 13:31:57 +00:00
Makefile Fix sys/socket.h namespace issues from sys/uio.h inclusion (bug 21426). 2017-04-25 17:52:47 +00:00
Versions Minimize sysdeps code involved in defining major/minor/makedev. 2016-08-03 15:23:04 -04:00
acct.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ar.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
brk.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
bug-hsearch1.c
bug18240.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
chflags.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
chroot.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
daemon.c Convert 29 more function definitions to prototype style (multiple parameters in one K&R parameter declaration). 2015-10-20 11:52:27 +00:00
dirname.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
efgcvt.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
efgcvt_r.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
err.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
err.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
error.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
error.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fchflags.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fdatasync.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fgetxattr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
flistxattr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fremovexattr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fsetxattr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fstab.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fstab.h
fsync.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ftruncate.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ftruncate64.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
futimes.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
futimesat.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
getauxval.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
getclktck.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
getdomain.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
getdtsz.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gethostid.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gethostname.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
getloadavg.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
getpagesize.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
getpass.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
getsysstats.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
getttyent.c As a minor cleanup remove the (r)index defines from include/string.h as 2017-02-06 18:15:18 +00:00
getusershell.c
getxattr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gtty.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
hsearch.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
hsearch_r.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ifunc-impl-list.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
init-misc.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
insremque.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ioctl.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
lgetxattr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
libgen.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
listxattr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
llistxattr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
lremovexattr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
lsearch.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
lsetxattr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
lutimes.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
madvise.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
makedev.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mincore.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mkdtemp.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mkostemp.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mkostemp64.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mkostemps.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mkostemps64.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mkstemp.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mkstemp64.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mkstemps.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mkstemps64.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mktemp.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mlock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mlockall.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mmap.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mmap64.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mntent.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mntent.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mntent_r.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mprotect.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
msync.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
munlock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
munlockall.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
munmap.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
preadv.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
preadv64.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pselect.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ptrace.c Narrowing the visibility of libc-internal.h even further. 2017-03-01 20:33:46 -05:00
pwritev.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pwritev64.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
qefgcvt.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
qefgcvt_r.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
readv.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
reboot.c Narrowing the visibility of libc-internal.h even further. 2017-03-01 20:33:46 -05:00
regexp.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
regexp.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
remap_file_pages.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
removexattr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
revoke.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sbrk.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
search.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
select.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
setdomain.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
setegid.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
seteuid.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sethostid.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sethostname.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
setregid.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
setreuid.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
setxattr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sgtty.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sstk.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
stab.h
stty.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
swapoff.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
swapon.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sync.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
syncfs.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
syscall.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
syscall.h
sysexits.h
syslog.c Assume that SOCK_CLOEXEC is available and works 2015-10-17 12:02:37 +02:00
syslog.h
truncate.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
truncate64.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tsearch.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-atomic-long.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-atomic.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-dirname.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-efgcvt.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-empty.c Move all tests out of the csu subdirectory 2016-12-21 11:52:19 +01:00
tst-error1.c Split DIAG_* macros to new header libc-diag.h. 2017-02-25 09:59:46 -05:00
tst-fdset.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-hsearch.c
tst-insremque.c
tst-makedev.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-mntent-blank-corrupt.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-mntent-blank-passno.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-mntent.c getmntent: fix memory corruption w/blank lines [BZ #18887] 2015-08-29 18:07:00 -04:00
tst-mntent2.c
tst-preadvwritev-common.c Add missing header files throughout the testsuite. 2017-02-16 17:33:18 -05:00
tst-preadvwritev.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-preadvwritev64.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-pselect.c Do not use SA_NOCLDWAIT in tst-pselect. 2015-02-06 12:29:39 -08:00
tst-tsearch.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ttyent.h
ttyslot.c As a minor cleanup remove the (r)index defines from include/string.h as 2017-02-06 18:15:18 +00:00
ualarm.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
usleep.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ustat.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ustat.h
utimes.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
vhangup.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
writev.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00