From patchwork Mon Jan 30 14:02:06 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: 721505 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 3vBrhj5YDLz9sCM for ; Tue, 31 Jan 2017 01:03:33 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="S+3wqwka"; 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=M5+ZYyxth7dzMlvX2oTM/RkRAmzfYLG EpcyCfarvfyOpQIKUWotqP/OTXn1WRB5ggn2h1lvLRHKx7NK6+iarMY4EXgxM9BJ xlLU9BFH7NNDo2NX+Z4oq6k4D0RYI3jIHNNYB26vo09JbXTYxWjwFCC0fSHzI7Fy cYE5PUYLbWVo= 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=guprpMTSVPc7OX7OuiYb/XVxLS4=; b=S+3wq wkaUGnKsQ9G/fSMvZzn7qvVUqtHNgh0sMF5vR0z/8qE4PRRzEpiozGY+j2z5fqBv KLtrfSiLrDTtWxO7CAfD2Etgm2npbXI9qKEF1IMiARDZ24mkEbyvJkXm2PDP9+bt ikyxbj1wOA2T0wq8eZxynB+nsTHzDl6hvtuRYE= Received: (qmail 46915 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 46766 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, existent X-HELO: mail-qk0-f179.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=XwSz6RrMcMDh8jwPyrsm1yd0pO0f3Y4kDCMqBdfUdTo=; b=s0sUGMFmkN3bQDD9HykhuL6fZ1WF0bBVtiODAPZeq6JAHe0TmmWmPdl0eSRPSvSnvU Qmn+Bs0sgCQMSsXnpUduaSMB2GEEIWJWWBl3jlAbg/zs6oH7qLMLWPAWE+m/PcblXje1 e1xb4lgvpw08BAmzAkHi3cf3lk5n9ujrSgtiIEmidkOpF/FCSy/7mP4GcLwb0UlUcu0h 3ThLg835guQ9W59hl7WFyIwTwyQEyGC32zx9bu2vbMSJxYcs7Yzvb/HZuyQ+0R0c6AeO 0QlXCKyFE05IS46qDExg/0pKGepreu6ziV9HTWwFD5JTzgSTF1vgFsFzjFQiLDgnPYA6 vkBQ== X-Gm-Message-State: AIkVDXLRZmDIF4adKyy+N/RULe5ySoc+VSciAkdX0drXtdXv068j8HV9qQEPH3rERzHyMbHL X-Received: by 10.55.192.196 with SMTP id v65mr21974050qkv.40.1485784946371; Mon, 30 Jan 2017 06:02:26 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 4/4] Consolidate Linux send and sendto implementation Date: Mon, 30 Jan 2017 12:02:06 -0200 Message-Id: <1485784926-2172-5-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 send Linux syscall implementation on sysdeps/unix/sysv/linux/send{to}.c. The changes are: 1. Remove send and sendto from auto-generation syscalls.list on the architecture that uses __NR_send. 2. Define __NR_send 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_sendto [1] and it will require adding new kernel-features for ports that do not require it (aarch64 for instance). 3. Define __NR_sendto as default (__ASSUME_SENDTO_SYSCALL) and undef for architectures that do not support it. 4. Remove __ASSUME_SENDTO_FOR_SEND_SYSCALL and decide to use __NR_sendto for send generation based on __ASSUME_SENDTO_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/generic/send.c: Remove file. * sysdeps/unix/sysv/linux/x86_64/send.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/send.c: Likewise. * sysdeps/unix/sysv/linux/alpha/kernel-features.h (__ASSUME_SEND_SYSCALL): Define. * sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_SEND_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/hppa/kernel-features.h (__ASSUME_SEND_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/ia64/kernel-features.h (__ASSUME_SEND_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h (__ASSUME_SEND_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/mips/kernel-features.h [_MIPS_SIM == _ABIO32] (__ASSUME_SEND_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sh/kernel-features.h (__ASSUME_SEND_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/i386/kernel-features.h (__ASSUME_SENDTO_FOR_SEND_SYSCALL): Remove. (__ASSUME_SENDTO_SYSCALL): Define wheter the kernel supports it. * sysdeps/unix/sysv/linux/m68k/kernel-features.h (__ASSUME_SENDTO_FOR_SEND_SYSCALL): Remove. (__ASSUME_SENDTO_SYSCALL): Define wheter the kernel supports it. * sysdeps/unix/sysv/linux/s390/kernel-features.h (__ASSUME_SENDTO_FOR_SEND_SYSCALL): Remove. (__ASSUME_SENDTO_SYSCALL): Define wheter the kernel supports it. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_SENDTO_SYSCALL): Define as default. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h (__ASSUME_SENDTO_FOR_SEND_SYSCALL): Define. (__ASSUME_SENDTO_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/powerpc/kernel-features.h (__ASSUME_SENDTO_SYSCALL): Remove defune. * sysdeps/unix/sysv/linux/send.c (__ASSUME_SENDTO_FOR_SEND_SYSCALL): Replace by __ASSUME_SENDTO_SYSCALL. * sysdeps/unix/sysv/linux/sh/kernel-features.h (__ASSUME_SEND_SYSCALL): Remove define. (__ASSUME_SENDTO_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sysdep.h (HAVE_INTERNAL_SEND_SYMBOl) * sysdeps/unix/sysv/linux/aarch64/sysdep.h (HAVE_INTERNAL_SEND_SYMBOl): Undefine. * sysdeps/unix/sysv/linux/nios2/sysdep.h (HAVE_INTERNAL_SEND_SYMBOl): Likewise. * sysdeps/unix/sysv/linux/tile/sysdep.h (HAVE_INTERNAL_SEND_SYMBOl): Likewise. * sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove send and 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. [1] include/asm-generic/unistd.h (__ARCH_WANT_SYSCALL_DEPRECATED) --- ChangeLog | 55 ++++++++++++++++++++++ sysdeps/unix/sysv/linux/aarch64/sysdep.h | 4 ++ sysdeps/unix/sysv/linux/alpha/kernel-features.h | 1 + sysdeps/unix/sysv/linux/alpha/syscalls.list | 2 - sysdeps/unix/sysv/linux/arm/kernel-features.h | 1 + sysdeps/unix/sysv/linux/arm/syscalls.list | 2 - sysdeps/unix/sysv/linux/generic/send.c | 30 ------------ sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/kernel-features.h | 1 + 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 | 1 + 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 +- sysdeps/unix/sysv/linux/mips/kernel-features.h | 1 + sysdeps/unix/sysv/linux/mips/mips64/send.c | 1 - sysdeps/unix/sysv/linux/mips/syscalls.list | 2 - sysdeps/unix/sysv/linux/nios2/sysdep.h | 4 ++ sysdeps/unix/sysv/linux/s390/kernel-features.h | 3 +- sysdeps/unix/sysv/linux/send.c | 9 ++-- sysdeps/unix/sysv/linux/sendto.c | 5 -- sysdeps/unix/sysv/linux/sh/kernel-features.h | 1 - .../unix/sysv/linux/sparc/sparc64/syscalls.list | 2 - sysdeps/unix/sysv/linux/sysdep.h | 4 ++ sysdeps/unix/sysv/linux/tile/sysdep.h | 4 ++ sysdeps/unix/sysv/linux/x86_64/send.c | 31 ------------ sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 28 files changed, 83 insertions(+), 94 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/generic/send.c delete mode 100644 sysdeps/unix/sysv/linux/mips/mips64/send.c delete mode 100644 sysdeps/unix/sysv/linux/x86_64/send.c diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h index ad49241..ea38588 100644 --- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -157,6 +157,10 @@ # define HAVE_CLOCK_GETTIME_VSYSCALL 1 # define HAVE_GETTIMEOFDAY_VSYSCALL 1 +/* Previously AArch64 used the generic version withouth the libc_hidden_def + which lead in a non existent __send symbol in libc.so. */ +# undef HAVE_INTERNAL_SEND_SYMBOl + /* Define a macro which expands into the inline wrapper code for a system call. */ # undef INLINE_SYSCALL diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/sysdeps/unix/sysv/linux/alpha/kernel-features.h index 3383a98..53f7611 100644 --- a/sysdeps/unix/sysv/linux/alpha/kernel-features.h +++ b/sysdeps/unix/sysv/linux/alpha/kernel-features.h @@ -33,5 +33,6 @@ #define __NR_shmat __NR_osf_shmat #define __ASSUME_RECV_SYSCALL 1 +#define __ASSUME_SEND_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 8a62b6e..aa21b10 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 -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/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h index 104c9f9..4923dfd 100644 --- a/sysdeps/unix/sysv/linux/arm/kernel-features.h +++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h @@ -39,3 +39,4 @@ #define __NR_fadvise64_64 __NR_arm_fadvise64_64 #define __ASSUME_RECV_SYSCALL 1 +#define __ASSUME_SEND_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 9f445e6..13441f7 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 -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/send.c b/sysdeps/unix/sysv/linux/generic/send.c deleted file mode 100644 index d0cb035..0000000 --- a/sysdeps/unix/sysv/linux/generic/send.c +++ /dev/null @@ -1,30 +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_send (int sockfd, const void *buffer, size_t len, int flags) -{ - return SYSCALL_CANCEL (sendto, sockfd, buffer, len, flags, NULL, 0); -} -strong_alias (__libc_send, __send) -weak_alias (__libc_send, send) 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/kernel-features.h b/sysdeps/unix/sysv/linux/hppa/kernel-features.h index 1fd7398..0e73a5c 100644 --- a/sysdeps/unix/sysv/linux/hppa/kernel-features.h +++ b/sysdeps/unix/sysv/linux/hppa/kernel-features.h @@ -26,3 +26,4 @@ #include_next #define __ASSUME_RECV_SYSCALL 1 +#define __ASSUME_SEND_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index 1248877..cd37573 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 -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..96a8e3b 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -36,8 +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 +49,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/kernel-features.h b/sysdeps/unix/sysv/linux/ia64/kernel-features.h index 80e41b6..ac9403e 100644 --- a/sysdeps/unix/sysv/linux/ia64/kernel-features.h +++ b/sysdeps/unix/sysv/linux/ia64/kernel-features.h @@ -29,5 +29,6 @@ #endif #define __ASSUME_RECV_SYSCALL 1 +#define __ASSUME_SEND_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 24e9c98..56f4138 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 -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 5e756ab..3bcd1c2 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -30,8 +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 @@ -48,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/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h index 276d12f..cf21681 100644 --- a/sysdeps/unix/sysv/linux/mips/kernel-features.h +++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h @@ -36,6 +36,7 @@ # undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS /* mips32 support wire-up network syscalls. */ # define __ASSUME_RECV_SYSCALL 1 +# define __ASSUME_SEND_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/send.c b/sysdeps/unix/sysv/linux/mips/mips64/send.c deleted file mode 100644 index d2c2996..0000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/send.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 48a33bb..f3621cd 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 -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/nios2/sysdep.h b/sysdeps/unix/sysv/linux/nios2/sysdep.h index b1c04cd..7b3efb2 100644 --- a/sysdeps/unix/sysv/linux/nios2/sysdep.h +++ b/sysdeps/unix/sysv/linux/nios2/sysdep.h @@ -140,6 +140,10 @@ /* In order to get __set_errno() definition in INLINE_SYSCALL. */ #include +/* Previously AArch64 used the generic version withouth the libc_hidden_def + which lead in a non existent __send symbol in libc.so. */ +# undef HAVE_INTERNAL_SEND_SYMBOl + /* Define a macro which expands into the inline wrapper code for a system call. */ #undef INLINE_SYSCALL diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index 59bc434..f44d429 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -30,8 +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 +45,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/send.c b/sysdeps/unix/sysv/linux/send.c index 4c02c8b..8a0ea67 100644 --- a/sysdeps/unix/sysv/linux/send.c +++ b/sysdeps/unix/sysv/linux/send.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_send (int fd, const void *buf, size_t len, int flags) { #ifdef __ASSUME_SEND_SYSCALL return SYSCALL_CANCEL (send, fd, buf, len, flags); -#elif defined __ASSUME_SENDTO_FOR_SEND_SYSCALL +#elif defined __ASSUME_SENDTO_SYSCALL return SYSCALL_CANCEL (sendto, fd, buf, len, flags, NULL, 0); #else return SOCKETCALL_CANCEL (send, fd, buf, len, flags); @@ -37,4 +32,6 @@ __libc_send (int fd, const void *buf, size_t len, int flags) } weak_alias (__libc_send, send) weak_alias (__libc_send, __send) +#ifdef HAVE_INTERNAL_SEND_SYMBOl libc_hidden_def (__send) +#endif 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 61bdd45..72ec394 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_SHUTDOWN_SYSCALL 1 #define __ASSUME_GETSOCKOPT_SYSCALL 1 #define __ASSUME_SETSOCKOPT_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list index bf2cfdc..1e85118 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 -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/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h index 02c957e..ed1c807 100644 --- a/sysdeps/unix/sysv/linux/sysdep.h +++ b/sysdeps/unix/sysv/linux/sysdep.h @@ -62,3 +62,7 @@ #define LO_HI_LONG(val) \ (long) (val), \ (long) (((uint64_t) (val)) >> 32) + +/* Exports the __send symbol on send.c linux implementation (some ABI have + it missing due the usage of a old generic version without it). */ +#define HAVE_INTERNAL_SEND_SYMBOl 1 diff --git a/sysdeps/unix/sysv/linux/tile/sysdep.h b/sysdeps/unix/sysv/linux/tile/sysdep.h index 70ff6b9..f8cfe66 100644 --- a/sysdeps/unix/sysv/linux/tile/sysdep.h +++ b/sysdeps/unix/sysv/linux/tile/sysdep.h @@ -218,6 +218,10 @@ #define HAVE_CLOCK_GETTIME_VSYSCALL 1 #define HAVE_GETTIMEOFDAY_VSYSCALL 1 +/* Previously tile used the generic version withouth the libc_hidden_def + which lead in a non existent __send symbol in libc.so. */ +# undef HAVE_INTERNAL_SEND_SYMBOl + #endif /* __ASSEMBLER__ */ /* Pointer mangling support. */ diff --git a/sysdeps/unix/sysv/linux/x86_64/send.c b/sysdeps/unix/sysv/linux/x86_64/send.c deleted file mode 100644 index c4af9cd..0000000 --- a/sysdeps/unix/sysv/linux/x86_64/send.c +++ /dev/null @@ -1,31 +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 - -/* Send N bytes of BUF to socket FD. Returns the number sent or -1. */ -ssize_t -__libc_send (int fd, const void *buf, size_t n, int flags) -{ - return SYSCALL_CANCEL (sendto, fd, buf, n, flags, NULL, (size_t) 0); -} - -weak_alias (__libc_send, __send) -libc_hidden_weak (__send) -weak_alias (__send, send) 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