glibc/conform/data
Adhemerval Zanella af7f7c7ec8 network: recvmsg and sendmsg standard compliance (BZ#16919)
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.

Tested on x86_64, i686, aarch64, armhf, and powerpc64le.

	* conform/data/sys/socket.h-data (msghdr.msg_iovlen): Remove xfail-
	and change to correct expected type.
	(msghdr.msg_controllen): Likewise.
	(cmsghdr.cmsg_len): Likewise.
	* sysdeps/unix/sysv/linux/bits/socket.h (msghdr.msg_iovlen): Fix
	expected POSIX assumption about the size.
	(msghdr.msg_controllen): Likewise.
	(msghdr.__glibc_reserved1): Likewise.
	(msghdr.__glibc_reserved2): Likewise.
	(cmsghdr.cmsg_len): Likewise.
	(cmsghdr.__glibc_reserved1): Likewise.
	* nptl/Makefile (libpthread-routines): Remove ptw-recvmsg and ptw-sendmsg.
	Add ptw-oldrecvmsg and ptw-oldsendmsg.
	(CFLAGS-sendmsg.c): Remove rule.
	(CFLAGS-recvmsg.c): Likewise.
	(CFLAGS-oldsendmsg.c): Add rule.
	(CFLAGS-oldrecvmsg.c): Likewise.
	* sysdeps/unix/sysv/linux/alpha/Versions [libc] (GLIBC_2.24): Add
	recvmsg and sendmsg.
	* sysdeps/unix/sysv/linux/aarch64/Version [libc] (GLIBC_2.24):
	Likewise.
	* sysdeps/unix/sysv/linux/arm/Versions [libc] (GLIBC_2.24): Likewise.
	* sysdeps/unix/sysv/linux/hppa/Versions [libc] (GLIBC_2.24): Likewise.
	* sysdeps/unix/sysv/linux/i386/Versions [libc] (GLIBC_2.24): Likewise.
	* sysdeps/unix/sysv/linux/ia64/Versions [libc] (GLIBC_2.24): Likewise.
	* sysdeps/unix/sysv/linux/m68k/Versions [libc] (GLIBC_2.24): Likewise.
	* sysdeps/unix/sysv/linux/microblaze/Versions [libc] (GLIBC_2.24):
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/Versions [libc] (GLIBC_2.24):
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/Versions [libc] (GLIBC_2.24):
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/Versions [libc] (GLIBC_2.24):
	Likewise.
	* sysdeps/unix/sysv/linux/nios2/Versions [libc] (GLIBC_2.24):
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/Versions [libc] (GLIBC_2.24):
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions [libc]
	(GLIBC_2.24): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/Versions [libc] (GLIBC_2.24):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/Versions [libc] (GLIBC_2.24):
	Likewise.
	* sysdeps/unix/sysv/linux/sh/Versions [libc] (GLIBC_2.24): Likewise.
	* sysdeps/unix/sysv/linux/sparc/Versions [libc] (GLIBC_2.24):
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/Versions [libc] (GLIBC_2.24):
	Likewise.
	( sysdeps/unix/sysv/linux/tile/Versions [libc] (GLIBC_2.24):
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Versions [libc]
	(GLIBC_2.24): Likewise.
	( sysdeps/unix/sysv/linux/x86_64/64/Versions [libc] (GLIBC_2.24):
	Likewise.
	* sysdeps/unix/sysv/linux/x84_64/Versions [libc] (GLIBC_2.24):
	Likewise.
	* sysdeps/unix/sysv/linux/Makefile
	[$(subdir) = socket)] (sysdep_headers): Add oldrecvmsg and oldsendmsg.
	(CFLAGS-sendmsg.c): Add rule.
	(CFLAGS-recvmsg.c): Likewise.
	(CFLAGS-oldsendmsg.c): Likewise.
	(CFLAGS-oldrecvmsg.c): Likewise.
	* sysdeps/unix/sysv/linux/check_native.c (__check_native): Fix msghdr
	initialization.
	* sysdeps/unix/sysv/linux/check_pf.c (make_request): Likewise.
	* sysdeps/unix/sysv/linux/ifaddrs.c (__netlink_request): Likewise.
	* sysdeps/unix/sysv/linux/oldrecvmsg.c: New file.
	* sysdeps/unix/sysv/linux/oldsendmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/recvmsg.c (__libc_recvmsg): Adjust msghdr
	iovlen and controllen fields to adjust to POSIX specification.
	* sysdeps/unix/sysv/linux/sendmsg.c (__libc_sendmsg): Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist: New version and
	added recvmsg and sendmsg.
	* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist:
	Likewise.
	* sysdeps/unix/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise.
	* sysdepe/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise.
	Likewise.
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise.
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
2016-05-25 17:39:01 -03:00
..
arpa conformtest: correct set of standards for which some headers are tested. 2014-03-06 17:42:03 +00:00
net conformtest: correct set of standards for which some headers are tested. 2014-03-06 17:42:03 +00:00
netinet conformtest: correct set of standards for which more headers are tested. 2014-03-06 17:43:46 +00:00
sys network: recvmsg and sendmsg standard compliance (BZ#16919) 2016-05-25 17:39:01 -03:00
aio.h-data conformtest: correct set of standards for which some headers are tested. 2014-03-06 17:42:03 +00:00
assert.h-data conformtest: Update expectations for some ISO C headers. 2012-05-01 20:05:49 +00:00
complex.h-data conformtest: Clean up / correct / expand C99 and C11 expectations. 2012-11-07 19:36:48 +00:00
cpio.h-data conformtest: Clean up expectations for POSIX for various headers. 2012-11-19 22:20:44 +00:00
ctype.h-data conformtest: Update expectations for some ISO C headers. 2012-05-01 20:05:49 +00:00
dirent.h-data First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
dlfcn.h-data conformtest: correct set of standards for which some headers are tested. 2014-03-06 17:42:03 +00:00
errno.h-data conformtest: Clean up expectations for POSIX for more headers. 2012-11-19 22:21:47 +00:00
fcntl.h-data conformtest: Do not expect S_IF* in fcntl.h. 2016-05-12 16:46:55 +00:00
fenv.h-data conformtest: Add test data for fenv.h. 2012-11-02 23:21:36 +00:00
float.h-data conformtest: Update expectations for some ISO C headers. 2012-05-01 20:05:49 +00:00
fmtmsg.h-data conformtest: correct set of standards for which some headers are tested. 2014-03-06 17:42:03 +00:00
fnmatch.h-data First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
ftw.h-data conformtest: Correct ftw.h expectations for XPG3, XPG4. 2016-05-20 19:45:06 +00:00
glob.h-data conformtest: Clean up expectations for POSIX for various headers. 2012-11-19 22:20:44 +00:00
grp.h-data Fix grp.h endgrent, getgrent namespace (bug 18528). 2015-06-12 22:29:19 +00:00
iconv.h-data First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
inttypes.h-data conformtest: Clean up / correct / expand C99 and C11 expectations. 2012-11-07 19:36:48 +00:00
iso646.h-data conformtest: Clean up / correct / expand C99 and C11 expectations. 2012-11-07 19:36:48 +00:00
langinfo.h-data conformtest: Add langinfo.h expectations for YESSTR, NOSTR. 2016-04-28 17:19:53 +00:00
libgen.h-data conformtest: correct set of standards for which some headers are tested. 2014-03-06 17:42:03 +00:00
limits.h-data conformtest: Correct some limits.h expectations for XPG3, XPG4. 2016-05-23 15:25:34 +00:00
locale.h-data conformtest: correct POSIX expectations for locale.h. 2015-05-20 22:56:27 +00:00
math.h-data Don't declare float / long double Bessel functions for XSI POSIX (bug 18977). 2015-09-16 22:04:40 +00:00
monetary.h-data First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
mqueue.h-data conformtest: correct set of standards for which some headers are tested. 2014-03-06 17:42:03 +00:00
ndbm.h-data conformtest: correct set of standards for which some headers are tested. 2014-03-06 17:42:03 +00:00
netdb.h-data Fix netdb.h addrinfo namespace (bug 18529). 2015-06-12 22:35:07 +00:00
nl_types.h-data First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
poll.h-data conformtest: correct set of standards for which some headers are tested. 2014-03-06 17:42:03 +00:00
pthread.h-data conformtest: Clean up expectations for POSIX for pthread.h. 2013-09-24 22:09:04 +00:00
pwd.h-data conformtest: Correct pwd.h expectations for XPG3. 2016-05-19 14:48:30 +00:00
regex.h-data conformtest: Clean up expectations for POSIX for various headers. 2012-11-19 22:20:44 +00:00
sched.h-data conformtest: Clean up expectations for POSIX for sched.h. 2013-09-25 00:51:42 +00:00
search.h-data conformtest: Correct search.h expectations for XPG3. 2016-05-19 14:35:41 +00:00
semaphore.h-data conformtest: clean up POSIX expectations for semaphore.h, signal.h, tar.h. 2014-03-07 03:21:04 +00:00
setjmp.h-data conformtest: Update expectations for more ISO C headers. 2012-05-09 10:05:14 +00:00
signal.h-data conformtest: Correct some signal.h expectations for XOPEN2K. 2016-04-27 14:03:14 +00:00
spawn.h-data conformtest: correct set of standards for which some headers are tested. 2014-03-06 17:42:03 +00:00
stdalign.h-data conformtest: Clean up / correct / expand C99 and C11 expectations. 2012-11-07 19:36:48 +00:00
stdarg.h-data conformtest: Correct XOPEN2K stdarg.h expectations. 2016-04-26 13:56:04 +00:00
stdbool.h-data conformtest: Clean up / correct / expand C99 and C11 expectations. 2012-11-07 19:36:48 +00:00
stddef.h-data conformtest: Update expectations for some ISO C headers. 2012-05-01 20:05:49 +00:00
stdint.h-data conformtest: Clean up / correct / expand C99 and C11 expectations. 2012-11-07 19:36:48 +00:00
stdio.h-data conformtest: Correct stdio.h expectations for fdopen. 2016-04-27 21:28:58 +00:00
stdlib.h-data conformtest: Correct some stdlib.h expectations for XPG3. 2016-05-13 17:26:04 +00:00
stdnoreturn.h-data conformtest: Clean up / correct / expand C99 and C11 expectations. 2012-11-07 19:36:48 +00:00
string.h-data conformtest: Do not expect strdup in string.h for XPG3. 2016-05-13 16:57:09 +00:00
strings.h-data conformtest: correct set of standards for which some headers are tested. 2014-03-06 17:42:03 +00:00
stropts.h-data conformtest: Support xfail markers on individual assertions. 2015-06-19 20:05:41 +00:00
syslog.h-data conformtest: correct set of standards for which some headers are tested. 2014-03-06 17:42:03 +00:00
tar.h-data conformtest: clean up POSIX expectations for semaphore.h, signal.h, tar.h. 2014-03-07 03:21:04 +00:00
termios.h-data Declare tcgetsid for XPG4 (bug 20055). 2016-05-11 18:05:37 +00:00
tgmath.h-data conformtest: Clean up / correct / expand C99 and C11 expectations. 2012-11-07 19:36:48 +00:00
time.h-data conformtest: Correct time.h XPG3 expectations. 2016-05-12 20:47:15 +00:00
uchar.h-data conformtest: Clean up / correct / expand C99 and C11 expectations. 2012-11-07 19:36:48 +00:00
ucontext.h-data conformtest: correct set of standards for which more headers are tested. 2014-03-06 17:43:46 +00:00
ulimit.h-data First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
unistd.h-data conformtest: Correct some unistd.h expectations for XPG3, XPG4. 2016-05-12 17:39:04 +00:00
utime.h-data Fix up POSIX testing in conformtest 2012-02-26 13:17:27 -05:00
utmpx.h-data conformtest: Support xfail markers on individual assertions. 2015-06-19 20:05:41 +00:00
varargs.h-data conformtest: correct set of standards for which some headers are tested. 2014-03-06 17:42:03 +00:00
wchar.h-data conformtest: Fix miscellaneous UNIX98 expectations. 2012-11-10 01:13:39 +00:00
wctype.h-data conformtest: Clean up / correct / expand C99 and C11 expectations. 2012-11-07 19:36:48 +00:00
wordexp.h-data conformtest: Clean up expectations for POSIX for various headers. 2012-11-19 22:20:44 +00:00