@@ -22,9 +22,10 @@ type {struct msghdr}
element {struct msghdr} {void*} msg_name
element {struct msghdr} socklen_t msg_namelen
element {struct msghdr} {struct iovec*} msg_iov
-element {struct msghdr} int msg_iovlen
+// Bug 16919: wrong type for msg_iovlen and msg_controllen members.
+xfail-element {struct msghdr} int msg_iovlen
element {struct msghdr} {void*} msg_control
-element {struct msghdr} socklen_t msg_controllen
+xfail-element {struct msghdr} socklen_t msg_controllen
element {struct msghdr} int msg_flags
type {struct iovec}
@@ -34,7 +35,8 @@ element {struct iovec} size_t iov_len
type {struct cmsghdr}
-element {struct cmsghdr} socklen_t cmsg_len
+// Bug 16919: wrong type for cmsg_len member.
+xfail-element {struct cmsghdr} socklen_t cmsg_len
element {struct cmsghdr} int cmsg_level
element {struct cmsghdr} int cmsg_type
@@ -115,7 +115,7 @@ libpthread-routines = nptl-init vars events version pt-interp \
ptw-pread ptw-pread64 ptw-pwrite ptw-pwrite64 \
ptw-tcdrain ptw-wait ptw-waitpid ptw-msgrcv ptw-msgsnd \
ptw-sigwait ptw-sigsuspend \
- ptw-oldrecvmsg ptw-oldsendmsg \
+ ptw-recvmsg ptw-sendmsg \
pt-raise pt-system \
flockfile ftrylockfile funlockfile \
sigaction \
@@ -207,8 +207,8 @@ CFLAGS-accept.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-sendto.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-connect.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-recvfrom.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-oldrecvmsg.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-oldsendmsg.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recvmsg.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sendmsg.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-pt-system.c = -fexceptions
@@ -124,12 +124,9 @@ ifeq ($(subdir),socket)
sysdep_headers += net/if_ppp.h net/ppp-comp.h \
net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
net/if_slip.h net/if_packet.h net/if_shaper.h
-sysdep_routines += cmsg_nxthdr oldrecvmsg oldsendmsg \
- oldrecvmmsg oldsendmmsg
-CFLAGS-recvmsg.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sendmsg.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-oldrecvmsg.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-oldsendmsg.c = -fexceptions -fasynchronous-unwind-tables
+sysdep_routines += cmsg_nxthdr
+CFLAGS-recvmmsg.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sendmmsg.c = -fexceptions -fasynchronous-unwind-tables
endif
ifeq ($(subdir),sunrpc)
@@ -5,10 +5,6 @@ ld {
}
}
libc {
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
-
GLIBC_PRIVATE {
__vdso_clock_gettime;
__vdso_clock_getres;
@@ -2089,7 +2089,3 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmmsg F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmmsg F
-GLIBC_2.24 sendmsg F
@@ -85,9 +85,6 @@ libc {
#errlist-compat 140
_sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
GLIBC_PRIVATE {
__libc_alpha_cache_shape;
}
@@ -2000,10 +2000,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmmsg F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -90,8 +90,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _Exit F
GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
@@ -27,8 +27,6 @@
#include <stddef.h>
#include <sys/types.h>
-#include <endian.h>
-#include <bits/wordsize.h>
/* Type for length arguments in socket calls. */
#ifndef __socklen_t_defined
@@ -252,32 +250,13 @@ struct msghdr
socklen_t msg_namelen; /* Length of address data. */
struct iovec *msg_iov; /* Vector of data to send/receive into. */
-#if __WORDSIZE == 64
-# if __BYTE_ORDER == __BIG_ENDIAN
- int __glibc_reserved1; /* Pad to adjust Linux size to POSIX defined
- size for msg_iovlen. */
- int msg_iovlen; /* Number of elements in the vector. */
-# else
- int msg_iovlen;
- int __glibc_reserved1;
-# endif
-#else
- int msg_iovlen;
-#endif
+ size_t msg_iovlen; /* Number of elements in the vector. */
void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
-#if __WORDSIZE == 64
-# if __BYTE_ORDER == __BIG_ENDIAN
- int __glibc_reserved2; /* Pad to adjust Linux size to POSIX defined
- size for msg_controllen. */
- socklen_t msg_controllen; /* Ancillary data buffer length. */
-# else
- socklen_t msg_controllen;
- int __glibc_reserved2;
-# endif
-#else
- socklen_t msg_controllen;
-#endif
+ size_t msg_controllen; /* Ancillary data buffer length.
+ !! The type should be socklen_t but the
+ definition of the kernel is incompatible
+ with this. */
int msg_flags; /* Flags on received message. */
};
@@ -285,19 +264,11 @@ struct msghdr
/* Structure used for storage of ancillary data object information. */
struct cmsghdr
{
-#if __WORDSIZE == 64
-# if __BYTE_ORDER == __BIG_ENDIAN
- int __glibc_reserved1; /* Pad toadjust Linux size to POSIX defined
- size for cmsg_len. */
- socklen_t cmsg_len; /* Length of data in cmsg_data plus length
- of cmsghdr structure. */
-# else
- socklen_t cmsg_len;
- int __glibc_reserved1;
-# endif
-#else
- socklen_t cmsg_len;
-#endif
+ size_t cmsg_len; /* Length of data in cmsg_data plus length
+ of cmsghdr structure.
+ !! The type should be socklen_t but the
+ definition of the kernel is incompatible
+ with this. */
int cmsg_level; /* Originating protocol. */
int cmsg_type; /* Protocol specific type. */
#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
@@ -35,7 +35,4 @@ libc {
GLIBC_2.19 {
fanotify_mark;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
}
@@ -1854,8 +1854,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -45,9 +45,6 @@ libc {
# f*
fallocate64;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
GLIBC_PRIVATE {
__modify_ldt;
}
@@ -2012,8 +2012,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -1876,10 +1876,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmmsg F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -40,9 +40,6 @@ libc {
GLIBC_2.12 {
__m68k_read_tp;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
GLIBC_PRIVATE {
__vdso_atomic_cmpxchg_32; __vdso_atomic_barrier;
}
@@ -91,8 +91,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _Exit F
GLIBC_2.4 _IO_2_1_stderr_ D 0x98
@@ -1968,8 +1968,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -2,7 +2,4 @@ libc {
GLIBC_2.18 {
fallocate64;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
}
@@ -2089,5 +2089,3 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
@@ -3,7 +3,4 @@ libc {
getrlimit64;
setrlimit64;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
}
@@ -1943,8 +1943,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -1941,8 +1941,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -3,7 +3,4 @@ libc {
getrlimit64;
setrlimit64;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
}
@@ -1939,8 +1939,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
deleted file mode 100644
@@ -1,5 +0,0 @@
-libc {
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
-}
@@ -1934,10 +1934,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmmsg F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -3,7 +3,4 @@ libc {
_flush_cache;
cacheflush;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
}
@@ -2130,5 +2130,3 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
deleted file mode 100644
@@ -1,87 +0,0 @@
-/* Compatibility version of recvmsg.
- Copyright (C) 2010-2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sys/socket.h>
-#include <sysdep-cancel.h>
-#include <socketcall.h>
-#include <shlib-compat.h>
-
-#if __WORDSIZE == 64
-# if SHLIB_COMPAT (libc, GLIBC_2_12, GLIBC_2_24)
-
-/* Do not use the recvmmsg syscall on socketcall architectures unless
- it was added at the same time as the socketcall support or can be
- assumed to be present. */
-# if defined __ASSUME_SOCKETCALL \
- && !defined __ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL \
- && !defined __ASSUME_RECVMMSG_SYSCALL
-# undef __NR_recvmmsg
-# endif
-
-int
-__old_recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen,
- int flags, struct timespec *tmo)
-{
-# ifdef __NR_recvmmsg
- return SYSCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, tmo);
-# elif defined __NR_socketcall
-# ifdef __ASSUME_RECVMMSG_SOCKETCALL
- return SOCKETCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, tmo);
-# else
- static int have_recvmmsg;
- if (__glibc_likely (have_recvmmsg >= 0))
- {
- int ret = SOCKETCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags,
- tmo);
- /* The kernel returns -EINVAL for unknown socket operations.
- We need to convert that error to an ENOSYS error. */
- if (__builtin_expect (ret < 0, 0)
- && have_recvmmsg == 0
- && errno == EINVAL)
- {
- /* Try another call, this time with an invalid file
- descriptor and all other parameters cleared. This call
- will not cause any harm and it will return
- immediately. */
- ret = SOCKETCALL_CANCEL (invalid, -1);
- if (errno == EINVAL)
- {
- have_recvmmsg = -1;
- __set_errno (ENOSYS);
- }
- else
- {
- have_recvmmsg = 1;
- __set_errno (EINVAL);
- }
- return -1;
- }
- return ret;
- }
- __set_errno (ENOSYS);
- return -1;
-# endif /* __ASSUME_RECVMMSG_SOCKETCALL */
-# else
- __set_errno (ENOSYS);
- return -1;
-# endif
-}
-compat_symbol (libc, __old_recvmmsg, recvmmsg, GLIBC_2_12);
-
-# endif /* SHLIB_COMPAT (libc, GLIBC_2_12, GLIBC_2_24) */
-#endif /* __WORDSIZE == 64 */
deleted file mode 100644
@@ -1,40 +0,0 @@
-/* Compatibility version of recvmsg.
- Copyright (C) 2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sys/socket.h>
-#include <sysdep-cancel.h>
-#include <socketcall.h>
-#include <shlib-compat.h>
-
-/* Both libc.so and libpthread.so provides sendmsg, so we need to
- provide the compat symbol for both libraries. */
-#if SHLIB_COMPAT (MODULE_NAME, GLIBC_2_0, GLIBC_2_24)
-
-/* We can use the same struct layout for old symbol version since
- size is the same. */
-ssize_t
-__old_recvmsg (int fd, struct msghdr *msg, int flags)
-{
-# ifdef __ASSUME_RECVMSG_SYSCALL
- return SYSCALL_CANCEL (recvmsg, fd, msg, flags);
-# else
- return SOCKETCALL_CANCEL (recvmsg, fd, msg, flags);
-# endif
-}
-compat_symbol (MODULE_NAME, __old_recvmsg, recvmsg, GLIBC_2_0);
-#endif
deleted file mode 100644
@@ -1,76 +0,0 @@
-/* Compatibility implementation of sendmmsg.
- Copyright (C) 2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sys/socket.h>
-#include <sysdep-cancel.h>
-#include <socketcall.h>
-#include <shlib-compat.h>
-
-#if __WORDSIZE == 64
-# if SHLIB_COMPAT (libc, GLIBC_2_14, GLIBC_2_24)
-
-int
-__old_sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen,
- int flags)
-{
-# ifdef __NR_sendmmsg
- return SYSCALL_CANCEL (sendmmsg, fd, vmessages, vlen, flags);
-# elif defined __NR_socketcall
-# ifdef __ASSUME_SENDMMSG_SOCKETCALL
- return SOCKETCALL_CANCEL (sendmmsg, fd, vmessages, vlen, flags);
-# else
- static int have_sendmmsg;
- if (__glibc_likely (have_sendmmsg >= 0))
- {
- int ret = SOCKETCALL_CANCEL (sendmmsg, fd, vmessages, vlen, flags);
- /* The kernel returns -EINVAL for unknown socket operations.
- We need to convert that error to an ENOSYS error. */
- if (__builtin_expect (ret < 0, 0)
- && have_sendmmsg == 0
- && errno == EINVAL)
- {
- /* Try another call, this time with an invalid file
- descriptor and all other parameters cleared. This call
- will not cause any harm and it will return
- immediately. */
- ret = SOCKETCALL_CANCEL (invalid, -1);
- if (errno == EINVAL)
- {
- have_sendmmsg = -1;
- __set_errno (ENOSYS);
- }
- else
- {
- have_sendmmsg = 1;
- __set_errno (EINVAL);
- }
- return -1;
- }
- return ret;
- }
- __set_errno (ENOSYS);
- return -1;
-# endif /* __ASSUME_SENDMMSG_SOCKETCALL */
-# else /* defined __NR_socketcall */
- __set_errno (ENOSYS);
- return -1;
-# endif
-}
-compat_symbol (libc, __old_sendmmsg, sendmmsg, GLIBC_2_14);
-# endif /* SHLIB_COMPAT (libc, GLIBC_2_14, GLIBC_2_24) */
-#endif /* __WORDSIZE == 64 */
deleted file mode 100644
@@ -1,40 +0,0 @@
-/* Compatibility implementation of sendmsg.
- Copyright (C) 2016 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sys/socket.h>
-#include <sysdep-cancel.h>
-#include <socketcall.h>
-#include <shlib-compat.h>
-
-/* Both libc.so and libpthread.so provides sendmsg, so we need to
- provide the compat symbol for both libraries. */
-#if SHLIB_COMPAT (MODULE_NAME, GLIBC_2_0, GLIBC_2_24)
-
-/* We can use the same struct layout for old symbol version since
- size is the same. */
-ssize_t
-__old_sendmsg (int fd, const struct msghdr *msg, int flags)
-{
-# ifdef __ASSUME_SENDMSG_SYSCALL
- return SYSCALL_CANCEL (sendmsg, fd, msg, flags);
-# else
- return SOCKETCALL_CANCEL (sendmsg, fd, msg, flags);
-# endif
-}
-compat_symbol (MODULE_NAME, __old_sendmsg, sendmsg, GLIBC_2_0);
-#endif
@@ -5,9 +5,6 @@ ld {
}
}
libc {
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
GLIBC_PRIVATE {
__vdso_get_tbfreq;
__vdso_clock_gettime;
@@ -1972,8 +1972,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -1977,8 +1977,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -22,9 +22,6 @@ libc {
GLIBC_2.17 {
__ppc_get_timebase_freq;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
}
librt {
@@ -2177,7 +2177,3 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmmsg F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmmsg F
-GLIBC_2.24 sendmsg F
@@ -91,10 +91,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmmsg F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 _Exit F
GLIBC_2.3 _IO_2_1_stderr_ D 0xe0
@@ -16,10 +16,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <errno.h>
#include <sys/socket.h>
-#include <socketcall.h>
+
#include <sysdep-cancel.h>
-#include <shlib-compat.h>
+#include <sys/syscall.h>
+#include <kernel-features.h>
/* Do not use the recvmmsg syscall on socketcall architectures unless
it was added at the same time as the socketcall support or can be
@@ -30,39 +32,31 @@
# undef __NR_recvmmsg
#endif
-static inline void
-adjust_mmsghdr (struct mmsghdr *vmessages, unsigned int vlen)
-{
-#if __WORDSIZE == 64
- /* POSIX specifies that both msghdr::msg_iovlen and msghdr::msg_controllen
- to be int and socklen_t respectively. However Linux defines it as
- both size_t. So for 64-bit it requires some adjustments by zeroing
- the pad fields. */
- struct mmsghdr *vmhdr = vmessages;
- for (unsigned int i = 0; i != 0; i--, vmhdr++)
- {
- vmhdr->msg_hdr.__glibc_reserved1 = 0;
- vmhdr->msg_hdr.__glibc_reserved2 = 0;
- }
-#endif
-}
-
+#ifdef __NR_recvmmsg
int
-__recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen,
- int flags, struct timespec *tmo)
+recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
+ struct timespec *tmo)
{
-#ifdef __NR_recvmmsg
- adjust_mmsghdr (vmessages, vlen);
return SYSCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, tmo);
+}
#elif defined __NR_socketcall
+# include <socketcall.h>
# ifdef __ASSUME_RECVMMSG_SOCKETCALL
- adjust_mmsghdr (vmessages, vlen);
+int
+recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
+ struct timespec *tmo)
+{
return SOCKETCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, tmo);
+}
# else
- static int have_recvmmsg;
+static int have_recvmmsg;
+
+int
+recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
+ struct timespec *tmo)
+{
if (__glibc_likely (have_recvmmsg >= 0))
{
- adjust_mmsghdr (vmessages, vlen);
int ret = SOCKETCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags,
tmo);
/* The kernel returns -EINVAL for unknown socket operations.
@@ -92,19 +86,8 @@ __recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen,
}
__set_errno (ENOSYS);
return -1;
-# endif /* __ASSUME_RECVMMSG_SOCKETCALL */
-#else
-# define STUB 1
- __set_errno (ENOSYS);
- return -1;
-#endif
}
-#ifdef STUB
-stub_warning (recvmmsg)
-#endif
-
-#if __WORDSIZE == 64
-versioned_symbol (libc, __recvmmsg, recvmmsg, GLIBC_2_24);
+# endif /* __ASSUME_RECVMMSG_SOCKETCALL */
#else
-weak_alias (__recvmmsg, recvmmsg)
+# include <socket/recvmmsg.c>
#endif
@@ -1,4 +1,5 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Linux recvmsg syscall wrapper.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,35 +24,11 @@
ssize_t
__libc_recvmsg (int fd, struct msghdr *msg, int flags)
{
- ssize_t ret;
-
- /* POSIX specifies that both msghdr::msg_iovlen and msghdr::msg_controllen
- to be int and socklen_t respectively. However Linux defines it as
- both size_t. So for 64-bit it requires some adjustments by copying to
- temporary header and zeroing the pad fields. */
-#if __WORDSIZE == 64
- struct msghdr hdr, *orig = msg;
- if (msg != NULL)
- {
- hdr = *msg;
- hdr.__glibc_reserved1 = 0;
- hdr.__glibc_reserved2 = 0;
- msg = &hdr;
- }
-#endif
-
-#ifdef __ASSUME_RECVMSG_SYSCALL
- ret = SYSCALL_CANCEL (recvmsg, fd, msg, flags);
-#else
- ret = SOCKETCALL_CANCEL (recvmsg, fd, msg, flags);
-#endif
-
-#if __WORDSIZE == 64
- if (orig != NULL)
- *orig = hdr;
-#endif
-
- return ret;
+# ifdef __ASSUME_RECVMSG_SYSCALL
+ return SYSCALL_CANCEL (recvmsg, fd, msg, flags);
+# else
+ return SOCKETCALL_CANCEL (recvmsg, fd, msg, flags);
+# endif
}
+weak_alias (__libc_recvmsg, recvmsg)
weak_alias (__libc_recvmsg, __recvmsg)
-versioned_symbol (libc, __libc_recvmsg, recvmsg, GLIBC_2_24);
@@ -49,9 +49,6 @@ libc {
GLIBC_2.11 {
fallocate64;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
}
libutil {
@@ -1972,8 +1972,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -4,9 +4,6 @@ libc {
__register_frame; __register_frame_table; __deregister_frame;
__frame_state_for; __register_frame_info_table;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
}
librt {
@@ -1873,10 +1873,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmmsg F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -16,10 +16,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <errno.h>
#include <sys/socket.h>
-#include <socketcall.h>
+
#include <sysdep-cancel.h>
-#include <shlib-compat.h>
+#include <sys/syscall.h>
+#include <kernel-features.h>
/* Do not use the sendmmsg syscall on socketcall architectures unless
it was added at the same time as the socketcall support or can be
@@ -30,53 +32,31 @@
# undef __NR_sendmmsg
#endif
-#if __WORDSIZE == 64
-static inline int
-send_mmsghdr (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
-{
- /* Emulate kernel interface for vlen size. */
- if (vlen > IOV_MAX)
- vlen = IOV_MAX;
- if (vlen == 0)
- return 0;
- /* POSIX specifies that both msghdr::msg_iovlen and msghdr::msg_controllen
- to be int and socklen_t respectively, however Linux defines it as both
- size_t. So for 64-bit it requires some adjustments by copying to
- temporary header and zeroing the pad fields.
- The problem is sendmmsg's msghdr may points to an already-filled control
- buffer and modifying it is not part of sendmmsg contract (the data may
- be in ro map). So interact over the msghdr calling the sendmsg that
- adjust the header using a temporary buffer. */
- for (unsigned int i = 0; i < vlen; i++)
- {
- ssize_t ret = __sendmsg (fd, &vmessages[i].msg_hdr, flags);
- if (ret < 0)
- return -1;
- vmessages[i].msg_len = ret;
- }
- return 1;
-}
-#endif
-
+#ifdef __NR_sendmmsg
int
__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
{
-#if __WORDSIZE == 64
- return send_mmsghdr (fd, vmessages, vlen, flags);
-#elif defined __NR_sendmmsg
return SYSCALL_CANCEL (sendmmsg, fd, vmessages, vlen, flags);
+}
+libc_hidden_def (__sendmmsg)
+weak_alias (__sendmmsg, sendmmsg)
#elif defined __NR_socketcall
+# include <socketcall.h>
# ifdef __ASSUME_SENDMMSG_SOCKETCALL
+int
+__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
+{
return SOCKETCALL_CANCEL (sendmmsg, fd, vmessages, vlen, flags);
+}
# else
- static int have_sendmmsg;
+static int have_sendmmsg;
+
+int
+__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
+{
if (__glibc_likely (have_sendmmsg >= 0))
{
-# if __WORDSIZE == 64
- int ret = send_mmsghdr (fd, vmessages, vlen, flags);
-# else
int ret = SOCKETCALL_CANCEL (sendmmsg, fd, vmessages, vlen, flags);
-# endif
/* The kernel returns -EINVAL for unknown socket operations.
We need to convert that error to an ENOSYS error. */
if (__builtin_expect (ret < 0, 0)
@@ -104,20 +84,10 @@ __sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
}
__set_errno (ENOSYS);
return -1;
-# endif /* __ASSUME_SENDMMSG_SOCKETCALL */
-#else /* defined __NR_socketcall */
-# define STUB 1
- __set_errno (ENOSYS);
- return -1;
-#endif
}
-#ifdef STUB
-stub_warning (sendmmsg)
-#endif
-
+# endif /* __ASSUME_SENDMMSG_SOCKETCALL */
libc_hidden_def (__sendmmsg)
-#if __WORDSIZE == 64
-versioned_symbol (libc, __sendmmsg, sendmmsg, GLIBC_2_24);
-#else
weak_alias (__sendmmsg, sendmmsg)
+#else
+# include <socket/sendmmsg.c>
#endif
@@ -1,4 +1,5 @@
-/* Copyright (C) 2015-2016 Free Software Foundation, Inc.
+/* Compatibility implementation of sendmsg.
+ Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,26 +24,11 @@
ssize_t
__libc_sendmsg (int fd, const struct msghdr *msg, int flags)
{
- /* POSIX specifies that both msghdr::msg_iovlen and msghdr::msg_controllen
- to be int and socklen_t respectively. However Linux defines it as
- both size_t. So for 64-bit it requires some adjustments by copying to
- temporary header and zeroing the pad fields. */
-#if __WORDSIZE == 64
- struct msghdr hdr;
- if (msg != NULL)
- {
- hdr = *msg;
- hdr.__glibc_reserved1 = 0;
- hdr.__glibc_reserved2 = 0;
- msg = &hdr;
- }
-#endif
-
-#ifdef __ASSUME_SENDMSG_SYSCALL
+# ifdef __ASSUME_SENDMSG_SYSCALL
return SYSCALL_CANCEL (sendmsg, fd, msg, flags);
-#else
+# else
return SOCKETCALL_CANCEL (sendmsg, fd, msg, flags);
-#endif
+# endif
}
+weak_alias (__libc_sendmsg, sendmsg)
weak_alias (__libc_sendmsg, __sendmsg)
-versioned_symbol (libc, __libc_sendmsg, sendmsg, GLIBC_2_24);
@@ -30,7 +30,4 @@ libc {
GLIBC_2.16 {
fanotify_mark;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
}
@@ -1858,8 +1858,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -29,9 +29,6 @@ libc {
__getshmlba;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
}
libpthread {
@@ -1964,8 +1964,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -8,9 +8,6 @@ libc {
# w*
wordexp;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
}
librt {
@@ -1902,10 +1902,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmmsg F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -11,9 +11,6 @@ libc {
fallocate64;
set_dataplane;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
GLIBC_PRIVATE {
__syscall_error;
__vdso_clock_gettime;
@@ -2096,5 +2096,3 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
deleted file mode 100644
@@ -1,5 +0,0 @@
-libc {
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
-}
@@ -2096,7 +2096,3 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmmsg F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmmsg F
-GLIBC_2.24 sendmsg F
@@ -2096,5 +2096,3 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F
deleted file mode 100644
@@ -1,5 +0,0 @@
-libc {
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
-}
@@ -1853,10 +1853,6 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmmsg F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmmsg F
-GLIBC_2.24 sendmsg F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 __ctype_b_loc F
GLIBC_2.3 __ctype_tolower_loc F
@@ -6,9 +6,6 @@ libc {
modify_ldt;
}
- GLIBC_2.24 {
- recvmsg; sendmsg;
- }
}
librt {
@@ -2096,5 +2096,3 @@ GLIBC_2.23 fts64_read F
GLIBC_2.23 fts64_set F
GLIBC_2.24 GLIBC_2.24 A
GLIBC_2.24 quick_exit F
-GLIBC_2.24 recvmsg F
-GLIBC_2.24 sendmsg F