From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 6D9A91F601 for ; Tue, 6 Dec 2022 16:19:26 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="WUWOUxpf"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9DCFF3875B50 for ; Tue, 6 Dec 2022 16:19:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DCFF3875B50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670343565; bh=JiK6H4p9NGzaM0fW0eemmm2DIddsugR8YIvJ3A/WvbQ=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=WUWOUxpfikT53+W+kNf/gjcVIbg2zgqtgu6FJ2t/dLHKC5/hZjfM0BuI0Huozk0Hb HfBHX2JZaNKhgwL+TzkTaVe01oOB/knhHIlO64CgvEVoQwj3zsQ+jchdSfkqzz3iEx FYWPH1tT09QXdQLzxRboE7ZOzpnwihGyx7WYCuF4= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C207438469BF for ; Tue, 6 Dec 2022 16:18:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C207438469BF Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-655-ebgd7F5dNt6mGBowGGVhUQ-1; Tue, 06 Dec 2022 11:18:25 -0500 X-MC-Unique: ebgd7F5dNt6mGBowGGVhUQ-1 Received: by mail-il1-f198.google.com with SMTP id o10-20020a056e02102a00b003006328df7bso14834039ilj.17 for ; Tue, 06 Dec 2022 08:18:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JiK6H4p9NGzaM0fW0eemmm2DIddsugR8YIvJ3A/WvbQ=; b=opRfp+c0Hi32+COm8KED7lYp2DTYVwYH6oA5C6tkh0MyE2L8K/Fyk3U9Ui7qg+kpmQ JhJJ5rS/W1d+Ulxs84dLyhG/SFOAmSOi7XZ9dsacVEqSFEDwLrj7trq2KDyl9G4ERr0h xzGqQ3H3kxAuAhrNpeKadO1fDvrj281y5vehDqKhih1QNc0gO8bIFbpdvcGS6UyDXMUP s57loKY1xOVAL5xCE5RavFkYDymW8mGOJKqOB8L1rAGHZxFiyXPfPjIMdRX9cfV5nJJk 2i2OD189IyPg2C/PBjlIgtwtNQMO7WpRv1LlY2dWMJukbBn0hnEjb91/STNlBg6mhfRN uxew== X-Gm-Message-State: ANoB5pkn27l6L21K29zHsPlZE0oaHyTy8WEoyvO1qacqVh2tXKh83nWN S7Z0SLmEQ+ouAbmfSKTcxhsZqfGgvSK0rI0C0k5ro9UMLtZRvxEMeq0XQShOuBJHZkq/GupT/WC MpRBKrqKn9Ctylh2FqOqC X-Received: by 2002:a02:23ca:0:b0:372:59cb:f242 with SMTP id u193-20020a0223ca000000b0037259cbf242mr41363283jau.135.1670343504539; Tue, 06 Dec 2022 08:18:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ltYBq+lQ3BugNXkdZBiSpBfAmn/e4oDvaF1a02jD28R/RLJ8l1p/3K2m3vTkv5Rwqjj+25w== X-Received: by 2002:a02:23ca:0:b0:372:59cb:f242 with SMTP id u193-20020a0223ca000000b0037259cbf242mr41363270jau.135.1670343504161; Tue, 06 Dec 2022 08:18:24 -0800 (PST) Received: from [192.168.0.241] (192-0-145-146.cpe.teksavvy.com. [192.0.145.146]) by smtp.gmail.com with ESMTPSA id g5-20020a022705000000b00375ac4c5c02sm6741799jaa.76.2022.12.06.08.18.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Dec 2022 08:18:23 -0800 (PST) Message-ID: <3e80dd40-27ce-5dcb-254d-ceaa2509ede2@redhat.com> Date: Tue, 6 Dec 2022 11:18:22 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH 22/30] Linux: Assume and consolidate getsockname wire-up syscall To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> <20221019221433.1082017-23-adhemerval.zanella@linaro.org> Organization: Red Hat In-Reply-To: <20221019221433.1082017-23-adhemerval.zanella@linaro.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Carlos O'Donell via Libc-alpha Reply-To: Carlos O'Donell Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 10/19/22 18:14, Adhemerval Zanella via Libc-alpha wrote: > And disable if kernel does not support it. > > Checked on x86_64-linux-gnu and i686-linux-gnu. LGTM. No regressions on x86_64 and i686. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell > --- > sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - > sysdeps/unix/sysv/linux/getsockname.c | 7 +------ > sysdeps/unix/sysv/linux/i386/kernel-features.h | 2 +- > sysdeps/unix/sysv/linux/kernel-features.h | 1 + > sysdeps/unix/sysv/linux/m68k/kernel-features.h | 2 +- > sysdeps/unix/sysv/linux/microblaze/kernel-features.h | 1 - > sysdeps/unix/sysv/linux/powerpc/kernel-features.h | 1 - > sysdeps/unix/sysv/linux/s390/kernel-features.h | 2 +- > sysdeps/unix/sysv/linux/sh/kernel-features.h | 1 - > 9 files changed, 5 insertions(+), 13 deletions(-) > > diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list > index 706893f245..a5bb00a3e4 100644 > --- a/sysdeps/unix/sysv/linux/generic/syscalls.list > +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list > @@ -1,6 +1,5 @@ > # File name Caller Syscall name # args Strong name Weak names > > # Socket APIs > -getsockname - getsockname i:ipp __getsockname getsockname OK. Remove wrapper. > getpeername - getpeername i:ipp __getpeername getpeername > shutdown - shutdown i:ii __shutdown shutdown > diff --git a/sysdeps/unix/sysv/linux/getsockname.c b/sysdeps/unix/sysv/linux/getsockname.c > index d0718c2aaf..8350b800fe 100644 > --- a/sysdeps/unix/sysv/linux/getsockname.c > +++ b/sysdeps/unix/sysv/linux/getsockname.c > @@ -15,19 +15,14 @@ > License along with the GNU C Library; if not, see > . */ > > -#include > -#include > #include > - > #include > -#include > -#include > > int > __getsockname (int fd, __SOCKADDR_ARG addr, socklen_t *len) > { > #ifdef __ASSUME_GETSOCKNAME_SYSCALL > - return INLINE_SYSCALL (getsockname, 3, fd, addr.__sockaddr__, len); > + return INLINE_SYSCALL_CALL (getsockname, fd, addr.__sockaddr__, len); OK. > #else > return SOCKETCALL (getsockname, fd, addr.__sockaddr__, len); > #endif > diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h > index a79ec679cc..f294380215 100644 > --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h > @@ -19,7 +19,6 @@ > > /* Direct socketcalls available with kernel 4.3. */ > #if __LINUX_KERNEL_VERSION >= 0x040300 > -# define __ASSUME_GETSOCKNAME_SYSCALL 1 > # define __ASSUME_GETPEERNAME_SYSCALL 1 > # define __ASSUME_SHUTDOWN_SYSCALL 1 > #endif > @@ -41,6 +40,7 @@ > # undef __ASSUME_SOCKET_SYSCALL > # undef __ASSUME_SOCKETPAIR_SYSCALL > # undef __ASSUME_LISTEN_SYSCALL > +# undef __ASSUME_GETSOCKNAME_SYSCALL > #endif > > /* i686 only supports ipc syscall before 5.1. */ > diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h > index d1769b2d99..6fb99f5c35 100644 > --- a/sysdeps/unix/sysv/linux/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/kernel-features.h > @@ -83,6 +83,7 @@ > #define __ASSUME_SOCKET_SYSCALL 1 > #define __ASSUME_SOCKETPAIR_SYSCALL 1 > #define __ASSUME_LISTEN_SYSCALL 1 > +#define __ASSUME_GETSOCKNAME_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 a65fa63c5e..898c24ba62 100644 > --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h > @@ -19,7 +19,6 @@ > > /* Direct socketcalls available with kernel 4.3. */ > #if __LINUX_KERNEL_VERSION >= 0x040300 > -# define __ASSUME_GETSOCKNAME_SYSCALL 1 > # define __ASSUME_GETPEERNAME_SYSCALL 1 > # define __ASSUME_SHUTDOWN_SYSCALL 1 > #endif > @@ -43,6 +42,7 @@ > # undef __ASSUME_SOCKET_SYSCALL > # undef __ASSUME_SOCKETPAIR_SYSCALL > # undef __ASSUME_LISTEN_SYSCALL > +# undef __ASSUME_GETSOCKNAME_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 e19e6bb6ba..7e2b15859e 100644 > --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h > @@ -19,7 +19,6 @@ > > /* All supported kernel versions for MicroBlaze have these syscalls. */ > #define __ASSUME_CONNECT_SYSCALL 1 > -#define __ASSUME_GETSOCKNAME_SYSCALL 1 > #define __ASSUME_GETPEERNAME_SYSCALL 1 > #define __ASSUME_SEND_SYSCALL 1 > #define __ASSUME_RECV_SYSCALL 1 > diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h > index eb73a91a5d..8953cb019f 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h > @@ -19,7 +19,6 @@ > > /* New syscalls added for PowerPC in 2.6.37. */ > #define __ASSUME_CONNECT_SYSCALL 1 > -#define __ASSUME_GETSOCKNAME_SYSCALL 1 > #define __ASSUME_GETPEERNAME_SYSCALL 1 > #define __ASSUME_SEND_SYSCALL 1 > #define __ASSUME_RECV_SYSCALL 1 > diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h > index 3daee3f132..1422ee620c 100644 > --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h > @@ -19,7 +19,6 @@ > > /* Direct socketcalls available with kernel 4.3. */ > #if __LINUX_KERNEL_VERSION >= 0x040300 > -# define __ASSUME_GETSOCKNAME_SYSCALL 1 > # define __ASSUME_GETPEERNAME_SYSCALL 1 > # define __ASSUME_SHUTDOWN_SYSCALL 1 > #endif > @@ -43,6 +42,7 @@ > # undef __ASSUME_SOCKET_SYSCALL > # undef __ASSUME_SOCKETPAIR_SYSCALL > # undef __ASSUME_LISTEN_SYSCALL > +# undef __ASSUME_GETSOCKNAME_SYSCALL > #endif > > /* s390 only supports ipc syscall before 5.1. */ > diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h > index 23eadf84e0..91dc28f33f 100644 > --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h > @@ -24,7 +24,6 @@ > > /* These syscalls were added for SH in 2.6.37. */ > #define __ASSUME_CONNECT_SYSCALL 1 > -#define __ASSUME_GETSOCKNAME_SYSCALL 1 > #define __ASSUME_GETPEERNAME_SYSCALL 1 > #define __ASSUME_SEND_SYSCALL 1 > #define __ASSUME_RECV_SYSCALL 1 -- Cheers, Carlos.