From patchwork Mon Jan 30 14:02:05 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: 92865 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp1378112obz; Mon, 30 Jan 2017 06:03:27 -0800 (PST) X-Received: by 10.99.145.68 with SMTP id l65mr24164504pge.12.1485785007134; Mon, 30 Jan 2017 06:03:27 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z43si12660965plh.111.2017.01.30.06.03.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 06:03:27 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-77055-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-77055-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-77055-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=bKG0/wYz0lTMkv4m9bxeO9Mnm2D2zPq BaTS7QG3bs1mj5J7t8wJNIX4oNZuI/5rRSQuY+4GNhbkkn+gaRfEA73sXJMYYx38 KdkDJztlIGwxFnq1CPkqO3InCEya3oLmtOFRlES95AQ13GpzZ9P7pcHpGKICBehy zBT1bruUMm2I= 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=nJdvYcsgb6707zpztqxN8tF+Fys=; b=N2nvI SKrtEZdRaykM7627XwsRncm8d7Fesq02ngFdFU6tk/H2FRgwQPXjyrCG62T6cpX4 tuBB31l0fvX5Alcqe66x8ycXLI62lUd4gW11pL/GQWdG8IyVUSKSYB8pGRMBCSQW G+grS414lSmaVO/FyAEXEIGSQqqQa4jsWRRP/U= Received: (qmail 46870 invoked by alias); 30 Jan 2017 14:02:39 -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 46761 invoked by uid 89); 30 Jan 2017 14:02:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=IPC, shutdown, correspondent, 17, 8 X-HELO: mail-qk0-f174.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=L0GERfHczDSBWSFMC3+neN9xzfeTetS/U5ANdf6fr4o=; b=gOgNmSE1Q0SzCCxQGn1lXT4XXKZ4EOHyOxNIROO6irVjn2N3YWCJUJ4PLJnVejgyZw 568+zkcpkBsvROq35AOJIOzmuIRWKp0r/N9RybDp9xw/akeUXBxFASVKNE35YKvqoZ7v EFzMUzLAGGrwMp5v5fHSGzk/9HTimP1XriE+sq6ivVE2Gifq04FLt2erul0UXAIe+7cI dsp0xXP+qF4FbCf8nAQv0+IthFyvr9xHDo/nYLMdk4Gt6lBuUaYHlE8MgSByg3vyMalB 5pE3hshCxSa4tf9bbdmNaXyEtFATmcm97Mvy5fJ8nzCrVtpJfg85GLb0+Gbo0IG2OAoA 0sJw== X-Gm-Message-State: AIkVDXIvZN0XFjAZWtXRn9Bys3iep7D3BpL9eiSXbw6u+k0rucKxP8tM+z1AnmbmfSqyCqVE X-Received: by 10.55.163.201 with SMTP id m192mr15547799qke.303.1485784945067; Mon, 30 Jan 2017 06:02:25 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 3/4] Consolidate Linux recv and recvfrom implementation Date: Mon, 30 Jan 2017 12:02:05 -0200 Message-Id: <1485784926-2172-4-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 recv Linux syscall implementation on sysdeps/unix/sysv/linux/recv.c. The changes are: 1. Remove recv and recvfrom from auto-generation syscalls.list on the architecture that uses __NR_recv. 2. Define __NR_recv for such architectures. It was done instead of defining in default kernel-features.h because current Linux practice for new ports are to implement only __NR_recvfrom [1] and it will require adding new kernel-features for ports that do not require it (aarch64 for instance). 3. Define __NR_recvfrom as default (__ASSUME_RECVFROM_SYSCALL) and undef for architectures that do not support it. 4. Remove __ASSUME_RECVFROM_FOR_RECV_SYSCALL and decide to use __NR_recvfrom for recv generation based on __ASSUME_RECVFROM__SYSCALL. 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/kernel-features.h (__ASSUME_RECV_SYSCALL): Define. * sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_RECV_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/hppa/kernel-features.h (__ASSUME_RECV_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/ia64/kernel-features.h (__ASSUME_RECV_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/mips/kernel-features.h [_MIPS_SIM == _ABIO32] (__ASSUME_RECV_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/i386/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Define whether the kernel supports it. (__ASSUME_RECVFROM_FOR_RECV_SYSCALL): Undefine. * sysdeps/unix/sysv/linux/m68k/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Define whether the kernel supports it. (__ASSUME_RECVFROM_FOR_RECV_SYSCALL): Undefine. * sysdeps/unix/sysv/linux/s390/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Define whether the kernel supports it. (__ASSUME_RECVFROM_FOR_RECV_SYSCALL): Undefine. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Define as default. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Define. (__ASSUME_RECVFROM_FOR_RECV_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/powerpc/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Define. (__ASSUME_RECVFROM_FOR_RECV_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sh/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Define. (__ASSUME_RECVFROM_FOR_RECV_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sparc/kernel-features.h (__ASSUME_RECVFROM_SYSCALL): Define whether the kernel supports it. * sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove recv and recvfrom from uto-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: Likwise. * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/generic/recv.c: Remove file. * sysdeps/unix/sysv/linux/x86_64/recv.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/recv.c: Likewise. * sysdeps/unix/sysv/linux/recv.c (__ASSUME_RECVFROM_FOR_RECV_SYSCALL): Replace by __ASSUME_RECVFROM_SYSCALL. [1] include/asm-generic/unistd.h (__ARCH_WANT_SYSCALL_DEPRECATED) --- ChangeLog | 49 ++++++++++++++++++++++ sysdeps/unix/sysv/linux/alpha/kernel-features.h | 2 + sysdeps/unix/sysv/linux/alpha/syscalls.list | 2 - sysdeps/unix/sysv/linux/arm/kernel-features.h | 2 + sysdeps/unix/sysv/linux/arm/syscalls.list | 2 - sysdeps/unix/sysv/linux/generic/recv.c | 32 -------------- sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/kernel-features.h | 2 + sysdeps/unix/sysv/linux/hppa/syscalls.list | 2 - sysdeps/unix/sysv/linux/i386/kernel-features.h | 3 +- sysdeps/unix/sysv/linux/ia64/kernel-features.h | 2 + sysdeps/unix/sysv/linux/ia64/syscalls.list | 2 - sysdeps/unix/sysv/linux/kernel-features.h | 1 + sysdeps/unix/sysv/linux/m68k/kernel-features.h | 3 +- .../unix/sysv/linux/microblaze/kernel-features.h | 3 +- sysdeps/unix/sysv/linux/mips/kernel-features.h | 2 + sysdeps/unix/sysv/linux/mips/mips64/recv.c | 1 - sysdeps/unix/sysv/linux/mips/syscalls.list | 2 - sysdeps/unix/sysv/linux/powerpc/kernel-features.h | 1 - sysdeps/unix/sysv/linux/recv.c | 7 +--- sysdeps/unix/sysv/linux/recvfrom.c | 5 --- sysdeps/unix/sysv/linux/s390/kernel-features.h | 3 +- sysdeps/unix/sysv/linux/sh/kernel-features.h | 2 - sysdeps/unix/sysv/linux/sparc/kernel-features.h | 1 + .../unix/sysv/linux/sparc/sparc64/syscalls.list | 2 - sysdeps/unix/sysv/linux/x86_64/recv.c | 33 --------------- sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 27 files changed, 66 insertions(+), 102 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/generic/recv.c delete mode 100644 sysdeps/unix/sysv/linux/mips/mips64/recv.c delete mode 100644 sysdeps/unix/sysv/linux/x86_64/recv.c -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/sysdeps/unix/sysv/linux/alpha/kernel-features.h index 0614c78..3383a98 100644 --- a/sysdeps/unix/sysv/linux/alpha/kernel-features.h +++ b/sysdeps/unix/sysv/linux/alpha/kernel-features.h @@ -32,4 +32,6 @@ /* Alpha defines SysV ipc shmat syscall with a different name. */ #define __NR_shmat __NR_osf_shmat +#define __ASSUME_RECV_SYSCALL 1 + #endif /* _KERNEL_FEATURES_H */ diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index e9efb43..8a62b6e 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -10,8 +10,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 -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/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h index a3c0d9a..104c9f9 100644 --- a/sysdeps/unix/sysv/linux/arm/kernel-features.h +++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h @@ -37,3 +37,5 @@ /* ARM only has a syscall for fadvise64{_64} and it is defined with a non-standard name. */ #define __NR_fadvise64_64 __NR_arm_fadvise64_64 + +#define __ASSUME_RECV_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 1c12be4..9f445e6 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -27,8 +27,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 -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/recv.c b/sysdeps/unix/sysv/linux/generic/recv.c deleted file mode 100644 index c1aebd7..0000000 --- a/sysdeps/unix/sysv/linux/generic/recv.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf , 2011. - - 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 - . */ - -#include -#include -#include -#include - -ssize_t -__libc_recv (int sockfd, void *buffer, size_t len, int flags) -{ - return SYSCALL_CANCEL (recvfrom, sockfd, buffer, len, flags, - NULL, NULL); -} -strong_alias (__libc_recv, __recv) -libc_hidden_def (__recv) -weak_alias (__libc_recv, recv) 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/kernel-features.h b/sysdeps/unix/sysv/linux/hppa/kernel-features.h index 7ff5434..1fd7398 100644 --- a/sysdeps/unix/sysv/linux/hppa/kernel-features.h +++ b/sysdeps/unix/sysv/linux/hppa/kernel-features.h @@ -24,3 +24,5 @@ #endif #include_next + +#define __ASSUME_RECV_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index 288d096..1248877 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -6,8 +6,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 -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..a886442 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -38,8 +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 +50,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/kernel-features.h b/sysdeps/unix/sysv/linux/ia64/kernel-features.h index d13e403..80e41b6 100644 --- a/sysdeps/unix/sysv/linux/ia64/kernel-features.h +++ b/sysdeps/unix/sysv/linux/ia64/kernel-features.h @@ -28,4 +28,6 @@ # undef __ASSUME_ACCEPT4 #endif +#define __ASSUME_RECV_SYSCALL 1 + #endif /* _KERNEL_FEATURES_H */ diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index 32fdb08..24e9c98 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -10,8 +10,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 -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 a58c168..5e756ab 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -32,8 +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 @@ -49,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..8c59c89 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -28,9 +28,8 @@ #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_RECVFROM_SYSCALL 1 +#define __ASSUME_SENDTO_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/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h index 83a5c8f..276d12f 100644 --- a/sysdeps/unix/sysv/linux/mips/kernel-features.h +++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h @@ -34,6 +34,8 @@ # define __ASSUME_ALIGNED_REGISTER_PAIRS 1 /* mips32 only supports ipc syscall. */ # undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +/* mips32 support wire-up network syscalls. */ +# define __ASSUME_RECV_SYSCALL 1 #endif /* Define that mips64-n32 is a ILP32 ABI to set the correct interface to diff --git a/sysdeps/unix/sysv/linux/mips/mips64/recv.c b/sysdeps/unix/sysv/linux/mips/mips64/recv.c deleted file mode 100644 index b910525..0000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/recv.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index 8b0c5a3..48a33bb 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -17,8 +17,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 -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/recv.c b/sysdeps/unix/sysv/linux/recv.c index 6d62cf8..2467d99 100644 --- a/sysdeps/unix/sysv/linux/recv.c +++ b/sysdeps/unix/sysv/linux/recv.c @@ -15,21 +15,16 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include - #include #include -#include -#include ssize_t __libc_recv (int fd, void *buf, size_t len, int flags) { #ifdef __ASSUME_RECV_SYSCALL return SYSCALL_CANCEL (recv, fd, buf, len, flags); -#elif defined __ASSUME_RECVFROM_FOR_RECV_SYSCALL +#elif defined __ASSUME_RECVFROM_SYSCALL return SYSCALL_CANCEL (recvfrom, fd, buf, len, flags, NULL, NULL); #else return SOCKETCALL_CANCEL (recv, fd, buf, len, flags); 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..59bc434 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -32,8 +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 +46,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..61bdd45 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -33,8 +33,6 @@ #define __ASSUME_SOCKETPAIR_SYSCALL 1 #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..bf2cfdc 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list @@ -7,8 +7,6 @@ getpeername - getpeername 3 __getpeername getpeername 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/recv.c b/sysdeps/unix/sysv/linux/x86_64/recv.c deleted file mode 100644 index 10be5d5..0000000 --- a/sysdeps/unix/sysv/linux/x86_64/recv.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2001-2017 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 - . */ - -#include -#include -#include - -/* Read N bytes into BUF from socket FD. - Returns the number read or -1 for errors. */ - -ssize_t -__libc_recv (int fd, void *buf, size_t n, int flags) -{ - return SYSCALL_CANCEL (recvfrom, fd, buf, n, flags, NULL, NULL); -} - -weak_alias (__libc_recv, __recv) -libc_hidden_weak (__recv) -weak_alias (__recv, recv) 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