+2016-03-08 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * sysdeps/unix/sysv/linux/accept.c (__libc_accept): Replace
+ __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL by __ASSUME_ACCEPT4_SYSCALL.
+ * sysdeps/unix/sysv/linux/alpha/syscalls.list?: Remove accept from
+ auto-generation list.
+ * sysdeps/unix/sysv/linux/arm/syscalls.list: Likewise.
+ * sysdeps/unix/sysv/linux/generic/syscalls.list: Likewise.
+ * sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise.
+ * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Likewise.
+ * sysdeps/unix/sysv/linux/i386/kernel-features.h
+ (__ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL): Remove define.
+ (__ASSUME_ACCEPT_SYSCALL): Undefine.
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ (__ASSUME_ACCEPT_SYSCALL): New define.
+ * sysdeps/unix/sysv/linux/m68k/kernel-features.h
+ (__ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL): Remove define.
+ (__ASSUME_ACCEPT_SYSCALL): Define wheter kernel version supports.
+ * sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+ (__ASSUME_ACCEPT_SYSCALL): Define.
+ * sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+ (__ASSUME_ACCEPT_SYSCALL): Undefine.
+ * sysdeps/unix/sysv/linux/s390/kernel-features.h
+ (__ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL): Remove define.
+ (__ASSUME_ACCEPT_SYSCALL): Undefine.
+ * sysdeps/unix/sysv/linux/sh/kernel-features.h
+ (__ASSUME_ACCEPT_SYSCALL): Undefine.
+ * sysdeps/unix/sysv/linux/sparc/kernel-features.h
+ (__ASSUME_ACCEPT_SYSCALL): Undefine for 32 bits.
+
2017-03-08 Yury Norov <ynorov@caviumnetworks.com>
Zack Weinberg <zackw@panix.com>
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
-#include <signal.h>
#include <sys/socket.h>
-
#include <sysdep-cancel.h>
#include <socketcall.h>
-#include <sys/syscall.h>
-#include <kernel-features.h>
int
__libc_accept (int fd, __SOCKADDR_ARG addr, socklen_t *len)
{
#ifdef __ASSUME_ACCEPT_SYSCALL
return SYSCALL_CANCEL (accept, fd, addr.__sockaddr__, len);
-#elif defined __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL
+#elif defined __ASSUME_ACCEPT4_SYSCALL
return SYSCALL_CANCEL (accept4, fd, addr.__sockaddr__, len, 0);
#else
return SOCKETCALL_CANCEL (accept, fd, addr.__sockaddr__, len);
getpriority - getpriority i:ii __getpriority getpriority
# proper socket implementations:
-accept - accept Ci:iBN __libc_accept __accept accept
bind - bind i:ipi __bind bind
connect - connect Ci:ipi __libc_connect __connect connect
getpeername - getpeername i:ipp __getpeername getpeername
personality EXTRA personality Ei:i __personality personality
# proper socket implementations:
-accept - accept Ci:iBN __libc_accept __accept accept
bind - bind i:ipi __bind bind
connect - connect Ci:ipi __libc_connect __connect connect
getpeername - getpeername i:ipp __getpeername getpeername
socketpair - socketpair i:iiif __socketpair socketpair
bind - bind i:ipi __bind bind
listen - listen i:ii __listen listen
-accept - accept Ci:iBN __libc_accept __accept accept
connect - connect Ci:ipi __libc_connect __connect connect
getsockname - getsockname i:ipp __getsockname getsockname
getpeername - getpeername i:ipp __getpeername getpeername
# File name Caller Syscall name # args Strong name Weak names
# proper socket implementations:
-accept - accept Ci:iBN __libc_accept __accept accept
bind - bind i:ipi __bind bind
connect - connect Ci:ipi __libc_connect __connect connect
getpeername - getpeername i:ipp __getpeername getpeername
# define __ASSUME_BIND_SYSCALL 1
# define __ASSUME_CONNECT_SYSCALL 1
# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL 1
# define __ASSUME_GETSOCKOPT_SYSCALL 1
# define __ASSUME_SETSOCKOPT_SYSCALL 1
# define __ASSUME_GETSOCKNAME_SYSCALL 1
#include_next <kernel-features.h>
+#undef __ASSUME_ACCEPT_SYSCALL
+
#if __LINUX_KERNEL_VERSION < 0x040300
# undef __ASSUME_ACCEPT4_SYSCALL
# undef __ASSUME_SENDMSG_SYSCALL
getpriority - getpriority i:ii __getpriority getpriority
# proper socket implementations:
-accept - accept Ci:iBN __libc_accept __accept accept
bind - bind i:ipi __bind bind
connect - connect Ci:ipi __libc_connect __connect connect
getpeername - getpeername i:ipp __getpeername getpeername
separate syscalls were only added later. */
#define __ASSUME_SENDMSG_SYSCALL 1
#define __ASSUME_RECVMSG_SYSCALL 1
+#define __ASSUME_ACCEPT_SYSCALL 1
/* Support for SysV IPC through wired syscalls. All supported architectures
either support ipc syscall and/or all the ipc correspondent syscalls. */
# define __ASSUME_BIND_SYSCALL 1
# define __ASSUME_CONNECT_SYSCALL 1
# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL 1
# define __ASSUME_GETSOCKOPT_SYSCALL 1
# define __ASSUME_SETSOCKOPT_SYSCALL 1
# define __ASSUME_GETSOCKNAME_SYSCALL 1
#include_next <kernel-features.h>
+#undef __ASSUME_ACCEPT_SYSCALL
+
#if __LINUX_KERNEL_VERSION < 0x040300
# undef __ASSUME_ACCEPT4_SYSCALL
# undef __ASSUME_RECVMMSG_SYSCALL
#define __ASSUME_BIND_SYSCALL 1
#define __ASSUME_CONNECT_SYSCALL 1
#define __ASSUME_LISTEN_SYSCALL 1
-#define __ASSUME_ACCEPT_SYSCALL 1
#define __ASSUME_GETSOCKNAME_SYSCALL 1
#define __ASSUME_GETPEERNAME_SYSCALL 1
#define __ASSUME_SOCKETPAIR_SYSCALL 1
# Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper;
# it's provided for compatibility, though.
#
-accept - accept Ci:iBN __libc_accept __accept accept
bind - bind i:ipi __bind bind
connect - connect Ci:ipi __libc_connect __connect connect
getpeername - getpeername i:ipp __getpeername getpeername
#define __ASSUME_BIND_SYSCALL 1
#define __ASSUME_CONNECT_SYSCALL 1
#define __ASSUME_LISTEN_SYSCALL 1
-#define __ASSUME_ACCEPT_SYSCALL 1
#define __ASSUME_GETSOCKNAME_SYSCALL 1
#define __ASSUME_GETPEERNAME_SYSCALL 1
#define __ASSUME_SOCKETPAIR_SYSCALL 1
# define __ASSUME_BIND_SYSCALL 1
# define __ASSUME_CONNECT_SYSCALL 1
# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL 1
# define __ASSUME_GETSOCKOPT_SYSCALL 1
# define __ASSUME_SETSOCKOPT_SYSCALL 1
# define __ASSUME_GETSOCKNAME_SYSCALL 1
#include_next <kernel-features.h>
+#undef __ASSUME_ACCEPT_SYSCALL
+
#if __LINUX_KERNEL_VERSION < 0x040300
# undef __ASSUME_ACCEPT4_SYSCALL
# undef __ASSUME_RECVMMSG_SYSCALL
#define __ASSUME_BIND_SYSCALL 1
#define __ASSUME_CONNECT_SYSCALL 1
#define __ASSUME_LISTEN_SYSCALL 1
-#define __ASSUME_ACCEPT_SYSCALL 1
#define __ASSUME_GETSOCKNAME_SYSCALL 1
#define __ASSUME_GETPEERNAME_SYSCALL 1
#define __ASSUME_SOCKETPAIR_SYSCALL 1
# undef __ASSUME_SET_ROBUST_LIST
#endif
+#if !defined __arch64__
+# undef __ASSUME_ACCEPT_SYSCALL
+#endif
+
/* sparc only supports ipc syscall. */
#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
# Override select.S in parent directory:
select - select C:5 __select select
-accept - accept C:3 __libc_accept __accept accept
bind - bind 3 __bind bind
connect - connect C:3 __libc_connect __connect connect
getpeername - getpeername 3 __getpeername getpeername
# proper socket implementations:
-accept - accept Ci:iBN __libc_accept __accept accept
bind - bind i:ipi __bind bind
connect - connect Ci:ipi __libc_connect __connect connect
getpeername - getpeername i:ipp __getpeername getpeername