From patchwork Tue Mar 7 10:51:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 94971 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp1829322qgd; Tue, 7 Mar 2017 02:54:10 -0800 (PST) X-Received: by 10.84.215.215 with SMTP id g23mr34345822plj.159.1488884050109; Tue, 07 Mar 2017 02:54:10 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w6si2373047pgg.403.2017.03.07.02.54.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Mar 2017 02:54:10 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-77724-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-77724-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-77724-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=s6Aa1vsRdOkgQhqvi4HuWAIufdasYDp ZYJGSveP1+77nsqaGLHIHBMR86hte1q270ogG4e2AFWdM+2CUYvBkmwoJcbd1WWn nFsKTBDAHNPWBjpqsI4vHZ1QWR2iQxZyIaOYA13wq/ttTVsIDcBUJI/+9NdN0ZM3 eQ3/qX3zPI2Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=JQy3ZeOLxvVo4JLNpxeNPSrVgoA=; b=NhNIe cr9aE+xHbuhClFZl8U+ioWWHPuIk7bOcMEXp6kWYqD6PkZ9AFgSnJVj/EnwlRBWl vqzwnUojEzRFLw7pHJ1TgF9q6H/nHz382LXnYOLfyb8VeQc6Uk2gQmVn5sHUkIS4 mvIqRJ7AZ2+U60e23aCvTqyosG/6YrpWRU1KGQ= Received: (qmail 86209 invoked by alias); 7 Mar 2017 10:52:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 86160 invoked by uid 89); 7 Mar 2017 10:52:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=366, 296 X-HELO: mail-wm0-f41.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=yMYmsmwBjQXQaCoz2lTzfiEt+PZGJnxY7N7EUWb2qFU=; b=mm4pTj+OTr8vOk8rmWh/vvYhR6xHN6OfJve4NklM5CbuvMw7sDl/sBXwf7fjx9fGPC fH4IVJiH2FSZ1+HY/Z1vdgIvOZhwwWh+SpnKjwHs4mQ42LQb5ybrlRdIwKkXt4Wwbs8+ vpMF5+k1A8lqF24XCUVPW7cFapIFQAItrhSFulaxz64m93DEaSh7plMsdzdDTKhnrOJL ZGz3Ny2Th4U31yjV8ZstmdL8a9FcGptEXzMefhdrW0MTCAJgmXXzfJ2nWeio1fUI0ULo JrPBdpKfBL5wgwLwVknK4f1TaLB5BLp0mrhMIkyXkasIg2J5dPOKjgmkBs5V2PAKGO9Y hInQ== X-Gm-Message-State: AMke39mKx4aKAQUyK0SEA0dINpUSoJJykXPwXxjXkrWxi3ph0znyvgMwvaFeGVH2sOF1Wu7Q X-Received: by 10.28.61.11 with SMTP id k11mr18825957wma.119.1488883924517; Tue, 07 Mar 2017 02:52:04 -0800 (PST) From: Adhemerval Zanella X-Google-Original-From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 5/6] Consolidate Linux sendto implementation Date: Tue, 7 Mar 2017 11:51:54 +0100 Message-Id: <1488883915-29716-6-git-send-email-adhemerval.zanella@linaro.com> In-Reply-To: <1488883915-29716-1-git-send-email-adhemerval.zanella@linaro.com> References: <1488883915-29716-1-git-send-email-adhemerval.zanella@linaro.com> This patch consolidates the sendto Linux syscall implementation on sysdeps/unix/sysv/linux/sendto.c. The changes are: 1. Define __ASSUME_SENDTO_SYSCALL by default. 2. Undef it for architectures that do not support __NR_sendto. Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, aarch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu. * sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove sendto 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/kernel-features.h (__ASSUME_SENDTO_SYSCALL): Define by default. * sysdeps/unix/sysv/linux/i386/kernel-features.h (__ASSUME_SENDTO_SYSCALL): Undef it is kernel does not support __NR_sendto. * sysdeps/unix/sysv/linux/m68k/kernel-features.h (__ASSUME_SENDTO_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/s390/kernel-features.h (__ASSUME_SENDTO_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h (__ASSUME_SENDTO_SYSCALL): Remove definition. * sysdeps/unix/sysv/linux/powerpc/kernel-features.h (__ASSUME_SENDTO_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sh/kernel-features.h: (__ASSUME_SENDTO_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sendto.c: Simplify includes. --- ChangeLog | 26 ++++++++++++++++++++++ sysdeps/unix/sysv/linux/alpha/syscalls.list | 1 - sysdeps/unix/sysv/linux/arm/syscalls.list | 1 - sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 - sysdeps/unix/sysv/linux/i386/kernel-features.h | 2 +- sysdeps/unix/sysv/linux/ia64/syscalls.list | 1 - sysdeps/unix/sysv/linux/kernel-features.h | 1 + sysdeps/unix/sysv/linux/m68k/kernel-features.h | 2 +- .../unix/sysv/linux/microblaze/kernel-features.h | 1 - sysdeps/unix/sysv/linux/mips/syscalls.list | 1 - sysdeps/unix/sysv/linux/powerpc/kernel-features.h | 1 - sysdeps/unix/sysv/linux/s390/kernel-features.h | 2 +- sysdeps/unix/sysv/linux/sendto.c | 5 ----- sysdeps/unix/sysv/linux/sh/kernel-features.h | 1 - .../unix/sysv/linux/sparc/sparc64/syscalls.list | 1 - sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 17 files changed, 30 insertions(+), 19 deletions(-) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index 8a62b6e..304e97e 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -11,7 +11,6 @@ getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen send - send Ci:ibni __libc_send __send send -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 9f445e6..4ca4f81 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -28,7 +28,6 @@ getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen send - send Ci:ibni __libc_send __send send -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index c16ee52..ed8b216 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -7,7 +7,6 @@ bind - bind i:ipi __bind bind listen - listen i:ii __listen listen getsockname - getsockname i:ipp __getsockname getsockname getpeername - getpeername i:ipp __getpeername getpeername -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto setsockopt - setsockopt i:iiibn __setsockopt setsockopt getsockopt - getsockopt i:iiiBN __getsockopt getsockopt shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index 1248877..eaa20b3 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -7,7 +7,6 @@ getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen send - send Ci:ibni __libc_send __send send -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index a886442..6392034 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -36,7 +36,6 @@ # define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_GETPEERNAME_SYSCALL 1 -# define __ASSUME_SENDTO_SYSCALL 1 # define __ASSUME_SENDTO_FOR_SEND_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -51,6 +50,7 @@ # undef __ASSUME_RECVMSG_SYSCALL # undef __ASSUME_CONNECT_SYSCALL # undef __ASSUME_RECVFROM_SYSCALL +# undef __ASSUME_SENDTO_SYSCALL #endif /* i686 only supports ipc syscall. */ diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index 24e9c98..64d47f4 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -11,7 +11,6 @@ getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen send - send Ci:ibni __libc_send __send send -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index c6c816e..318fcf9 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -150,6 +150,7 @@ #define __ASSUME_ACCEPT_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_RECVFROM_SYSCALL 1 +#define __ASSUME_SENDTO_SYSCALL 1 /* Support for SysV IPC through wired syscalls. All supported architectures either support ipc syscall and/or all the ipc correspondent syscalls. */ diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h index f2b4958..0f590fd 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -30,7 +30,6 @@ # define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_GETPEERNAME_SYSCALL 1 -# define __ASSUME_SENDTO_SYSCALL 1 # define __ASSUME_SENDTO_FOR_SEND_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -47,6 +46,7 @@ # undef __ASSUME_RECVMSG_SYSCALL # undef __ASSUME_CONNECT_SYSCALL # undef __ASSUME_RECVFROM_SYSCALL +# undef __ASSUME_SENDTO_SYSCALL #endif /* No support for PI futexes or robust mutexes before 3.10 for m68k. */ diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h index e4bf4d5..fe170a0 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -28,7 +28,6 @@ #define __ASSUME_GETPEERNAME_SYSCALL 1 #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 -#define __ASSUME_SENDTO_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 #define __ASSUME_GETSOCKOPT_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index 48a33bb..0f0ecc1 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -18,7 +18,6 @@ getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen send - send Ci:ibni __libc_send __send send -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index a0d2e8f..dc9ad94 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -29,7 +29,6 @@ #define __ASSUME_GETPEERNAME_SYSCALL 1 #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 -#define __ASSUME_SENDTO_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 #define __ASSUME_GETSOCKOPT_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index 59bc434..e79191a 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -30,7 +30,6 @@ # define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_GETPEERNAME_SYSCALL 1 -# define __ASSUME_SENDTO_SYSCALL 1 # define __ASSUME_SENDTO_FOR_SEND_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -47,6 +46,7 @@ # undef __ASSUME_RECVMSG_SYSCALL # undef __ASSUME_CONNECT_SYSCALL # undef __ASSUME_RECVFROM_SYSCALL +# undef __ASSUME_SENDTO_SYSCALL #endif /* s390 only supports ipc syscall. */ diff --git a/sysdeps/unix/sysv/linux/sendto.c b/sysdeps/unix/sysv/linux/sendto.c index 2b9e1d7..be1bc6f 100644 --- a/sysdeps/unix/sysv/linux/sendto.c +++ b/sysdeps/unix/sysv/linux/sendto.c @@ -15,14 +15,9 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include - #include #include -#include -#include ssize_t __libc_sendto (int fd, const void *buf, size_t len, int flags, diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h index 5ed5f93..b0b3215 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -32,7 +32,6 @@ #define __ASSUME_GETPEERNAME_SYSCALL 1 #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 -#define __ASSUME_SENDTO_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 #define __ASSUME_GETSOCKOPT_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list index bf2cfdc..4cfc2af 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list @@ -8,7 +8,6 @@ getsockname - getsockname 3 __getsockname getsockname getsockopt - getsockopt 5 __getsockopt getsockopt listen - listen 2 __listen listen send - send C:4 __libc_send __send send -sendto - sendto C:6 __libc_sendto __sendto sendto setsockopt - setsockopt 5 __setsockopt setsockopt shutdown - shutdown 2 __shutdown shutdown socketpair - socketpair 4 __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index 7ff0376..889193b 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -15,7 +15,6 @@ getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket