From patchwork Tue Mar 7 10:51:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 736118 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vctmN52vCz9rxw for ; Tue, 7 Mar 2017 21:53:08 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="RmYTpQPz"; dkim-atps=neutral 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=jQl0v+Hw0jG0TU+d3eTFTUw1agF8QOR h36Y3bzHeTNC6KcZh0qWN8Ekm/VJmo3iIOqVLscrwzbHEIkNvXfpn7Wwd0sU1mzk v0Mk4gkBzfMadSqZhiRda0DmjjpAKo9sgGgwBWD5wlOXH3FWRnwEwDUeN62aI4sr q8ScyQuFKSV8= 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=JIriPPLxRVko2dymkffjmnbGLXY=; b=RmYTp QPzOkljlJBn7uT7G2duU2ZKj4SfxACfCrt5A2Yi8ka08QzDz5cuJAG1GgzLKY14w iBN8nxAX77r45NDpAZsGAQYujeGTBFItniCGHifgPDPVmBoa/Qk1GSxsnPTH+zhl HX/z/hoS4kSltzSIWDNJYybH4zGhtOWRAe/Bck= Received: (qmail 85811 invoked by alias); 7 Mar 2017 10:52:09 -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 85693 invoked by uid 89); 7 Mar 2017 10:52:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=correspondent, wired, ipp X-HELO: mail-wm0-f42.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=urtv4bwWhzlKjy+el2mtxBg8E5j7qr3ll6WibOi/Df0=; b=SiyEfCDr92Go28UBuBpl/Odn74cTHT8sFiekqECfgdZ0MxBhZQEwJBbVwwZVxjIfDX NICko+OPwyANSsWnZBH4ZX2WWqmgDAk3ZodZq8PLMBdB+Rkyt9Jkt/m0/adOFVqIMRGP pr77kc3eFtHhZiOO+g5Txno0SZGZENpOGtfcVZ91hsBrluN70u9wyH7jHx1uNAjFAWrT Ru2DLjjlX5S1DFYtnDLNjvAVYPHu6MMJkG/BqTpcoHth/ElYCNY0s7yDwkQ4g46kFBsq 8nHfGlURQ3R2zs/X8a/HDH0wWU8ud8axj4TgQDKfaHQK6JFzCg9tyB8TiKt1hWmzp9Xp EH8w== X-Gm-Message-State: AMke39nZbGGmq/dodA1kHuPGAUNIe6rkAZZXXrTjjKcB0KV0PkiCcJmrhOIvN5AJuGIKgXIK X-Received: by 10.28.155.9 with SMTP id d9mr17041107wme.114.1488883922275; Tue, 07 Mar 2017 02:52:02 -0800 (PST) From: Adhemerval Zanella X-Google-Original-From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 3/6] Consolidate Linux recvfrom implementation Date: Tue, 7 Mar 2017 11:51:52 +0100 Message-Id: <1488883915-29716-4-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 recvfrom Linux syscall implementation on sysdeps/unix/sysv/linux/recvfrom.c. The changes are: 1. Define __ASSUME_RECVFROM_SYSCALL by default 2. Undef it for architectures that do not support __NR_recvfrom. 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 recvfrom 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/sparc/sparc64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/i386/kernel-features.h * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Define by default. (__ASSUME_RECVFROM_SYSCALL): Undef it if kernel does not support __NR_recvfrom. * sysdeps/unix/sysv/linux/m68k/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/s390/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Remove definition. * sysdeps/unix/sysv/linux/powerpc/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sh/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sparc/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/recvfrom.c: Simplify includes. --- ChangeLog | 28 ++++++++++++++++++++++ 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/recvfrom.c | 5 ---- sysdeps/unix/sysv/linux/s390/kernel-features.h | 2 +- sysdeps/unix/sysv/linux/sh/kernel-features.h | 1 - sysdeps/unix/sysv/linux/sparc/kernel-features.h | 1 + .../unix/sysv/linux/sparc/sparc64/syscalls.list | 1 - sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 18 files changed, 33 insertions(+), 19 deletions(-) diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index e9efb43..9cb44c1 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 recv - recv Ci:ibni __libc_recv __recv recv -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom send - send Ci:ibni __libc_send __send send sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto setsockopt - setsockopt i:iiibn __setsockopt setsockopt diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 1c12be4..dc4f52a 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 recv - recv Ci:ibni __libc_recv __recv recv -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom send - send Ci:ibni __libc_send __send send sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto setsockopt - setsockopt i:iiibn __setsockopt setsockopt diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index 2874a1f..c16ee52 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -8,7 +8,6 @@ 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 -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom 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 288d096..8834115 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 recv - recv Ci:ibni __libc_recv __recv recv -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom send - send Ci:ibni __libc_send __send send sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto setsockopt - setsockopt i:iiibn __setsockopt setsockopt diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index 23ca794..4ccab5d 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -38,7 +38,6 @@ # define __ASSUME_GETPEERNAME_SYSCALL 1 # define __ASSUME_SENDTO_SYSCALL 1 # define __ASSUME_SENDTO_FOR_SEND_SYSCALL 1 -# define __ASSUME_RECVFROM_SYSCALL 1 # define __ASSUME_RECVFROM_FOR_RECV_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -52,6 +51,7 @@ # undef __ASSUME_SENDMSG_SYSCALL # undef __ASSUME_RECVMSG_SYSCALL # undef __ASSUME_CONNECT_SYSCALL +# undef __ASSUME_RECVFROM_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 32fdb08..57020a9 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 recv - recv Ci:ibni __libc_recv __recv recv -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom send - send Ci:ibni __libc_send __send send sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto setsockopt - setsockopt i:iiibn __setsockopt setsockopt diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index e93f5f4..c6c816e 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -149,6 +149,7 @@ #define __ASSUME_RECVMSG_SYSCALL 1 #define __ASSUME_ACCEPT_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 +#define __ASSUME_RECVFROM_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 e19ccf7..fa874b3 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -32,7 +32,6 @@ # define __ASSUME_GETPEERNAME_SYSCALL 1 # define __ASSUME_SENDTO_SYSCALL 1 # define __ASSUME_SENDTO_FOR_SEND_SYSCALL 1 -# define __ASSUME_RECVFROM_SYSCALL 1 # define __ASSUME_RECVFROM_FOR_RECV_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -48,6 +47,7 @@ # undef __ASSUME_SENDMSG_SYSCALL # undef __ASSUME_RECVMSG_SYSCALL # undef __ASSUME_CONNECT_SYSCALL +# undef __ASSUME_RECVFROM_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 9532d57..e4bf4d5 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -30,7 +30,6 @@ #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_SENDTO_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 -#define __ASSUME_RECVFROM_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 #define __ASSUME_GETSOCKOPT_SYSCALL 1 #define __ASSUME_SETSOCKOPT_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index 8b0c5a3..053574e 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 recv - recv Ci:ibni __libc_recv __recv recv -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom send - send Ci:ibni __libc_send __send send sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto setsockopt - setsockopt i:iiibn __setsockopt setsockopt diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index 272800c..a0d2e8f 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -31,7 +31,6 @@ #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_SENDTO_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 -#define __ASSUME_RECVFROM_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 #define __ASSUME_GETSOCKOPT_SYSCALL 1 #define __ASSUME_SETSOCKOPT_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/recvfrom.c b/sysdeps/unix/sysv/linux/recvfrom.c index 10ffb26..27c2360 100644 --- a/sysdeps/unix/sysv/linux/recvfrom.c +++ b/sysdeps/unix/sysv/linux/recvfrom.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_recvfrom (int fd, void *buf, size_t len, int flags, diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index 50a7e8c..29738af 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -32,7 +32,6 @@ # define __ASSUME_GETPEERNAME_SYSCALL 1 # define __ASSUME_SENDTO_SYSCALL 1 # define __ASSUME_SENDTO_FOR_SEND_SYSCALL 1 -# define __ASSUME_RECVFROM_SYSCALL 1 # define __ASSUME_RECVFROM_FOR_RECV_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -48,6 +47,7 @@ # undef __ASSUME_SENDMSG_SYSCALL # undef __ASSUME_RECVMSG_SYSCALL # undef __ASSUME_CONNECT_SYSCALL +# undef __ASSUME_RECVFROM_SYSCALL #endif /* s390 only supports ipc syscall. */ diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h index 7a83211..5ed5f93 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -34,7 +34,6 @@ #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_SENDTO_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 -#define __ASSUME_RECVFROM_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 #define __ASSUME_GETSOCKOPT_SYSCALL 1 #define __ASSUME_SETSOCKOPT_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index ba6e4c4..8e74478 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -41,6 +41,7 @@ #if !defined __arch64__ # undef __ASSUME_ACCEPT_SYSCALL # undef __ASSUME_CONNECT_SYSCALL +# undef __ASSUME_RECVFROM_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 4c785fd..f73b519 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 recv - recv C:4 __libc_recv __recv recv -recvfrom - recvfrom C:6 __libc_recvfrom __recvfrom recvfrom send - send C:4 __libc_send __send send sendto - sendto C:6 __libc_sendto __sendto sendto setsockopt - setsockopt 5 __setsockopt setsockopt diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index b832593..7ff0376 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 -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown