From patchwork Mon Jan 30 14:02:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 92863 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp1377859obz; Mon, 30 Jan 2017 06:03:01 -0800 (PST) X-Received: by 10.98.81.6 with SMTP id f6mr22990182pfb.180.1485784981414; Mon, 30 Jan 2017 06:03:01 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id r7si12638093ple.302.2017.01.30.06.03.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 06:03:01 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-77053-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-77053-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-77053-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=gYKOvQ6AHtLSCWiGLEfnYAVPW093YmU a8XqbRBEiYII3mohIhkwyUSWaKxL03uhr0FIfAwWHp87JZzS5AxFc5URifAetQzu n6YrrgQ9UBQvMReIprX8n3a7r8UACEzUvfbakuQ6bf0U1xNK8OxO4UjEP7mHjvnz Uz5wYFtR6mRM= 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=sIiyzZbdE2DtmyDhzQqnO99Spsg=; b=M+Fwb I65RKK8CPojYw1ESkhhhrdSCblD9+CQufa7KGUfZHU36WaDgjCRmj7bDOvc7Gz8T FrqELxNZPgU45te0CnvzGTj2qOyMz+5OySUyw+rXt3oJ+E4dUpIjBgAZUeLetpO9 gCtLmvpx3zyGNjSLWt71+MVk1+0B3TDPUEx9wg= Received: (qmail 46348 invoked by alias); 30 Jan 2017 14:02:35 -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 46239 invoked by uid 89); 30 Jan 2017 14:02:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy=IPC, correspondent, UD:list, 1514 X-HELO: mail-qt0-f171.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=UAojIcJcDt/sSUib1Hlqfwl20PTCddcmgZLun6QEY+I=; b=reIyk1E5coLsNg4dI4DQObJDvnC9NqbegczBnaZ5RvFUh0ZqMUGGQ+1+KUad79OC3I glUEVntj16uoy97lu09INpC7Z4Y9XObdhqMp+7IfUGddE3a+utmBPVUCRl5cl8Kawdu6 DWhMrBOWAa/wVsR7k9trsa+trvt3QsgYzT3OzPs96VIeqM9lgfoLsFfIgvqO+kRpGyWI +HVEa1IqYJxN0LgYjN0TUlKzBfzjOt3ZNBBQBJmV+3sL7wQkOqg9xxzIbycCDBDhG46K cxRjxDiBBPzj5B8K5AtHPpVBqBMLknGlo6u+Xe//+ARtnd0Mej6xsVXsWHq3jMSOniP7 3YVQ== X-Gm-Message-State: AIkVDXLmX9fNgqXY7f9OJH6+BMqBAOcudHuky8Dz/hob55DXOpeiS+ZDxY8BlywjRX2b/mvg X-Received: by 10.200.52.170 with SMTP id w39mr21745742qtb.123.1485784943621; Mon, 30 Jan 2017 06:02:23 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/4] Consolidate Linux connect implementation Date: Mon, 30 Jan 2017 12:02:04 -0200 Message-Id: <1485784926-2172-3-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1485784926-2172-1-git-send-email-adhemerval.zanella@linaro.org> References: <1485784926-2172-1-git-send-email-adhemerval.zanella@linaro.org> This patch consolidates the connect Linux syscall implementation on sysdeps/unix/sysv/linux/accept.c. The changes are: 1. Remove connect from auto-generation syscalls.list on the architecture that uses __NR_connect. 2. Define __NR_conect as default (__ASSUME_CONNECT_SYSCALL) and undef for architectures that do not support it. 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 connect from auto-generation list. * sysdeps/unix/sysv/linux/arm/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/generic/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/hppa/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/connect.c: Simplify include list. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_CONNECT_SYSCALL): Define. * sysdeps/unix/sysv/linux/i386/kernel-features.h (__ASSUME_CONNECT_SYSCALL): Undef if kernel does not support it. * sysdeps/unix/sysv/linux/m68k/kernel-features.h (__ASSUME_CONNECT_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/s390/kernel-features.h (__ASSUME_CONNECT_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sparc/kernel-features.h (__ASSUME_CONNECT_SYSCALL): Likewise. --- ChangeLog | 21 +++++++++++++++++++++ sysdeps/unix/sysv/linux/alpha/syscalls.list | 1 - sysdeps/unix/sysv/linux/arm/syscalls.list | 1 - sysdeps/unix/sysv/linux/connect.c | 5 ----- 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 +- sysdeps/unix/sysv/linux/mips/syscalls.list | 1 - sysdeps/unix/sysv/linux/s390/kernel-features.h | 2 +- sysdeps/unix/sysv/linux/sparc/kernel-features.h | 1 + sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list | 1 - sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 15 files changed, 26 insertions(+), 16 deletions(-) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index 4cfe19e..e9efb43 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -6,7 +6,6 @@ getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: bind - bind i:ipi __bind bind -connect - connect Ci:ipi __libc_connect __connect connect getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 1c4f61f..1c12be4 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -23,7 +23,6 @@ personality EXTRA personality Ei:i __personality personality # proper socket implementations: bind - bind i:ipi __bind bind -connect - connect Ci:ipi __libc_connect __connect connect getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt diff --git a/sysdeps/unix/sysv/linux/connect.c b/sysdeps/unix/sysv/linux/connect.c index 3837a5b..f6ab5df 100644 --- a/sysdeps/unix/sysv/linux/connect.c +++ b/sysdeps/unix/sysv/linux/connect.c @@ -15,14 +15,9 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include - #include #include -#include -#include int __libc_connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index b176a72..2874a1f 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -5,7 +5,6 @@ socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair bind - bind i:ipi __bind bind listen - listen i:ii __listen listen -connect - connect Ci:ipi __libc_connect __connect connect getsockname - getsockname i:ipp __getsockname getsockname getpeername - getpeername i:ipp __getpeername getpeername sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index ee814fb..288d096 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -2,7 +2,6 @@ # proper socket implementations: bind - bind i:ipi __bind bind -connect - connect Ci:ipi __libc_connect __connect connect getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index 07462f8..23ca794 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -31,7 +31,6 @@ # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 # define __ASSUME_BIND_SYSCALL 1 -# define __ASSUME_CONNECT_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 @@ -52,6 +51,7 @@ # undef __ASSUME_ACCEPT4_SYSCALL # undef __ASSUME_SENDMSG_SYSCALL # undef __ASSUME_RECVMSG_SYSCALL +# undef __ASSUME_CONNECT_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 96db4c3..32fdb08 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -6,7 +6,6 @@ getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: bind - bind i:ipi __bind bind -connect - connect Ci:ipi __libc_connect __connect connect getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 78b091b..e93f5f4 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -148,6 +148,7 @@ #define __ASSUME_SENDMSG_SYSCALL 1 #define __ASSUME_RECVMSG_SYSCALL 1 #define __ASSUME_ACCEPT_SYSCALL 1 +#define __ASSUME_CONNECT_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 f583ae7..a58c168 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -25,7 +25,6 @@ # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 # define __ASSUME_BIND_SYSCALL 1 -# define __ASSUME_CONNECT_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 @@ -49,6 +48,7 @@ # undef __ASSUME_SENDMMSG_SYSCALL # undef __ASSUME_SENDMSG_SYSCALL # undef __ASSUME_RECVMSG_SYSCALL +# undef __ASSUME_CONNECT_SYSCALL #endif /* No support for PI futexes or robust mutexes before 3.10 for m68k. */ diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index 81ea2a7..8b0c5a3 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -13,7 +13,6 @@ sysmips - sysmips i:iiii __sysmips sysmips # it's provided for compatibility, though. # bind - bind i:ipi __bind bind -connect - connect Ci:ipi __libc_connect __connect connect getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index ccfb0a2..50a7e8c 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -25,7 +25,6 @@ # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 # define __ASSUME_BIND_SYSCALL 1 -# define __ASSUME_CONNECT_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 @@ -48,6 +47,7 @@ # undef __ASSUME_SENDMMSG_SYSCALL # undef __ASSUME_SENDMSG_SYSCALL # undef __ASSUME_RECVMSG_SYSCALL +# undef __ASSUME_CONNECT_SYSCALL #endif /* s390 only supports ipc syscall. */ diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index 3ffa96e..ba6e4c4 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -40,6 +40,7 @@ #if !defined __arch64__ # undef __ASSUME_ACCEPT_SYSCALL +# undef __ASSUME_CONNECT_SYSCALL #endif /* sparc only supports ipc syscall. */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list index 27ca5fa..4c785fd 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list @@ -3,7 +3,6 @@ # Override select.S in parent directory: select - select C:5 __select select bind - bind 3 __bind bind -connect - connect C:3 __libc_connect __connect connect getpeername - getpeername 3 __getpeername getpeername getsockname - getsockname 3 __getsockname getsockname getsockopt - getsockopt 5 __getsockopt getsockopt diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index fe7d156..b832593 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -11,7 +11,6 @@ syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime # proper socket implementations: bind - bind i:ipi __bind bind -connect - connect Ci:ipi __libc_connect __connect connect getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt