From patchwork Wed Oct 19 22:14:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59090 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 170A5385701F for ; Wed, 19 Oct 2022 22:15:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 170A5385701F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217722; bh=wKclHjp8YfPEs7lGAqmce+oaAAW3aRn1Qeo5se4klMc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=jPdB1DMg/gakZNJzQkrGSWNFd/H3AJ70zNVbdoYwY0xKIsXWV0n5jRmR7PlLlDA5Z xh/+F1RUPPf87sjpDLRnMxAy7DiIUb7bb0H2yDBP7sVo26prm8B8Ic+d9ZDaYBOSrT r1zoPh8IF2/pPnEWzKzrp7VaSdeojHnC2WMBq83Q= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 9B5973858C56 for ; Wed, 19 Oct 2022 22:14:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9B5973858C56 Received: by mail-oi1-x231.google.com with SMTP id u15so20878793oie.2 for ; Wed, 19 Oct 2022 15:14:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wKclHjp8YfPEs7lGAqmce+oaAAW3aRn1Qeo5se4klMc=; b=SQ/o3eIIThAbsuk1uDz62BZN4Vm23IjzumijdV83rkbDcyz4Drcn6acChc1O1VE2Vi okGGN1+m4FUHEyMySVS9HjR+eeYQKH5K5X03xCPHovQKgCJ2LCt1vRgvOIP2gPBHExRT qs2+ZJfnlxYocwSI7xEEEVU9bMKqBSrpPZdcWT/dRHzR0QYrQqWkJQ46U3tAtacOF0FE PLwbaucNXSyX14KwdhUcxAUNhgNnHyLhCEpOI3W2PUFENROAOblCGBk0w9lV9rjs3U5S BhWb5EmLK/4vNHDEWUKMTEcn7pD0JVa9Ow6HZvvMm6dd5tP5ctsvwVbBJEf8ItG7YSFU P62A== X-Gm-Message-State: ACrzQf1JLoqnOoRodXQJ6ptdkILhjueDHP9eadTXaZIzccoiqwFr+4qF Cwtx8nAzuFTgcutr6tVF+edCcbGtgab19IlL X-Google-Smtp-Source: AMsMyM6tyTH8ltV9JqfAewVaFgkitjXf0b009MCHlGQ8c5eSYNoEj8VaHXlomWzezd4Fh/CY3sgS8Q== X-Received: by 2002:aca:1e15:0:b0:353:f508:f9e0 with SMTP id m21-20020aca1e15000000b00353f508f9e0mr20148977oic.290.1666217678965; Wed, 19 Oct 2022 15:14:38 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:38 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 01/30] linux: Fix generic struct_stat for 64 bit time (BZ# 29657) Date: Wed, 19 Oct 2022 19:14:04 -0300 Message-Id: <20221019221433.1082017-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The generic Linux struct_stat misses the conditionals to use bits/struct_stat_time64_helper.h in the __USE_TIME_BITS64 for architecture that uses __TIMESIZE == 32 (currently csky and nios2). Since newer ports should not support 32 bit time_t, the generic implementation should be used as default. For arm, hppa, and sh a copy of default struct_stat is added, while for cky and nios a new one based on generic is used, along with conditionals to use bits/struct_stat_time64_helper.h. The default struct_stat is also replaced with the generic one. Checked on aarch64-linux-gnu and arm-linux-gnueabihf. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- .../unix/sysv/linux/arm/bits/struct_stat.h | 139 ++++++++++++++++++ sysdeps/unix/sysv/linux/bits/struct_stat.h | 116 +++++++-------- .../{generic => csky}/bits/struct_stat.h | 28 ++-- .../unix/sysv/linux/hppa/bits/struct_stat.h | 139 ++++++++++++++++++ .../unix/sysv/linux/nios2/bits/struct_stat.h | 135 +++++++++++++++++ sysdeps/unix/sysv/linux/sh/bits/struct_stat.h | 139 ++++++++++++++++++ 6 files changed, 622 insertions(+), 74 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/arm/bits/struct_stat.h rename sysdeps/unix/sysv/linux/{generic => csky}/bits/struct_stat.h (92%) create mode 100644 sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h create mode 100644 sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h create mode 100644 sysdeps/unix/sysv/linux/sh/bits/struct_stat.h diff --git a/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h b/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h new file mode 100644 index 0000000000..30ee6279d2 --- /dev/null +++ b/sysdeps/unix/sysv/linux/arm/bits/struct_stat.h @@ -0,0 +1,139 @@ +/* Definition for struct stat. Linux/arm version. + Copyright (C) 2020-2022 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 + . */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_STRUCT_STAT_H +#define _BITS_STRUCT_STAT_H 1 + +#include +#include + +struct stat + { +#ifdef __USE_TIME_BITS64 +# include +#else + __dev_t st_dev; /* Device. */ + unsigned short int __pad1; +# ifndef __USE_FILE_OFFSET64 + __ino_t st_ino; /* File serial number. */ +# else + __ino_t __st_ino; /* 32bit file serial number. */ +# endif + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + unsigned short int __pad2; +# ifndef __USE_FILE_OFFSET64 + __off_t st_size; /* Size of file, in bytes. */ +# else + __off64_t st_size; /* Size of file, in bytes. */ +# endif + __blksize_t st_blksize; /* Optimal block size for I/O. */ + +# ifndef __USE_FILE_OFFSET64 + __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ +# else + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +# endif +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif +# ifndef __USE_FILE_OFFSET64 + unsigned long int __glibc_reserved4; + unsigned long int __glibc_reserved5; +# else + __ino64_t st_ino; /* File serial number. */ +# endif +#endif /* __USE_TIME_BITS64 */ + }; + +#ifdef __USE_LARGEFILE64 +struct stat64 + { +# ifdef __USE_TIME_BITS64 +# include +# else + __dev_t st_dev; /* Device. */ + unsigned int __pad1; + + __ino_t __st_ino; /* 32bit file serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + unsigned int __pad2; + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif + __ino64_t st_ino; /* File serial number. */ +# endif /* __USE_TIME_BITS64 */ + }; +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC + + +#endif /* _BITS_STRUCT_STAT_H */ diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat.h b/sysdeps/unix/sysv/linux/bits/struct_stat.h index 25bd6cb638..fb11a3fba4 100644 --- a/sysdeps/unix/sysv/linux/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/bits/struct_stat.h @@ -26,37 +26,36 @@ #include #include -struct stat - { -#ifdef __USE_TIME_BITS64 -# include -#else - __dev_t st_dev; /* Device. */ - unsigned short int __pad1; -# ifndef __USE_FILE_OFFSET64 - __ino_t st_ino; /* File serial number. */ -# else - __ino_t __st_ino; /* 32bit file serial number. */ +#if defined __USE_FILE_OFFSET64 +# define __field64(type, type64, name) type64 name +#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T +# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T +# error "ino_t and off_t must both be the same type" # endif - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - unsigned short int __pad2; -# ifndef __USE_FILE_OFFSET64 - __off_t st_size; /* Size of file, in bytes. */ -# else - __off64_t st_size; /* Size of file, in bytes. */ -# endif - __blksize_t st_blksize; /* Optimal block size for I/O. */ +# define __field64(type, type64, name) type name +#elif __BYTE_ORDER == __LITTLE_ENDIAN +# define __field64(type, type64, name) \ + type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad +#else +# define __field64(type, type64, name) \ + int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name +#endif -# ifndef __USE_FILE_OFFSET64 - __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -# else - __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# endif -# ifdef __USE_XOPEN2K8 +struct stat + { + __dev_t st_dev; /* Device. */ + __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */ +#ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -66,47 +65,38 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif -# ifndef __USE_FILE_OFFSET64 - unsigned long int __glibc_reserved4; - unsigned long int __glibc_reserved5; -# else - __ino64_t st_ino; /* File serial number. */ -# endif -#endif /* __USE_TIME_BITS64 */ +#endif + int __glibc_reserved[2]; }; +#undef __field64 + #ifdef __USE_LARGEFILE64 struct stat64 { -# ifdef __USE_TIME_BITS64 -# include -# else - __dev_t st_dev; /* Device. */ - unsigned int __pad1; - - __ino_t __st_ino; /* 32bit file serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - unsigned int __pad2; - __off64_t st_size; /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - - __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# ifdef __USE_XOPEN2K8 + __dev_t st_dev; /* Device. */ + __ino64_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ +#ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -116,16 +106,15 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# else +#else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif - __ino64_t st_ino; /* File serial number. */ -# endif /* __USE_TIME_BITS64 */ +#endif + int __glibc_reserved[2]; }; #endif @@ -135,5 +124,4 @@ struct stat64 /* Nanosecond resolution time values are supported. */ #define _STATBUF_ST_NSEC - #endif /* _BITS_STRUCT_STAT_H */ diff --git a/sysdeps/unix/sysv/linux/generic/bits/struct_stat.h b/sysdeps/unix/sysv/linux/csky/bits/struct_stat.h similarity index 92% rename from sysdeps/unix/sysv/linux/generic/bits/struct_stat.h rename to sysdeps/unix/sysv/linux/csky/bits/struct_stat.h index fb11a3fba4..f0ee455748 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/csky/bits/struct_stat.h @@ -1,4 +1,4 @@ -/* Definition for struct stat. +/* Definition for struct stat. Linux/csky version. Copyright (C) 2020-2022 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -43,6 +43,9 @@ struct stat { +#ifdef __USE_TIME_BITS64 +# include +#else __dev_t st_dev; /* Device. */ __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */ __mode_t st_mode; /* File mode. */ @@ -55,7 +58,7 @@ struct stat __blksize_t st_blksize; /* Optimal block size for I/O. */ int __pad2; __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */ -#ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -65,18 +68,19 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif int __glibc_reserved[2]; +#endif }; #undef __field64 @@ -84,6 +88,9 @@ struct stat #ifdef __USE_LARGEFILE64 struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else __dev_t st_dev; /* Device. */ __ino64_t st_ino; /* File serial number. */ __mode_t st_mode; /* File mode. */ @@ -96,7 +103,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ int __pad2; __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ -#ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -106,15 +113,16 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -#else +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif int __glibc_reserved[2]; +# endif }; #endif diff --git a/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h b/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h new file mode 100644 index 0000000000..38b6e13e68 --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/bits/struct_stat.h @@ -0,0 +1,139 @@ +/* Definition for struct stat. Linux/hppa version. + Copyright (C) 2020-2022 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 + . */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_STRUCT_STAT_H +#define _BITS_STRUCT_STAT_H 1 + +#include +#include + +struct stat + { +#ifdef __USE_TIME_BITS64 +# include +#else + __dev_t st_dev; /* Device. */ + unsigned short int __pad1; +# ifndef __USE_FILE_OFFSET64 + __ino_t st_ino; /* File serial number. */ +# else + __ino_t __st_ino; /* 32bit file serial number. */ +# endif + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + unsigned short int __pad2; +# ifndef __USE_FILE_OFFSET64 + __off_t st_size; /* Size of file, in bytes. */ +# else + __off64_t st_size; /* Size of file, in bytes. */ +# endif + __blksize_t st_blksize; /* Optimal block size for I/O. */ + +# ifndef __USE_FILE_OFFSET64 + __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ +# else + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +# endif +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif +# ifndef __USE_FILE_OFFSET64 + unsigned long int __glibc_reserved4; + unsigned long int __glibc_reserved5; +# else + __ino64_t st_ino; /* File serial number. */ +# endif +#endif /* __USE_TIME_BITS64 */ + }; + +#ifdef __USE_LARGEFILE64 +struct stat64 + { +# ifdef __USE_TIME_BITS64 +# include +# else + __dev_t st_dev; /* Device. */ + unsigned int __pad1; + + __ino_t __st_ino; /* 32bit file serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + unsigned int __pad2; + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif + __ino64_t st_ino; /* File serial number. */ +# endif /* __USE_TIME_BITS64 */ + }; +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC + + +#endif /* _BITS_STRUCT_STAT_H */ diff --git a/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h new file mode 100644 index 0000000000..e00e71173e --- /dev/null +++ b/sysdeps/unix/sysv/linux/nios2/bits/struct_stat.h @@ -0,0 +1,135 @@ +/* Definition for struct stat. Linux/nios2 version. + Copyright (C) 2020-2022 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 + . */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_STRUCT_STAT_H +#define _BITS_STRUCT_STAT_H 1 + +#include +#include + +#if defined __USE_FILE_OFFSET64 +# define __field64(type, type64, name) type64 name +#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T +# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T +# error "ino_t and off_t must both be the same type" +# endif +# define __field64(type, type64, name) type name +#elif __BYTE_ORDER == __LITTLE_ENDIAN +# define __field64(type, type64, name) \ + type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad +#else +# define __field64(type, type64, name) \ + int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name +#endif + +struct stat + { +#ifdef __USE_TIME_BITS64 +# include +#else + __dev_t st_dev; /* Device. */ + __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */ +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif + int __glibc_reserved[2]; +#endif + }; + +#undef __field64 + +#ifdef __USE_LARGEFILE64 +struct stat64 + { +# ifdef __USE_TIME_BITS64 +# include +# else + __dev_t st_dev; /* Device. */ + __ino64_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif + int __glibc_reserved[2]; +# endif + }; +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC + +#endif /* _BITS_STRUCT_STAT_H */ diff --git a/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h new file mode 100644 index 0000000000..0f7c9cdc89 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sh/bits/struct_stat.h @@ -0,0 +1,139 @@ +/* Definition for struct stat. Linux/sh version. + Copyright (C) 2020-2022 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 + . */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_STRUCT_STAT_H +#define _BITS_STRUCT_STAT_H 1 + +#include +#include + +struct stat + { +#ifdef __USE_TIME_BITS64 +# include +#else + __dev_t st_dev; /* Device. */ + unsigned short int __pad1; +# ifndef __USE_FILE_OFFSET64 + __ino_t st_ino; /* File serial number. */ +# else + __ino_t __st_ino; /* 32bit file serial number. */ +# endif + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + unsigned short int __pad2; +# ifndef __USE_FILE_OFFSET64 + __off_t st_size; /* Size of file, in bytes. */ +# else + __off64_t st_size; /* Size of file, in bytes. */ +# endif + __blksize_t st_blksize; /* Optimal block size for I/O. */ + +# ifndef __USE_FILE_OFFSET64 + __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ +# else + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +# endif +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif +# ifndef __USE_FILE_OFFSET64 + unsigned long int __glibc_reserved4; + unsigned long int __glibc_reserved5; +# else + __ino64_t st_ino; /* File serial number. */ +# endif +#endif /* __USE_TIME_BITS64 */ + }; + +#ifdef __USE_LARGEFILE64 +struct stat64 + { +# ifdef __USE_TIME_BITS64 +# include +# else + __dev_t st_dev; /* Device. */ + unsigned int __pad1; + + __ino_t __st_ino; /* 32bit file serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + unsigned int __pad2; + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +# endif + __ino64_t st_ino; /* File serial number. */ +# endif /* __USE_TIME_BITS64 */ + }; +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC + + +#endif /* _BITS_STRUCT_STAT_H */ From patchwork Wed Oct 19 22:14:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59089 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B00DD3857BB6 for ; Wed, 19 Oct 2022 22:15:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B00DD3857BB6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217707; bh=BKenFe6ocOSZC8JE47HZabOP9N0ffaztT87FUc3mj9A=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Zr/EEcJvtW6WC7/NeCD+V6R15i7mJUxD9370MVOWTxg15jlt35bPVh8ANz7UXyuFi 6d/P7Kq6bkzGaQpV+ujoGYk6co9bLCblZKGn3yjDum2zrAQme2WZqLg96r46spe5vZ iUw+7QvYnH/99yjuh2+i5pAhHOhCFBqDd4ZmETP0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 5369D3858C83 for ; Wed, 19 Oct 2022 22:14:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5369D3858C83 Received: by mail-ot1-x334.google.com with SMTP id p24-20020a9d6958000000b00661c528849eso10333415oto.9 for ; Wed, 19 Oct 2022 15:14:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BKenFe6ocOSZC8JE47HZabOP9N0ffaztT87FUc3mj9A=; b=qKiKcNkoyyaW5Eg2821f33OiW48qt++JKatah1eBd8yKgb8fYYmWj3Mo2LVTwwwtm1 U4/aoV0ylbb6rW4VEtN62BmfkuazBO/hQfq69kGF7NfUdVhN9LkA5+zmuVVGITrJbpL9 UpsCtiO4Wz3tgcMOrStsKorg/KgWbA93Dk0+Uy7uTXMNKX0Z22n/cjiU25ztpWPo4Jte ops7/D6pftIB0zaDyQMkKJrn/4d6ek303p8nn0Qlc2qsuIlMo/oZjPWqxlOOuNiFjUd8 DjydBcnKwTc4NNqB0ViqZA/ZJKRkYk2C7ChiX4boQTO4fYlJV5ltOTPUyITiaHvokJeM joyw== X-Gm-Message-State: ACrzQf3dZjYAPOxDzkmpbqjV/gPWpwlld6XQP0B0yUb0QTVrqyfxPaV2 tx6nImsAEnrgMR67pNwqs2HScJkeIAk2LjD0 X-Google-Smtp-Source: AMsMyM4b/Kp3Kj+ZAOgiZC1zHo4uY6SErMSqkbBLNvNh5Lr1kEAgLll/DgQixhyxBiD6aq0b3aonKw== X-Received: by 2002:a05:6830:4487:b0:661:dba8:cc61 with SMTP id r7-20020a056830448700b00661dba8cc61mr5177201otv.256.1666217680329; Wed, 19 Oct 2022 15:14:40 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:39 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 02/30] linux: Consolidate dl-origin.c Date: Wed, 19 Oct 2022 19:14:05 -0300 Message-Id: <20221019221433.1082017-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use the generic implementation as the default, since the syscall is supported by all architectures. Also cleanup some headers and remove the INTERNAL_SYSCALL_ERROR_P usage (the INTERNAL_SYSCALL_CALL macro already returns an negative value if an error occurs). --- sysdeps/unix/sysv/linux/dl-origin.c | 14 ++-- sysdeps/unix/sysv/linux/generic/dl-origin.c | 79 --------------------- 2 files changed, 5 insertions(+), 88 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/generic/dl-origin.c diff --git a/sysdeps/unix/sysv/linux/dl-origin.c b/sysdeps/unix/sysv/linux/dl-origin.c index 9a76c78648..2fd1e5f400 100644 --- a/sysdeps/unix/sysv/linux/dl-origin.c +++ b/sysdeps/unix/sysv/linux/dl-origin.c @@ -17,15 +17,11 @@ . */ #include -#include -#include -#include -#include +#include +#include #include #include -#include - /* On Linux >= 2.1 systems which have the dcache implementation we can get the path of the application from the /proc/self/exe symlink. Try this first and fall back on the generic method if necessary. */ @@ -37,9 +33,9 @@ _dl_get_origin (void) char *result; int len; - len = INTERNAL_SYSCALL_CALL (readlink, "/proc/self/exe", linkval, - sizeof (linkval)); - if (! INTERNAL_SYSCALL_ERROR_P (len) && len > 0 && linkval[0] != '[') + len = INTERNAL_SYSCALL_CALL (readlinkat, AT_FDCWD, "/proc/self/exe", + linkval, sizeof (linkval)); + if (len > 0 && linkval[0] != '[') { /* We can use this value. */ assert (linkval[0] == '/'); diff --git a/sysdeps/unix/sysv/linux/generic/dl-origin.c b/sysdeps/unix/sysv/linux/generic/dl-origin.c deleted file mode 100644 index ed3ac3570c..0000000000 --- a/sysdeps/unix/sysv/linux/generic/dl-origin.c +++ /dev/null @@ -1,79 +0,0 @@ -/* Find path of executable. - Copyright (C) 1998-2022 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 -#include -#include -#include -#include -#include - -#include - -/* On Linux >= 2.1 systems which have the dcache implementation we can get - the path of the application from the /proc/self/exe symlink. Try this - first and fall back on the generic method if necessary. */ - -const char * -_dl_get_origin (void) -{ - char linkval[PATH_MAX]; - char *result; - int len; - - len = INTERNAL_SYSCALL_CALL (readlinkat, AT_FDCWD, "/proc/self/exe", - linkval, sizeof (linkval)); - if (! INTERNAL_SYSCALL_ERROR_P (len) && len > 0 && linkval[0] != '[') - { - /* We can use this value. */ - assert (linkval[0] == '/'); - while (len > 1 && linkval[len - 1] != '/') - --len; - result = (char *) malloc (len + 1); - if (result == NULL) - result = (char *) -1; - else if (len == 1) - memcpy (result, "/", 2); - else - *((char *) __mempcpy (result, linkval, len - 1)) = '\0'; - } - else - { - result = (char *) -1; - /* We use the environment variable LD_ORIGIN_PATH. If it is set make - a copy and strip out trailing slashes. */ - if (GLRO(dl_origin_path) != NULL) - { - size_t len = strlen (GLRO(dl_origin_path)); - result = (char *) malloc (len + 1); - if (result == NULL) - result = (char *) -1; - else - { - char *cp = __mempcpy (result, GLRO(dl_origin_path), len); - while (cp > result + 1 && cp[-1] == '/') - --cp; - *cp = '\0'; - } - } - } - - return result; -} From patchwork Wed Oct 19 22:14:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59092 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 35FBF3854175 for ; Wed, 19 Oct 2022 22:15:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 35FBF3854175 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217756; bh=zIL07JOtAkTnCTYvSWDu8qKn1ZdmgMkCov51L5kJXDg=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=uC3E9yxw9u0GVQEOoCyX+KuNpniyIUvQc6stsYAifF2F9BOFSIc0Is4sLM1Ja4vdB 7lWCr+LcIiEj9wkzWU+JCJoffwcRJlLgNmUZU+dvccVj01cMP6T2WY9pQf3R34s4nn 7rfANLhP3OExyQEjTaa2z831HOxrcRK+D+52MBC8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by sourceware.org (Postfix) with ESMTPS id 809C73858C2D for ; Wed, 19 Oct 2022 22:14:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 809C73858C2D Received: by mail-oi1-x22d.google.com with SMTP id y72so20885071oia.3 for ; Wed, 19 Oct 2022 15:14:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zIL07JOtAkTnCTYvSWDu8qKn1ZdmgMkCov51L5kJXDg=; b=b1f2Kjowz0xvx13FM42k4m7DGad+KBDKEUfYvC2B/Y8h7N8MlZecJ+2I1/70nMMtl3 2S4mkTh1L2kosoHp6c+ANylZKanHZoLWt1EH3RWuWSthKG/FX6EpDVwIuVv/CqGyRI5M tcLeY52AXyLM222+epGeGGp84zpR7762/jkeaz1FF9LBrmjsZfJyN+bSW365WZbipdre Y9KKBaAm5ke7UpwGLE0+vUoxFqBEh7PM1BIsC6XebOnVDuZa1sztM4Ul9VaSSi2/ezrS dTETuSwTUfbqEi10gVT2GlWc1jqYaPgflOFzkL5AHEZuDzlmd6AAxakoakxs/+U9p6Mi Q09A== X-Gm-Message-State: ACrzQf1NuTKjkaopzhmINxHPJOebvMQKAICVY9eaIMJbJT1hJHyZbHNA 8qTBbb+RsULZs7Hxes2PdidgAGZj+f6roHDp X-Google-Smtp-Source: AMsMyM4fn4ChON60M2FdhsxlwUUkLrZOhteDa56BzS8j/Vy7CRWV7moS+mhsKae9MMxbR8cUUUSCMA== X-Received: by 2002:a05:6808:d53:b0:355:4c55:2384 with SMTP id w19-20020a0568080d5300b003554c552384mr6368566oik.190.1666217681611; Wed, 19 Oct 2022 15:14:41 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:41 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 03/30] Linux: consolidate chmod implementation Date: Wed, 19 Oct 2022 19:14:06 -0300 Message-Id: <20221019221433.1082017-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use chmod syscall if defined, otherwise use fchmodat. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/chmod.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/chmod.c (78%) diff --git a/sysdeps/unix/sysv/linux/generic/chmod.c b/sysdeps/unix/sysv/linux/chmod.c similarity index 78% rename from sysdeps/unix/sysv/linux/generic/chmod.c rename to sysdeps/unix/sysv/linux/chmod.c index 98b72c0be1..aedd4c0aed 100644 --- a/sysdeps/unix/sysv/linux/generic/chmod.c +++ b/sysdeps/unix/sysv/linux/chmod.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Change permissions of a file. Linux version. + Copyright (C) 2011-2022 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 @@ -16,14 +17,17 @@ . */ #include -#include #include /* Change the protections of FILE to MODE. */ int __chmod (const char *file, mode_t mode) { - return INLINE_SYSCALL (fchmodat, 3, AT_FDCWD, file, mode); +#ifdef __NR_chmod + return INLINE_SYSCALL_CALL (chmod, file, mode); +#else + return INLINE_SYSCALL_CALL (fchmodat, AT_FDCWD, file, mode); +#endif } libc_hidden_def (__chmod) From patchwork Wed Oct 19 22:14:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59096 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9A1CC385084E for ; Wed, 19 Oct 2022 22:16:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A1CC385084E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217799; bh=UxQ4AY34WML/uxXfzv2PVhcpfBrMOK+YpXlIOvrC6xA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=D83QnXDoSjnYRfzJYbm+Ze4PwxdN/CHdf+yUDkbc98MKC1lPst6h2C5Hserr7IMcs 0lXvsq8aqLlDhX4v6+rCepwrfCMmD9HTjAFU6LWL0sNhTUWOODaSaDau99K7jZkPJi A+U2BVwfJM6c66C48yCRWRsFnOwbCy/PnFZLIqBw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by sourceware.org (Postfix) with ESMTPS id 10F4E3858C2F for ; Wed, 19 Oct 2022 22:14:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 10F4E3858C2F Received: by mail-oi1-x230.google.com with SMTP id y72so20885123oia.3 for ; Wed, 19 Oct 2022 15:14:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UxQ4AY34WML/uxXfzv2PVhcpfBrMOK+YpXlIOvrC6xA=; b=eqE1MPbauc+kieSz+XucdZ1qJgpYBWcS16KtPLlXIKstatnkdmrB35ra9e47Xm2lZO FKaBsBA0tlJ8aanYmYOsF5vjix7YkktJEHYRW+OXo5lBYAIyXvsk0Dje+NKSHWuVSYSJ gLrAGW4HrR+Nbr2sC+Maf996Q1klLfoltqq8jiXQTB9i8JO1b8R15r4WgUtnFX8mOs1y r3O6AwI1AmEj2e8bMnOnx7xo/zSD4jY4QvODSnDl9XTJRWdU01RCkvyQtZ/XjlnkmnH2 bMqnllfM/bd/vPrrzjxzSDSPwzPoqjv2p011zv0rTSc75NjfTQmY00h+Cep93zhVweCC 41JQ== X-Gm-Message-State: ACrzQf2up/B8VuYVUgfmAnKbBryVaAMjlwfbZZRgXBoNDnLFmhovCm0b hr/XbXzcLoBe0R5FY0hriSFhdJlY2KLJNLIq X-Google-Smtp-Source: AMsMyM4U9EWLauZP/04vRCnsfiAHHkjYW0hG9RC/UsIwSw2TzTEV0+sVb2J95Ma9RCQsGvNApCZuBg== X-Received: by 2002:a05:6808:118e:b0:345:9c3e:121d with SMTP id j14-20020a056808118e00b003459c3e121dmr5956002oil.211.1666217683181; Wed, 19 Oct 2022 15:14:43 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:42 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 04/30] Linux: consolidate chown implementation Date: Wed, 19 Oct 2022 19:14:07 -0300 Message-Id: <20221019221433.1082017-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use chown syscall if defined, otherwise use fchownat. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/chown.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/chown.c (77%) diff --git a/sysdeps/unix/sysv/linux/generic/chown.c b/sysdeps/unix/sysv/linux/chown.c similarity index 77% rename from sysdeps/unix/sysv/linux/generic/chown.c rename to sysdeps/unix/sysv/linux/chown.c index 53997a1127..c1cd4d6c3d 100644 --- a/sysdeps/unix/sysv/linux/generic/chown.c +++ b/sysdeps/unix/sysv/linux/chown.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Change ownership of a file. Linux version. + Copyright (C) 2011-2022 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 @@ -23,7 +24,11 @@ int __chown (const char *file, uid_t owner, gid_t group) { - return INLINE_SYSCALL (fchownat, 5, AT_FDCWD, file, owner, group, 0); +#ifdef __NR_chown + return INLINE_SYSCALL_CALL (chown, file, owner, groups); +#else + return INLINE_SYSCALL_CALL (fchownat, AT_FDCWD, file, owner, group, 0); +#endif } libc_hidden_def (__chown) weak_alias (__chown, chown) From patchwork Wed Oct 19 22:14:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59099 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 03DEF3851AB4 for ; Wed, 19 Oct 2022 22:17:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03DEF3851AB4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217853; bh=KvOipvlLrphK69tokPqPXzWVR0GEbyNQ+b+Kr8m7wgk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=SfvKcSns5n5dLIKCCoY08p7W0stGEaaJgMGWGl+JiGbL5RadwKD6ejlorl2GYse2y rvMruDiwhTELAIuXENFtHJybp6tVMgCJked5IoH7qwczYzkQnwYxg8JsbZqk7PtivX 225a4k+AN3i0afJl520uOVarSrjtBbt6m65i1r+o= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by sourceware.org (Postfix) with ESMTPS id 73FE03858291 for ; Wed, 19 Oct 2022 22:14:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 73FE03858291 Received: by mail-oi1-x22c.google.com with SMTP id g10so20856293oif.10 for ; Wed, 19 Oct 2022 15:14:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KvOipvlLrphK69tokPqPXzWVR0GEbyNQ+b+Kr8m7wgk=; b=WjoeDo4JRlvY2AJPjVXbszyjO9YuiLJzD7Hyq3FAmZ9DUjKfPQWoZyqVHSLoxDzvTS UvW5aoWuWgiDjE6X3p5xTPJmvHsr2B1iP0WbGDm53E1CCaCv73Hl0TXLgaluvtK6h4yk i1/FMcAJyTAvP29jMYPPsMOd+Uqph1CBUlvOEEo+Q6RjUtRNolR78SvzR8QCe/K+LnNK jswvGsA709epRZuFEatU7PTdMSD09/o0rUYeJNwjH4hz+VSbVGiwGAn1/BuNMQWo2ZQA ECLI4qcP0UD6P4IRvinZACladTBrgMKlpZL4rXSvUTmw0f/lgrGimyF0UP7tUfY+6LuZ TX3A== X-Gm-Message-State: ACrzQf1Im0tt45SWpSZ8Lfjd4ASQzysNpFfRKXxYU3GYD8jK02wLfk7x 5WnN4iNydb77NJVpzUKndCsM9iQvN5wZtfHl X-Google-Smtp-Source: AMsMyM6tEZnN+tnd19FV4uBmU0DMAIRoqmSyJ0qVLos8wb43sDDyE+D4BSiWTGI3gmLSC+fQ9zSkoA== X-Received: by 2002:a05:6808:3b8:b0:354:7f5a:de31 with SMTP id n24-20020a05680803b800b003547f5ade31mr5678044oie.135.1666217684362; Wed, 19 Oct 2022 15:14:44 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:44 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 05/30] Linux: consolidate dup2 implementation Date: Wed, 19 Oct 2022 19:14:08 -0300 Message-Id: <20221019221433.1082017-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use dup2 syscall if defined, otherwise use dup3. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/dup2.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/dup2.c (83%) diff --git a/sysdeps/unix/sysv/linux/generic/dup2.c b/sysdeps/unix/sysv/linux/dup2.c similarity index 83% rename from sysdeps/unix/sysv/linux/generic/dup2.c rename to sysdeps/unix/sysv/linux/dup2.c index 0dc45e9b17..1182780e15 100644 --- a/sysdeps/unix/sysv/linux/generic/dup2.c +++ b/sysdeps/unix/sysv/linux/dup2.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Duplicate a file descriptor. Linux version. + Copyright (C) 2011-2022 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 @@ -24,12 +25,16 @@ int __dup2 (int fd, int fd2) { +#ifdef __NR_dup2 + return INLINE_SYSCALL_CALL (dup2, fd, fd2); +#else /* For the degenerate case, check if the fd is valid (by trying to get the file status flags) and return it, or else return EBADF. */ if (fd == fd2) return __libc_fcntl (fd, F_GETFL, 0) < 0 ? -1 : fd; - return INLINE_SYSCALL (dup3, 3, fd, fd2, 0); + return INLINE_SYSCALL_CALL (dup3, fd, fd2, 0); +#endif } libc_hidden_def (__dup2) weak_alias (__dup2, dup2) From patchwork Wed Oct 19 22:14:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59094 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0FEC13851A9A for ; Wed, 19 Oct 2022 22:16:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FEC13851A9A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217777; bh=OjELyAtioKsqYmKe5p1cAuCgAkWm7yKZsOkUPkVVZc0=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ywSlL/CcCBWhLB3+acFo30hPrQsFNf8ZcXXzcfCJ/0aztbc30dwIZsDqJtfOpq2vS uXP+XpodQwCQBQ4+ZcHCVVzfvwVovOzKm92yvfhjDlP70zG1sqS8FiFs+BP/72zj+0 Krn4IhfBfN+YQ01VNxaAv/eAZgFR2tIX+ao2fBJE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id EFA3E3858286 for ; Wed, 19 Oct 2022 22:14:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EFA3E3858286 Received: by mail-oi1-x232.google.com with SMTP id p127so20212480oih.9 for ; Wed, 19 Oct 2022 15:14:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OjELyAtioKsqYmKe5p1cAuCgAkWm7yKZsOkUPkVVZc0=; b=GlYWDx8xAaB9eo5RusCAPdAXmxpAPxXCHVe0ZgxvbHDybs3NqfocHnfBUlVCsCj562 BluVEvJbYX3Z/G530sPGRKMxA/QEtTp+4hSXiVo3utI/jEnhoVVM1X7IvpuunJIWFlnC hKZ4e+q0ALW0x5f+X9JVXHnZEKUM/DMRfYoY77+v6wcRFrI8iDzZ44Uc7FcEvh3i7BhW KwYtev9rKT4QPC0WnHgJTWdbDmB5ol+gU1N8UI9jVkQ2zMFzJUZNRZcWJGs+uARqSlJW BtyWEbYeLrpQD9NgHTc7tJ+VCOLHzN93wIh14MNVtaXizy+3KdzCsPnFC7mJgbf4rXgi RU7A== X-Gm-Message-State: ACrzQf2BRIeJ3e2VNSWnRN2eNpAKw7pzgyG445LGOads7i8S8Clr+gVa zkpZVm4MzjZAFr+B4tq76TNdTiRynBW0ARcu X-Google-Smtp-Source: AMsMyM5p4Edzfb+lotheZcmj2g0J1rBwrhQkIfXh4/GK/k/0NxuJWFmKZwU97OMpI7reqBdk1McXGw== X-Received: by 2002:a05:6808:1408:b0:355:2101:e28c with SMTP id w8-20020a056808140800b003552101e28cmr5689651oiv.296.1666217685881; Wed, 19 Oct 2022 15:14:45 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:45 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 06/30] Lninux: consolidate epoll_create implementation Date: Wed, 19 Oct 2022 19:14:09 -0300 Message-Id: <20221019221433.1082017-7-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use epoll_create syscall if defined, otherwise use epoll_create1. Reviewed-by: Florian Weimer Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/epoll_create.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/epoll_create.c (79%) diff --git a/sysdeps/unix/sysv/linux/generic/epoll_create.c b/sysdeps/unix/sysv/linux/epoll_create.c similarity index 79% rename from sysdeps/unix/sysv/linux/generic/epoll_create.c rename to sysdeps/unix/sysv/linux/epoll_create.c index fa28694929..afb1921637 100644 --- a/sysdeps/unix/sysv/linux/generic/epoll_create.c +++ b/sysdeps/unix/sysv/linux/epoll_create.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Open an epoll file descriptor. Linux version. + Copyright (C) 2011-2022 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 @@ -23,12 +24,16 @@ libc_hidden_proto (epoll_create) int epoll_create (int size) { +#ifdef __NR_epoll_create + return INLINE_SYSCALL_CALL (epoll_create); +#else if (size <= 0) { __set_errno (EINVAL); return -1; } - return INLINE_SYSCALL (epoll_create1, 1, 0); + return INLINE_SYSCALL_CALL (epoll_create1, 0); +#endif } libc_hidden_def (epoll_create) From patchwork Wed Oct 19 22:14:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59098 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6CD78385DC1F for ; Wed, 19 Oct 2022 22:17:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6CD78385DC1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217827; bh=40CVLB+eXEIWG4vaLsKJ4S6N2Q+d1kOvrVWRLD1vU+I=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=c4XpxTs9OT6IcIaOYGnB8E1evsrGmmyiiLbf9X901UWjF9N+FfQKi/C1AAQg+STaI NwUdGZODrsyFtJLJDC69PN5UQxwxiRPMSxddEu95YM7slQb8O3xdQjrS+Lmdfuc6wA 4svDUn5/jAVL68ZftOyFTvDKt1INIw81/koLPz7M= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by sourceware.org (Postfix) with ESMTPS id 23D843858400 for ; Wed, 19 Oct 2022 22:14:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 23D843858400 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-1326637be6eso22369748fac.13 for ; Wed, 19 Oct 2022 15:14:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=40CVLB+eXEIWG4vaLsKJ4S6N2Q+d1kOvrVWRLD1vU+I=; b=m5jWEaHP6J2zJbn35+5R04DnEIJuYN/sIwYx3MiX7mD7YCM46SfN83SBFNGPtSuY0v gOimKauIYekOpVFZhvMnyKLm+/my+YJptfzCrPdqMGw1PVNxCOr8BZT2hGi9lFLuz/he Vim4mt6VHgdNgjnTLbYqvtdC0mxNp/f+d+43Ib/6dFZM1opBVQoFr2v/Ay/syShz+315 o54q6DEUCb7eycapbVaibvC9lOYvvHOi6s/8yJ82I9s3hfIrctfA61AwMtxJKIpo7mGq jotybwCgo9xG8XWG7+mV/ZN6f50r/oSTAs2pYiyvJGowqNtALi7/f1EAufH/4ao7Hn3G CZNw== X-Gm-Message-State: ACrzQf3Fq/4I7lU0UPmqewpAREmzDvy5mAzluzOpTQLoiYPD6tg1PrrI qtO/1G3skUJ7fH2DxH/GuYcaddUuRHTlmCEo X-Google-Smtp-Source: AMsMyM6FLc1vOVDA7W9DkmBT24CpOY/7NGBrab7YlZXLW1HRYtXgGSM6uuP4WsJ3SAtGR1ASm+SO9w== X-Received: by 2002:a05:6871:9f:b0:131:52e5:fe7b with SMTP id u31-20020a056871009f00b0013152e5fe7bmr6427491oaa.80.1666217687162; Wed, 19 Oct 2022 15:14:47 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:46 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 07/30] Linux: consolidate inotify_init implementation Date: Wed, 19 Oct 2022 19:14:10 -0300 Message-Id: <20221019221433.1082017-8-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use inotify_init syscall if defined, otherwise use inotify_init1. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/inotify_init.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/inotify_init.c (78%) diff --git a/sysdeps/unix/sysv/linux/generic/inotify_init.c b/sysdeps/unix/sysv/linux/inotify_init.c similarity index 78% rename from sysdeps/unix/sysv/linux/generic/inotify_init.c rename to sysdeps/unix/sysv/linux/inotify_init.c index 3297ebc705..4da5b723a6 100644 --- a/sysdeps/unix/sysv/linux/generic/inotify_init.c +++ b/sysdeps/unix/sysv/linux/inotify_init.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Initialize an inotify instance. Linux version. + Copyright (C) 2011-2022 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 @@ -23,6 +24,10 @@ libc_hidden_proto (inotify_init) int inotify_init (void) { - return INLINE_SYSCALL (inotify_init1, 1, 0); +#ifdef __NR_inotify_init + return INLINE_SYSCALL_CALL (inotify_init); +#else + return INLINE_SYSCALL_CALL (inotify_init1, 0); +#endif } libc_hidden_def (inotify_init) From patchwork Wed Oct 19 22:14:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59102 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 672083857BB6 for ; Wed, 19 Oct 2022 22:18:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 672083857BB6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217880; bh=eLXLMjIK8DsAGanH2FNH0SCS4eVC7hSznTdMLudL3GY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=QLJXW/SduSetuSKCFaVQc5on9RsoMsflNiYERmbDUARu6SukHPise88gFZ4G91W7D NdcL7yN4ciX6K3ihsfPjrFKykUdvTmweuKcUU3ucuojeL7pZLkaRLIlS7e2sLAmIF+ TgLBTZAotV1hcVJtZEvRHZFTvVkftC/12cIlge/A= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 021CE38582B8 for ; Wed, 19 Oct 2022 22:14:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 021CE38582B8 Received: by mail-oi1-x231.google.com with SMTP id u15so20879119oie.2 for ; Wed, 19 Oct 2022 15:14:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eLXLMjIK8DsAGanH2FNH0SCS4eVC7hSznTdMLudL3GY=; b=1Yzo3RmR77ItE7/DuqiFEL7N9mGWhskeZXEneP7266sQzHyz+BH86cN9y/O28Rli5h TiTQJnau1YuERwLtflRKNNGfTHAT4jtY2fJ8oiyIR2FW7cnpnRjE+LAbMAI0QNCPCjHs qP3UM/9HywlH+BpvAKtfB1Ry+DIIqfvoBaIfd4oFojQo/0HLEFaCpyT5i6cvYSr1vkGd ru9nx0I7VOOYOnaAxe7LJA8LLje9W1WqcgLrz8IXNPszn76sfMF8e4LHn/KFwWi2eLxe 0R050dY+18Jeg/U97WxhIridpvg1zFackuRMi8MH78RQfgj43zYtIEe8/JfJ5mb16a7I b71g== X-Gm-Message-State: ACrzQf16WOW8XXyVICz2+2GEwb4qbvjNGU0XeY5cJdrFEt8s30h6drlz +5+PeqKGwDZ5HJns77PqHQmoFDm4UCKdT2Rh X-Google-Smtp-Source: AMsMyM5tpcP4j0Xfy3mQAWkgtDwDHUCQ/cQFBncxa4TaIHj01nbn4WY/lJQ0AA0G6+pL6+lhY6NLjQ== X-Received: by 2002:a05:6808:2223:b0:354:d41e:5318 with SMTP id bd35-20020a056808222300b00354d41e5318mr5420162oib.80.1666217688355; Wed, 19 Oct 2022 15:14:48 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:48 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 08/30] Linux: consolidate lchown implementation Date: Wed, 19 Oct 2022 19:14:11 -0300 Message-Id: <20221019221433.1082017-9-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use lchown syscall if defined, otherwise use fchownat. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/lchown.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/lchown.c (75%) diff --git a/sysdeps/unix/sysv/linux/generic/lchown.c b/sysdeps/unix/sysv/linux/lchown.c similarity index 75% rename from sysdeps/unix/sysv/linux/generic/lchown.c rename to sysdeps/unix/sysv/linux/lchown.c index 996925d799..4888e5f194 100644 --- a/sysdeps/unix/sysv/linux/generic/lchown.c +++ b/sysdeps/unix/sysv/linux/lchown.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Change ownership of a file. Linux version. + Copyright (C) 2011-2022 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 @@ -23,7 +24,11 @@ int __lchown (const char *file, uid_t owner, gid_t group) { - return INLINE_SYSCALL (fchownat, 5, AT_FDCWD, file, owner, group, - AT_SYMLINK_NOFOLLOW); +#ifdef __NR_lchown + return INLINE_SYSCALL_CALL (lchown, file, owner, group); +#else + return INLINE_SYSCALL_CALL (fchownat, AT_FDCWD, file, owner, group, + AT_SYMLINK_NOFOLLOW); +#endif } weak_alias (__lchown, lchown) From patchwork Wed Oct 19 22:14:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59091 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F19B33857415 for ; Wed, 19 Oct 2022 22:15:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F19B33857415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217740; bh=ATzIUyCX+xkMyp+1xRx6pUdXFhvAavBYnMLmLS4NlL4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=P3CwQ3nmQWZSEoZXskcBk5YdlfLe92hz8IIBE6TspTKCFmbHHodcMz609ElhSmbu0 JUjsCapoUUTrZ6riZmRdI7DjUfsyAHRegjf9UUCeDX2f4X0I71vef/E+hYiJIo8Ulm HX6LHaNnHCGGVEW+35a0weaZEii50tYYY7Zy3wPI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by sourceware.org (Postfix) with ESMTPS id DD05A3857C77 for ; Wed, 19 Oct 2022 22:14:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DD05A3857C77 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-1321a1e94b3so22422240fac.1 for ; Wed, 19 Oct 2022 15:14:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ATzIUyCX+xkMyp+1xRx6pUdXFhvAavBYnMLmLS4NlL4=; b=CF4Eqm1hJtfBuzPaUPMEr3Co7G1LxaHMA5ZIxZXkTRhPMIW1e06B3bfiSMd941QJGZ 7Ir+Oq8mxkkNQtEm3qn0MacrJFG3voxOGJ5TSftnsnuJMJtfPZyyS5ODw4lqMVb9Pt6k x7BUQ5OX1ahQhjVpZwTtvDArNGo8EbZe+PMmKtyYZ/1xpOtYKw940XC/UXFMFSj6rr5W ccdQrkDBiBMmFE8x87IzoLg6c80CkA7XFM7gRpwsi1uaaVMte7vS/WxdDOEzfXfP4kvp Jzo8GJ3uMSSg97Km7r9cmc1amm99SHz4gleWilJCbmzZ15EPl4vIQ25w/XO21XwHvaK8 Guzw== X-Gm-Message-State: ACrzQf2uSkLtgbWXRjuBJgItzVyU038dQWDQ77v5dZHekgYdqqOq46CI xKLqVs2OT5yhKpEqBYDCmtl3g8TB0wh+6Lko X-Google-Smtp-Source: AMsMyM5bZiw5SZkGkEWTDqX0ZJFj7/tRH9DthOu/jewj+ZOwTU/KqA+9O/xdZpwWy96Il4FQQgyD3w== X-Received: by 2002:a05:6871:b28:b0:132:a186:f3ff with SMTP id fq40-20020a0568710b2800b00132a186f3ffmr6159969oab.240.1666217689944; Wed, 19 Oct 2022 15:14:49 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:49 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 09/30] Linux: consolidate link implementation Date: Wed, 19 Oct 2022 19:14:12 -0300 Message-Id: <20221019221433.1082017-10-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use link syscall if defined, otherwise use linkat. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/link.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/link.c (78%) diff --git a/sysdeps/unix/sysv/linux/generic/link.c b/sysdeps/unix/sysv/linux/link.c similarity index 78% rename from sysdeps/unix/sysv/linux/generic/link.c rename to sysdeps/unix/sysv/linux/link.c index e07655d521..eb4fe1569e 100644 --- a/sysdeps/unix/sysv/linux/generic/link.c +++ b/sysdeps/unix/sysv/linux/link.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Make a new name for a file. Linux version. + Copyright (C) 2011-2022 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 @@ -23,7 +24,11 @@ int __link (const char *from, const char *to) { - return INLINE_SYSCALL (linkat, 5, AT_FDCWD, from, AT_FDCWD, to, 0); +#ifdef __NR_link + return INLINE_SYSCALL_CALL (link, from, to); +#else + return INLINE_SYSCALL_CALL (linkat, AT_FDCWD, from, AT_FDCWD, to, 0); +#endif } weak_alias (__link, link) From patchwork Wed Oct 19 22:14:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59093 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 99EA2385E02B for ; Wed, 19 Oct 2022 22:15:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99EA2385E02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217757; bh=Gebe1L/WFKS6Jp0uSsDKbZMlQlbCYiaVInK+Iy/++W4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=w+VuTnvF0XgYwR5WSOtegDl/5EY8YgIVtUHMEdvLV+bZNIdlmcQGqNmvRtCCrW/Hm PUVFtN7MYKLHfN3Zq/mYOwHodR2zTKMY/E2+YMcHhE9ffRgVhV9aGiZwhTbnvdgkLI XD9f/RAFlZvJUNKKZLf2oCvFNts2wmdlLcEozpDw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 05CD63857C5C for ; Wed, 19 Oct 2022 22:14:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 05CD63857C5C Received: by mail-ot1-x332.google.com with SMTP id t4-20020a9d7f84000000b00661c3d864f9so10340262otp.10 for ; Wed, 19 Oct 2022 15:14:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gebe1L/WFKS6Jp0uSsDKbZMlQlbCYiaVInK+Iy/++W4=; b=rogEjwgGZQFmvropKwsMN5SKUj18hQ/reggoDsE5Mqk3vXbbaRPLFOo++Y/eCuh5fk jhC9ITz8STpPFGOfhDWu0V/MEmETI1PAvMLqsW3KkPa4yHLussUS/QtBYw8FdhSEZfhX lQ705VIhteMy8XrL+t5XVIGAeGZEyrvUNgGPQEitv93w48AaNVsYo0eVIn1g8zMlQKY7 MgSdl8Od22ZigAR0eaKFW2/r1pEHd0at2GoyRg/qBjyB874ObE5mopID1g+TQ24dYARw /UtVBq5MO5yFnKQUv3lN4NXitrIBMxXW41/B3jJcmsacy85QzCzZvyu+cfBR9Ds9u2W6 lqtA== X-Gm-Message-State: ACrzQf3REAScZJyK5fR/FzCbIvbjVISQ35PqEUiPJPL5aczMrAaIlr47 ar4av9WLYlkAoa6WnRAY5OBBpnYJhYk5s6Qf X-Google-Smtp-Source: AMsMyM41F+TCL2zK0l6pL4AMzbSWD+UO/s0YW8+QrOcAFRxaeugcUuWCvZE0vQfG6/YudvgQw4u4hA== X-Received: by 2002:a9d:5c02:0:b0:65c:20e6:46a with SMTP id o2-20020a9d5c02000000b0065c20e6046amr4911044otk.213.1666217691295; Wed, 19 Oct 2022 15:14:51 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:50 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 10/30] Linux: consolidate mkdir implementation Date: Wed, 19 Oct 2022 19:14:13 -0300 Message-Id: <20221019221433.1082017-11-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use mkdir syscall if defined, otherwise use mkdirat. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/mkdir.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/mkdir.c (79%) diff --git a/sysdeps/unix/sysv/linux/generic/mkdir.c b/sysdeps/unix/sysv/linux/mkdir.c similarity index 79% rename from sysdeps/unix/sysv/linux/generic/mkdir.c rename to sysdeps/unix/sysv/linux/mkdir.c index f64fbd6176..a3653210fb 100644 --- a/sysdeps/unix/sysv/linux/generic/mkdir.c +++ b/sysdeps/unix/sysv/linux/mkdir.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Create a directory. Linux version. + Copyright (C) 2011-2022 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 @@ -15,19 +16,19 @@ License along with the GNU C Library. If not, see . */ -#include -#include -#include #include #include -#include - +#include /* Create a directory named PATH with protections MODE. */ int __mkdir (const char *path, mode_t mode) { - return INLINE_SYSCALL (mkdirat, 3, AT_FDCWD, path, mode); +#ifdef __NR_mkdir + return INLINE_SYSCALL_CALL (mkdir, path, mode); +#else + return INLINE_SYSCALL_CALL (mkdirat, AT_FDCWD, path, mode); +#endif } libc_hidden_def (__mkdir) From patchwork Wed Oct 19 22:14:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59103 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 08670386075D for ; Wed, 19 Oct 2022 22:18:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 08670386075D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217914; bh=q9GSxT2qGMi3i27OiJ8sTpuhWLNiLw7g/MJN2iDbon4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ZUd7WiTgPomomJJMRKeRbjyguIrR5H24A2/4SvzQ7PcVPDDx1SHawiWRqRlhHjMpv c/4NFLhmfH5pFhCSPNi++OrsPBC/ajzwhcUV6396Lpz3NbPDdJzV4+qo4YiLFqK6iG DU1x1E6oainPkq4yPfMTH2Gs16ttS6bNi/owThog= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by sourceware.org (Postfix) with ESMTPS id D9564385828B for ; Wed, 19 Oct 2022 22:14:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D9564385828B Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-13ae8117023so802671fac.9 for ; Wed, 19 Oct 2022 15:14:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q9GSxT2qGMi3i27OiJ8sTpuhWLNiLw7g/MJN2iDbon4=; b=dsVgerGYp7UmRadIRQbd5d4RSNcjSIpJIwHQwoQ8j6bhkdbDdTQqq29UiRKsV6kXLf zMPU5jqXECEQH7p2lG8iJ3+WC73cGcuc975jTk5vmo0VeashhrlXdIj79rqsdip8CXFr J0xDBdLLAFX+nEHtiQikkmCApbxJt1OSXc56PTHv2OCpujDofMw49mu/tdlAmYoZYmBY c87j1nQ/+b4y4bP5c+1U/Yg/77J8Wm9o37+DKqwG3vTn4MumuHKABlKM7BGAM6mRdBAJ Y+dunpiJmHZvprTUeOuC+2VPDczeCznBXWH+X8v8p1vsIvnTP/4M4cDbnwJn178OotNy lmQw== X-Gm-Message-State: ACrzQf2uS3+2BAC2uVOctihYThJD1fFgXqllJRJlwAoZc5C9bNMgtpk8 cT6KM3ew7HbkFw62fpYohZv4CKGZ2WSGfKQt X-Google-Smtp-Source: AMsMyM41mirX8QGt7HoUWVyvQ+jmJ7LRTNH3DMwGccpR5OY4sNKZQVJN93qfJJUCsH0a5FK+ZlP8Hw== X-Received: by 2002:a05:6871:b06:b0:136:c445:82d0 with SMTP id fq6-20020a0568710b0600b00136c44582d0mr22702984oab.146.1666217692707; Wed, 19 Oct 2022 15:14:52 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:52 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 11/30] Linux: consolidate readlink implementation Date: Wed, 19 Oct 2022 19:14:14 -0300 Message-Id: <20221019221433.1082017-12-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use readlink syscall if defined, otherwise readlinkat. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/readlink.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/readlink.c (80%) diff --git a/sysdeps/unix/sysv/linux/generic/readlink.c b/sysdeps/unix/sysv/linux/readlink.c similarity index 80% rename from sysdeps/unix/sysv/linux/generic/readlink.c rename to sysdeps/unix/sysv/linux/readlink.c index 9f25811a35..083dcaf502 100644 --- a/sysdeps/unix/sysv/linux/generic/readlink.c +++ b/sysdeps/unix/sysv/linux/readlink.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Read value of a symbolic link. Linux version. + Copyright (C) 2011-2022 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 @@ -25,6 +26,10 @@ ssize_t __readlink (const char *path, char *buf, size_t len) { - return INLINE_SYSCALL (readlinkat, 4, AT_FDCWD, path, buf, len); +#ifdef __NR_readlink + return INLINE_SYSCALL_CALL (readlink, path, buf, len); +#else + return INLINE_SYSCALL_CALL (readlinkat, AT_FDCWD, path, buf, len); +#endif } weak_alias (__readlink, readlink) From patchwork Wed Oct 19 22:14:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59104 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1A5FB383FB82 for ; Wed, 19 Oct 2022 22:19:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A5FB383FB82 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217941; bh=Bih9yY++zgSpLIWlAUMkOi8pODkNH67u55D9a6Qv2Nw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=O3yeckE8nIglsmjkk0oTsSjbBYdyc0CQdO4IVhiEy1oOzsOnJCSrdmFk7A/bROuTa p/GLTY0jce5k7oLJaXRs27jzDOE3EnYMooGMH5AkBaghthSU2osr2XKHlpynHrTyWC HTCp4BeJq44DcASggycGdhnAicmkbdSXjlPqWZuM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 03C283857C7C for ; Wed, 19 Oct 2022 22:14:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 03C283857C7C Received: by mail-ot1-x332.google.com with SMTP id cy15-20020a056830698f00b0065c530585afso10342777otb.2 for ; Wed, 19 Oct 2022 15:14:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bih9yY++zgSpLIWlAUMkOi8pODkNH67u55D9a6Qv2Nw=; b=EBtqXJj4v4qV3qoLMHbad76PWXQEY44NN7FNuVKN4YQ+AtSe67wcOMd0b6IzbmeAYc d16XB25589UloC10gYSQJXeDe381sAWrnGl2rQCr1t/6PXAklGw/DCZ43gDdJ1KQ9uTR m/eaz1zbcEaVw25cEFt2v5MoYdsRcCBbZDYbuxaBz95WjF5m8VUhRytmgQoqtLUw8tta jbIU26+T7xFP1ynwf3JmBsKYWItksx9P2UFlPki2lEQ54YNeGgxc97ASRTxMHpKecIwg ztKRrf4IZUA2ZWJqBrcsYDRJhdIIQhQD11F/N3Wk1vQO75VA1hcv7lT72n/DumndP2PG U1Mw== X-Gm-Message-State: ACrzQf29nOFudbGyFK8LgydkWXwZZPQ9FxWtK0x+d7wkL3hd3Ux59Tcy CAbAymIxdUl85czvFN4vULFBhNUyxO7+y2mI X-Google-Smtp-Source: AMsMyM6yGlomMDU9Gn1hB1hWaKxzeYXkIdcuU+6u54lzuk2jb39HdB8cU6wHBJeGKEqgZo0k3urPZg== X-Received: by 2002:a05:6830:1cc2:b0:65c:73f:b37b with SMTP id p2-20020a0568301cc200b0065c073fb37bmr5091504otg.290.1666217694140; Wed, 19 Oct 2022 15:14:54 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:53 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 12/30] Linux: consolidate rmdir implementation Date: Wed, 19 Oct 2022 19:14:15 -0300 Message-Id: <20221019221433.1082017-13-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use rmdir syscall if defined, otherwise use unlinkat. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/rmdir.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/rmdir.c (78%) diff --git a/sysdeps/unix/sysv/linux/generic/rmdir.c b/sysdeps/unix/sysv/linux/rmdir.c similarity index 78% rename from sysdeps/unix/sysv/linux/generic/rmdir.c rename to sysdeps/unix/sysv/linux/rmdir.c index 214ddc711b..cd5674f07c 100644 --- a/sysdeps/unix/sysv/linux/generic/rmdir.c +++ b/sysdeps/unix/sysv/linux/rmdir.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Delete a directory. Linux version. + Copyright (C) 2011-2022 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 @@ -23,6 +24,10 @@ int __rmdir (const char *path) { - return INLINE_SYSCALL (unlinkat, 3, AT_FDCWD, path, AT_REMOVEDIR); +#ifdef __NR_rmdir + return INLINE_SYSCALL_CALL (rmdir, path); +#else + return INLINE_SYSCALL_CALL (unlinkat, AT_FDCWD, path, AT_REMOVEDIR); +#endif } weak_alias (__rmdir, rmdir) From patchwork Wed Oct 19 22:14:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59107 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3D1A13882148 for ; Wed, 19 Oct 2022 22:19:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D1A13882148 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217969; bh=MgA4FvGy3s03NMG497LMXWeiCnUBXdu0SPdnRiTMi7M=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=eRv/Wayj6LCe8CqBTamJG3IAhcdTIvGL+LIJbOvRxsjpFidFbqEw6OBGOxsy+Q1lR spPmCoQhvEHt0fExDMPeTrjyHXib0IPG7VDXGSftVstMauMiitK8A08gY6ErsiBGke /F70tkUK+KqCiw9BBQs+AGhsovrDG7dOH0m/qXyg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by sourceware.org (Postfix) with ESMTPS id 9E3773858036 for ; Wed, 19 Oct 2022 22:14:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9E3773858036 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-1322fa1cf6fso22394713fac.6 for ; Wed, 19 Oct 2022 15:14:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MgA4FvGy3s03NMG497LMXWeiCnUBXdu0SPdnRiTMi7M=; b=uedXGwHcsHj8RvrFiUvrKILR4gkYPBG3by31EayyydxMwuDM6io7zZonJOiYiPcfnE jzwbHV779SD9RL87Vzpq470MySbg37uPlAgQ1GFemyh640drLF+B9bdJ+dA96BX1sOIW kiyBhxPoRcQ1NOuUHDxPQftMkjls5SqWjSUEhLJp5uRargWK9PjWvMZVGJNB+orj6k0h ucysc8hlSqW0p8UtyLthUR+33c4CfQV1WaBgq+/fDr+IIDyeZUcJ1LL0LcpKhpjGu8cc U9dVOWmiZEg24wbCRSqlq4mWgewvjamnGhRoz89hmEDewx9S78GEY2Vf4ktPlLQkZ778 vEog== X-Gm-Message-State: ACrzQf2VWX5EIvIgfJ7DjtaLNXEV+7t1QEqPfY1O/4L9OR8OMjummTzC QguW6Ms6AA+qF1cCIE0t27oBEuU0/PucfJoj X-Google-Smtp-Source: AMsMyM5cP6hRSCtVhWzJJr+DA6zxTEXAXEywqFft6AHVmZVlUY8CivQyGNfonTV9bX3EgGO1COG/Dw== X-Received: by 2002:a05:6870:609c:b0:131:c972:818f with SMTP id t28-20020a056870609c00b00131c972818fmr6344249oae.2.1666217695446; Wed, 19 Oct 2022 15:14:55 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:55 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 13/30] Linux: consolidate symlink implementation Date: Wed, 19 Oct 2022 19:14:16 -0300 Message-Id: <20221019221433.1082017-14-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use symlink syscall if defined, otherwise use symlinkat. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/symlink.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/symlink.c (78%) diff --git a/sysdeps/unix/sysv/linux/generic/symlink.c b/sysdeps/unix/sysv/linux/symlink.c similarity index 78% rename from sysdeps/unix/sysv/linux/generic/symlink.c rename to sysdeps/unix/sysv/linux/symlink.c index 9242f5825e..b336d5ec4c 100644 --- a/sysdeps/unix/sysv/linux/generic/symlink.c +++ b/sysdeps/unix/sysv/linux/symlink.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Make a new name for a file. Linux version. + Copyright (C) 2011-2022 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 @@ -23,6 +24,10 @@ int __symlink (const char *from, const char *to) { - return INLINE_SYSCALL (symlinkat, 3, from, AT_FDCWD, to); +#ifdef __NR_symlink + return INLINE_SYSCALL_CALL (symlink, from, to); +#else + return INLINE_SYSCALL_CALL (symlinkat, from, AT_FDCWD, to); +#endif } weak_alias (__symlink, symlink) From patchwork Wed Oct 19 22:14:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59097 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 807C0385042D for ; Wed, 19 Oct 2022 22:16:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 807C0385042D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217805; bh=BCO3qgKN5ANs4YtyTEzUCtpZQqOt10upJsBQkVIaeHE=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=x/a8GVF3hE052vdUdq5Abdra1tpPk/2oxkP+Lkgh+IiBDxd0DLxclOW0C7s9wv7J5 hw2WfL3N/0XyrpIlY2cNo8TJlpWoXyDEy0zpTn+UmFXTqdxPLjUsE6Qg0TQiQEj5A1 CegI6KiUomcQzZfdgmYtI/+9YJ/ik5XR5RX7Wh04= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) by sourceware.org (Postfix) with ESMTPS id 89E0E3857BB1 for ; Wed, 19 Oct 2022 22:14:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 89E0E3857BB1 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-136b5dd6655so22410686fac.3 for ; Wed, 19 Oct 2022 15:14:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BCO3qgKN5ANs4YtyTEzUCtpZQqOt10upJsBQkVIaeHE=; b=ntf/qg/qjBfOskjNLXbfg+D2JORWyXV9R2hsLRwiuzE2ouXkTX6wRQwnnUwwc3ruxe Cfg3R84etgiHyxZvcSLnPQD38y6CYi1szEqRPKwYR5MXFSb3pe3vMVPvCRjQjBvKDZ+X 4ambwCQwgh7fhUam64oH+bGw+IyGCptvpb9Dq9kB+U107zNB8Q9kePDNrlzu3lxym8Ok px7ibb3rArvS6Vj5EnH7eOcAz0ADOjgovOiV6XryaHEjeLNvF2HDsS7rLE8SSv2b1fZf e0kbrhtWyVsvJtBdyAcUmmDgUbrdvCVaIQ4q15VLtK+b2dUXKYXBT7H/GL9e/mKt2nJq 1U8g== X-Gm-Message-State: ACrzQf2kFqC7+vnJAVi4mJAO3znF9Q+ox2NEotRCk/KaIVa5ORTo09ck f4+2vKivu0/LTxfPK7t5k6Vxsu0ZaYibu9ND X-Google-Smtp-Source: AMsMyM6KPBJhu+HxNponSbAuelZN/Rku5bWN71nM6QAz2m8KY/Rt/d7dRN2s1bJO3JXKvt+ZlXALuA== X-Received: by 2002:a05:6870:d20a:b0:132:7f14:2474 with SMTP id g10-20020a056870d20a00b001327f142474mr21758437oac.10.1666217696589; Wed, 19 Oct 2022 15:14:56 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:56 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 14/30] Linux: consolidate unlink implementation Date: Wed, 19 Oct 2022 19:14:17 -0300 Message-Id: <20221019221433.1082017-15-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Use unlink syscall if defined, otherwise use unlinkat. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/unlink.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/unlink.c (77%) diff --git a/sysdeps/unix/sysv/linux/generic/unlink.c b/sysdeps/unix/sysv/linux/unlink.c similarity index 77% rename from sysdeps/unix/sysv/linux/generic/unlink.c rename to sysdeps/unix/sysv/linux/unlink.c index d2650acacc..e17b0a82d2 100644 --- a/sysdeps/unix/sysv/linux/generic/unlink.c +++ b/sysdeps/unix/sysv/linux/unlink.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Delete a name and possibly the file it refers to. Linux version. + Copyright (C) 2011-2022 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 @@ -23,6 +24,10 @@ int __unlink (const char *name) { - return INLINE_SYSCALL (unlinkat, 3, AT_FDCWD, name, 0); +#ifdef __NR_unlink + return INLINE_SYSCALL_CALL (unlink, name); +#else + return INLINE_SYSCALL_CALL (unlinkat, AT_FDCWD, name, 0); +#endif } weak_alias (__unlink, unlink) From patchwork Wed Oct 19 22:14:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59095 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E0F63860776 for ; Wed, 19 Oct 2022 22:16:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E0F63860776 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217787; bh=xZItmzty5TeD2FTrqhgPi8pJbxZ318hiFOmo66fAIqQ=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=jG48BpxbFiJMoEpUmpYzG2n3GYiAGIvi92kMmEudhJk+phu9UZ8zgXjq9OgfNN8b1 HnaFEMyOtO0Mzs3jVdntmRh6jFnRx7ARBF0VkLHrlDGtrNmQNp9gJv0vPK+UL6cdya clHa7vCOY055ckT2jOfeYP/83fDjSkx8vNKG9/vU= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id BA12438582A7 for ; Wed, 19 Oct 2022 22:14:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BA12438582A7 Received: by mail-ot1-x333.google.com with SMTP id d18-20020a05683025d200b00661c6f1b6a4so10337121otu.1 for ; Wed, 19 Oct 2022 15:14:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xZItmzty5TeD2FTrqhgPi8pJbxZ318hiFOmo66fAIqQ=; b=Ytc9ZKORfpUxjPvWPDQSqxHcgsEeyyQNvwlURU0PFuOzPHpTdgrxJpacvpl7SQIBSs RzTuy2YRodJf2xxn88EC40pD28/ozpAmthk6h6o+4Q/Y+uox/FUJSLnhfVm6lKzN2orm /RXDrIJkEI1aSsND8dizm4a5Tucp1TV8t7fdflCGkA59JtwPEREKt3vIvSrt2RW23KJd 7XaerMUqJAre0DFQX6gktxO3irEwmq1apEbWV1P2GVf1LLl3wcDmYx4YFu6dwNPGqYMj NTQziqvEZeFN9eWzI6T0FUiGXlKsx+AUNg2JtKJ1GNk2VPS9r1UREIBvxxG8w/NqmZpP SC1A== X-Gm-Message-State: ACrzQf0H0VRztN5XFTEiBDtDlu7lMEAMDQUEyjzf6TeZ8c/XMWaz99QD KlgviCVI6cCjhsB7QAj+qMm3234RkyJUh74e X-Google-Smtp-Source: AMsMyM6DEdVY+5oU9TYIavMHKWdx/4vXt8rguP4AVrBWooNkDy+ZonwYZJS0cEJmvIamkPjNW+Teiw== X-Received: by 2002:a9d:7dcc:0:b0:661:ad47:9685 with SMTP id k12-20020a9d7dcc000000b00661ad479685mr5254838otn.356.1666217697797; Wed, 19 Oct 2022 15:14:57 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:57 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 15/30] Linux: consolidate sendfile implementation Date: Wed, 19 Oct 2022 19:14:18 -0300 Message-Id: <20221019221433.1082017-16-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This is similar to other LFS consolidation, where the non-LFS is only built if __OFF_T_MATCHES_OFF64_T is not defined and the LFS version is aliased to non-LFS name if __OFF_T_MATCHES_OFF64_T is defined. For non-LFS variant, use sendfile syscall if defined, otherwise use sendfile64 plus the offset overflow check (as generic implementation). Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- .../sysv/linux/mips/mips64/n64/sendfile64.c | 1 - .../sysv/linux/mips/mips64/n64/syscalls.list | 3 -- .../{generic/wordsize-32 => }/sendfile.c | 15 ++++++-- sysdeps/unix/sysv/linux/sendfile64.c | 37 +++++++++++++++++++ sysdeps/unix/sysv/linux/syscalls.list | 2 - .../unix/sysv/linux/wordsize-64/sendfile64.c | 1 - .../unix/sysv/linux/wordsize-64/syscalls.list | 1 - 7 files changed, 49 insertions(+), 11 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/sendfile64.c delete mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list rename sysdeps/unix/sysv/linux/{generic/wordsize-32 => }/sendfile.c (77%) create mode 100644 sysdeps/unix/sysv/linux/sendfile64.c delete mode 100644 sysdeps/unix/sysv/linux/wordsize-64/sendfile64.c diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/sendfile64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/sendfile64.c deleted file mode 100644 index 4c451bd093..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/sendfile64.c +++ /dev/null @@ -1 +0,0 @@ -/* sendfile64 is alias of sendfile syscall. */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list deleted file mode 100644 index 0924f245d4..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list +++ /dev/null @@ -1,3 +0,0 @@ -# File name Caller Syscall name # args Strong name Weak names - -sendfile - sendfile i:iipi sendfile sendfile64 diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c b/sysdeps/unix/sysv/linux/sendfile.c similarity index 77% rename from sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c rename to sysdeps/unix/sysv/linux/sendfile.c index 4fdf979324..c8bc890944 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c +++ b/sysdeps/unix/sysv/linux/sendfile.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Transfer data between file descriptors. Linux version. + Copyright (C) 2011-2022 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 @@ -20,11 +21,16 @@ #include #include +#ifndef __OFF_T_MATCHES_OFF64_T + /* Send COUNT bytes from file associated with IN_FD starting at OFFSET to descriptor OUT_FD. */ ssize_t sendfile (int out_fd, int in_fd, off_t *offset, size_t count) { +# ifdef __NR_sendfile + return INLINE_SYSCALL_CALL (sendfile, out_fd, in_fd, offset, count); +# else __off64_t off64; int rc; @@ -38,9 +44,12 @@ sendfile (int out_fd, int in_fd, off_t *offset, size_t count) off64 = *offset; } - rc = INLINE_SYSCALL (sendfile64, 4, out_fd, in_fd, - offset ? &off64 : NULL, count); + rc = INLINE_SYSCALL_CALL (sendfile64, out_fd, in_fd, offset ? &off64 : NULL, + count); if (offset) *offset = off64; return rc; +# endif } + +#endif diff --git a/sysdeps/unix/sysv/linux/sendfile64.c b/sysdeps/unix/sysv/linux/sendfile64.c new file mode 100644 index 0000000000..d9d2a4a4c2 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sendfile64.c @@ -0,0 +1,37 @@ +/* Transfer data between file descriptors. Linux version. + Copyright (C) 2022 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 +#include + +/* Send COUNT bytes from file associated with IN_FD starting at OFFSET to + descriptor OUT_FD. */ +ssize_t +sendfile64 (int out_fd, int in_fd, off64_t *offset, size_t count) +{ +#ifndef __NR_sendfile64 +# define __NR_sendfile64 __NR_sendfile +#endif + return INLINE_SYSCALL_CALL (sendfile64, out_fd, in_fd, offset, count); +} + +#ifdef __OFF_T_MATCHES_OFF64_T +strong_alias (sendfile64, sendfile) +#endif diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index 6420049e8b..b9f45463c5 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -62,8 +62,6 @@ sched_primin - sched_get_priority_min i:i __sched_get_priority_min sched_get_pri sched_setp - sched_setparam i:ip __sched_setparam sched_setparam sched_sets - sched_setscheduler i:iip __sched_setscheduler sched_setscheduler sched_yield - sched_yield i: __sched_yield sched_yield -sendfile - sendfile i:iipU sendfile -sendfile64 - sendfile64 i:iipU sendfile64 setfsgid EXTRA setfsgid i:i setfsgid setfsuid EXTRA setfsuid i:i setfsuid setpgid - setpgid i:ii __setpgid setpgid diff --git a/sysdeps/unix/sysv/linux/wordsize-64/sendfile64.c b/sysdeps/unix/sysv/linux/wordsize-64/sendfile64.c deleted file mode 100644 index 4c451bd093..0000000000 --- a/sysdeps/unix/sysv/linux/wordsize-64/sendfile64.c +++ /dev/null @@ -1 +0,0 @@ -/* sendfile64 is alias of sendfile syscall. */ diff --git a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list index 3232f11f51..db80696e41 100644 --- a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list +++ b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list @@ -1,4 +1,3 @@ # File name Caller Syscall name # args Strong name Weak names -sendfile - sendfile i:iipi sendfile sendfile64 personality EXTRA personality i:i __personality personality From patchwork Wed Oct 19 22:14:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59101 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A6CF384D15A for ; Wed, 19 Oct 2022 22:17:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A6CF384D15A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217872; bh=6a++f50BaDDiApAfsjq1vux1DU7Ok6Q8O2u+bTD57Hc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=iyc3HFQjDwrTygt89JHd91aXfv1wsVaURqZth2DrNdAr617EBDJmcJuOrPVgTELeI P4sm2fWciJFR8Nk9CGnnGg+Ughlz6zQ2lr4/3pwe5IJk1KWBMuh4prCn1d6yC1OQc8 Hm1BLQoIEns8ubxzl85hTf+Ns3dAxFbKE0+OasWY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by sourceware.org (Postfix) with ESMTPS id DF85B3857BAD for ; Wed, 19 Oct 2022 22:14:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DF85B3857BAD Received: by mail-oi1-x230.google.com with SMTP id j188so20868277oih.4 for ; Wed, 19 Oct 2022 15:14:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6a++f50BaDDiApAfsjq1vux1DU7Ok6Q8O2u+bTD57Hc=; b=6MZHouNiv9DhQJ497AIOInwPIbIKZhVh6OeqSKI75CMMVpa20rA9BxIpIsT30Sp8jV IkZgGsthH3XwELAvy1rE0OgduKP4IWS0EnQD16zUP8uOrL2BS3WM6Mz91IafApxb5dAQ Yrreljw0g6xqzcJJVjp9MUMvboJhjwNM3kB4NnXFsSaXqBo3tMWWgSOXcZ49uEfij3YB OQ41hpEnJZ/UUS992AGdVGAC9OtBSpwuAThLPBPEXqHXKlNU7jaWpHfueM1BFL0VPBLJ g2gXxMuOZpFqN0M0NrL6zmX9bbny6Kfyt3hYOkKJ3J/S1dtcPZP4kldfud7zEJa7486K Lstw== X-Gm-Message-State: ACrzQf0wdPREXHVMPxahSaJB0oyB90RVnArfKjaqDxcrrbMibljRrWrT VI1D3ASL7P5ckWQfFJ7m0XvAheDE+kKgQnke X-Google-Smtp-Source: AMsMyM6pYI2GfBbqsHtV+WQuiIx1CZ5Eresl/JqDLc2aunPL96Ypay808ZzTW6Xm38npIpzo7m0ZbQ== X-Received: by 2002:a05:6808:1b12:b0:354:e2c8:5e70 with SMTP id bx18-20020a0568081b1200b00354e2c85e70mr18411974oib.146.1666217698981; Wed, 19 Oct 2022 15:14:58 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:58 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 16/30] Linux: Move wordsize-32 Version to default Date: Wed, 19 Oct 2022 19:14:19 -0300 Message-Id: <20221019221433.1082017-17-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" And remove redundant entries on other architectures Version. --- sysdeps/unix/sysv/linux/Versions | 3 +++ sysdeps/unix/sysv/linux/arm/Versions | 3 --- sysdeps/unix/sysv/linux/generic/wordsize-32/Versions | 5 ----- sysdeps/unix/sysv/linux/hppa/Versions | 3 --- sysdeps/unix/sysv/linux/i386/Versions | 4 ---- sysdeps/unix/sysv/linux/m68k/Versions | 3 --- sysdeps/unix/sysv/linux/microblaze/Versions | 5 ----- sysdeps/unix/sysv/linux/mips/Versions | 3 --- sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions | 3 --- sysdeps/unix/sysv/linux/s390/s390-32/Versions | 3 --- sysdeps/unix/sysv/linux/sh/Versions | 3 --- sysdeps/unix/sysv/linux/sparc/sparc32/Versions | 3 --- 12 files changed, 3 insertions(+), 38 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/Versions delete mode 100644 sysdeps/unix/sysv/linux/microblaze/Versions diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index 65d2ceda2c..59c39739c7 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -157,6 +157,9 @@ libc { GLIBC_2.10 { fallocate; } + GLIBC_2.11 { + fallocate64; + } GLIBC_2.12 { _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; diff --git a/sysdeps/unix/sysv/linux/arm/Versions b/sysdeps/unix/sysv/linux/arm/Versions index 7e5ba53455..6e7cb6e2e5 100644 --- a/sysdeps/unix/sysv/linux/arm/Versions +++ b/sysdeps/unix/sysv/linux/arm/Versions @@ -4,9 +4,6 @@ libc { inb; inw; inl; outb; outw; outl; } - GLIBC_2.11 { - fallocate64; - } GLIBC_2.24 { recvmsg; sendmsg; } diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/Versions b/sysdeps/unix/sysv/linux/generic/wordsize-32/Versions deleted file mode 100644 index cdc6022015..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/Versions +++ /dev/null @@ -1,5 +0,0 @@ -libc { - GLIBC_2.15 { - fallocate64; - } -} diff --git a/sysdeps/unix/sysv/linux/hppa/Versions b/sysdeps/unix/sysv/linux/hppa/Versions index 357c68a782..78528e5fa2 100644 --- a/sysdeps/unix/sysv/linux/hppa/Versions +++ b/sysdeps/unix/sysv/linux/hppa/Versions @@ -13,9 +13,6 @@ libc { GLIBC_2.4 { _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; } - GLIBC_2.11 { - fallocate64; - } GLIBC_2.12 { _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; } diff --git a/sysdeps/unix/sysv/linux/i386/Versions b/sysdeps/unix/sysv/linux/i386/Versions index 1335e6551b..f99a4d88d0 100644 --- a/sysdeps/unix/sysv/linux/i386/Versions +++ b/sysdeps/unix/sysv/linux/i386/Versions @@ -37,10 +37,6 @@ libc { # v* vm86; } - GLIBC_2.11 { - # f* - fallocate64; - } GLIBC_PRIVATE { __modify_ldt; __uname; } diff --git a/sysdeps/unix/sysv/linux/m68k/Versions b/sysdeps/unix/sysv/linux/m68k/Versions index d98ae120c1..a77ea60338 100644 --- a/sysdeps/unix/sysv/linux/m68k/Versions +++ b/sysdeps/unix/sysv/linux/m68k/Versions @@ -29,9 +29,6 @@ libc { # v* versionsort64; } - GLIBC_2.11 { - fallocate64; - } GLIBC_2.31 { msgctl; semctl; shmctl; } diff --git a/sysdeps/unix/sysv/linux/microblaze/Versions b/sysdeps/unix/sysv/linux/microblaze/Versions deleted file mode 100644 index aa48a3c155..0000000000 --- a/sysdeps/unix/sysv/linux/microblaze/Versions +++ /dev/null @@ -1,5 +0,0 @@ -libc { - GLIBC_2.18 { - fallocate64; - } -} diff --git a/sysdeps/unix/sysv/linux/mips/Versions b/sysdeps/unix/sysv/linux/mips/Versions index db6222e9a7..9ea0fa65a4 100644 --- a/sysdeps/unix/sysv/linux/mips/Versions +++ b/sysdeps/unix/sysv/linux/mips/Versions @@ -26,9 +26,6 @@ libc { pthread_attr_setstack; pthread_attr_setstacksize; } - GLIBC_2.11 { - fallocate64; - } GLIBC_PRIVATE { # nptl/pthread_cond_timedwait.c uses INTERNAL_VSYSCALL(clock_gettime). __vdso_clock_gettime; diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions index 918e0231d0..416e8db5ae 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions @@ -31,9 +31,6 @@ libc { siglongjmp; swapcontext; } - GLIBC_2.11 { - fallocate64; - } GLIBC_2.17 { __ppc_get_timebase_freq; } diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/Versions b/sysdeps/unix/sysv/linux/s390/s390-32/Versions index bd1a46df88..1b96fc42a3 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/Versions +++ b/sysdeps/unix/sysv/linux/s390/s390-32/Versions @@ -44,9 +44,6 @@ libc { getutmpx; login; } - GLIBC_2.11 { - fallocate64; - } GLIBC_2.31 { msgctl; semctl; shmctl; } diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions index 9c734ff755..3ad702e165 100644 --- a/sysdeps/unix/sysv/linux/sh/Versions +++ b/sysdeps/unix/sysv/linux/sh/Versions @@ -22,9 +22,6 @@ libc { # v* versionsort64; } - GLIBC_2.11 { - fallocate64; - } GLIBC_2.16 { fanotify_mark; } diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/Versions b/sysdeps/unix/sysv/linux/sparc/sparc32/Versions index d928a65346..4529e7fe6f 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/Versions +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/Versions @@ -17,7 +17,4 @@ libc { # s* scandir64; } - GLIBC_2.11 { - fallocate64; - } } From patchwork Wed Oct 19 22:14:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59111 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CF68D381FE71 for ; Wed, 19 Oct 2022 22:20:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF68D381FE71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666218015; bh=LRy1yKoZdLUCC582zJmV6S1x+mAsSfAjKMsJFa5+9vE=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ZVjgc0ZeoKM5i08qDVmk/qsQKAWs8FtVTPzMNiUxuMQr35ucyIy9k9yV5jwmP3Avh xvx7APfZDJNnyMY49hiX71QEjQE5Mj7lqggWhG8uPUL+F+IvyTJmT1GqkF92R12etp zsjFoWhUU7d+GHycIabFJPZPfvuv0QrrfNmSm8SM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by sourceware.org (Postfix) with ESMTPS id AE25A3857B88 for ; Wed, 19 Oct 2022 22:15:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AE25A3857B88 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-1321a1e94b3so22422622fac.1 for ; Wed, 19 Oct 2022 15:15:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LRy1yKoZdLUCC582zJmV6S1x+mAsSfAjKMsJFa5+9vE=; b=KUCxvx81kFQnmMqpir0AN95BThrt2g4Z7QR7Kw6rmiLC2f66oR2QNqsrTlI/TpFkOw hflbk6mJ4wMvWHU0/hSC2B+oNwQff/tmBeGVuZO1LB+sC54ZS51vLcYOV9KSgFBWlw2d NoWF7m9MAii5S7gphsFAY4K49LY2xi6h93FYn9wl3JuzZOpTy7EZzQF8R76gO8/rEMOt fiEpJqOpHpcSIATxlZRsNukawJXr77XvckW9ONOoIlosu1ZJj19fxW6GN7sXt5cYKxbF kAWOZkiFdaemkrLx9RcqLJb/t2ywCa+CR9CcKQWk87gLwPyJ4c3rI77/0lBKKXJ9CPyQ FRmA== X-Gm-Message-State: ACrzQf2O6arzK7CVDkwMOL3oUjrUM5cMaju959fdMFSd9bIhN466CyV7 P1UH25Q8otZ2NcebfCs7X0zi27sqmcIdZQCZ X-Google-Smtp-Source: AMsMyM4LbaLMVnGLu6pRoNqN94mUvex9Vd/Cm5JWHx1u42NWkk/Wrr9TX7Q6qEjKsLGc6S9d6uPVPA== X-Received: by 2002:a05:6870:e2cf:b0:132:9fa0:fc28 with SMTP id w15-20020a056870e2cf00b001329fa0fc28mr22145928oad.170.1666217700245; Wed, 19 Oct 2022 15:15:00 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:59 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 17/30] Linux: consolidate ____longjmp_chk Date: Wed, 19 Oct 2022 19:14:20 -0300 Message-Id: <20221019221433.1082017-18-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => }/____longjmp_chk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/____longjmp_chk.c (90%) diff --git a/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c b/sysdeps/unix/sysv/linux/____longjmp_chk.c similarity index 90% rename from sysdeps/unix/sysv/linux/generic/____longjmp_chk.c rename to sysdeps/unix/sysv/linux/____longjmp_chk.c index aac1158853..687cb27133 100644 --- a/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c +++ b/sysdeps/unix/sysv/linux/____longjmp_chk.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* longjmp fortify implementation. Linux version. + Copyright (C) 2011-2022 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 @@ -28,8 +29,7 @@ #define called_from(this, saved) ((this) > (saved)) #endif -extern void ____longjmp_chk (__jmp_buf __env, int __val) - __attribute__ ((__noreturn__)); +_Noreturn extern void ____longjmp_chk (__jmp_buf __env, int __val); void ____longjmp_chk (__jmp_buf env, int val) { From patchwork Wed Oct 19 22:14:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59115 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0E2D5385021A for ; Wed, 19 Oct 2022 22:21:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E2D5385021A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666218061; bh=RvPE/qt5/EN2FK/2RjJrI4pr4fJ427jEvj0xvVqrm8Q=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=MeXNTBYNcjgrvkTnd9i6ugEMIfTUn1/fj5GaBDQHOaUG2ZrNDFN6b6j7g8M35V+E+ Yc5pZusCUEHtHSQzFqnShTRzPgCbsgAABzHk3H9Qpq5U6c/G2RW0PypIt5gGwMmerN sWJULOw+QdwPcLgRrYFmeDE5yOiAbjOKVrQfqxgU= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by sourceware.org (Postfix) with ESMTPS id DF76D385742E for ; Wed, 19 Oct 2022 22:15:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DF76D385742E Received: by mail-oi1-x22d.google.com with SMTP id y72so20885849oia.3 for ; Wed, 19 Oct 2022 15:15:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RvPE/qt5/EN2FK/2RjJrI4pr4fJ427jEvj0xvVqrm8Q=; b=1jFqcHHTsGjqjT1XwPL6WJDpMoYvYZ/BX5mqUeApE9tS137g7G4b3jI7efgX70r8xk dNRexC2Sw7KZ/XEGeFfrNCNC5woicxEV/1m+UxnybGstHlvZpgxNpln9IT1Y/XKARDMK H7T0KO6oWMw+L8FgjgotITpzibgu29x4v/HJdOLaw820aBbYm1mEqvmuXUUvSOLJvNeJ xUXG3OGGhiPS30ZAZqmktnXccGxhZDXBj7s7NoOyh+jsGK6erkNzk3bJ1mB6wZvnoh9R dTrYeBB3Nk3MewOnfUUZi3UlcW86oMzgURf7w9be2ffSwsqVraaaZ+knEGN0WT1rATa5 WO6g== X-Gm-Message-State: ACrzQf2aCvQIf+9XzZJtGL/rbx9n/o0D0uZ3gw3OvMgr1B+3Gss39PSq vdr1UuQkJGLKTACklyMNDEALiPtDPMcx89SW X-Google-Smtp-Source: AMsMyM44ImceBKfg1246eHScTEyx6tsZQfz+4k7yZ1xl0unhR4WTPJDUwT50NdHQVrWxk6jzMDnEvw== X-Received: by 2002:a05:6808:219a:b0:354:daec:53cb with SMTP id be26-20020a056808219a00b00354daec53cbmr5360996oib.2.1666217701344; Wed, 19 Oct 2022 15:15:01 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.15.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:15:01 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 18/30] Linux: Assume and consolidate bind wire-up syscall Date: Wed, 19 Oct 2022 19:14:21 -0300 Message-Id: <20221019221433.1082017-19-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" And disable if kernel does not support it. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/bind.c | 7 +------ sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - 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 - sysdeps/unix/sysv/linux/sparc/kernel-features.h | 5 ++++- 10 files changed, 9 insertions(+), 14 deletions(-) diff --git a/sysdeps/unix/sysv/linux/bind.c b/sysdeps/unix/sysv/linux/bind.c index 83992a5dbd..97a42c497f 100644 --- a/sysdeps/unix/sysv/linux/bind.c +++ b/sysdeps/unix/sysv/linux/bind.c @@ -15,19 +15,14 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include - #include -#include -#include int __bind (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) { #ifdef __ASSUME_BIND_SYSCALL - return INLINE_SYSCALL (bind, 3, fd, addr.__sockaddr__, len); + return INLINE_SYSCALL_CALL (bind, fd, addr.__sockaddr__, len); #else return SOCKETCALL (bind, fd, addr.__sockaddr__, len, 0, 0, 0); #endif diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index f573f27c8b..889b62bbea 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -3,7 +3,6 @@ # Socket APIs socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair -bind - bind i:ipi __bind bind listen - listen i:ii __listen listen getsockname - getsockname i:ipp __getsockname getsockname getpeername - getpeername i:ipp __getpeername getpeername diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index 87d610cd66..babb0ff83d 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_BIND_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_GETPEERNAME_SYSCALL 1 @@ -41,6 +40,7 @@ # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL +# undef __ASSUME_BIND_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 74adc3956b..3dc93f5b11 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -79,6 +79,7 @@ #define __ASSUME_SENDMMSG_SYSCALL 1 #define __ASSUME_GETSOCKOPT_SYSCALL 1 #define __ASSUME_SETSOCKOPT_SYSCALL 1 +#define __ASSUME_BIND_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 d807ac9cfd..37209378b9 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_BIND_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_GETPEERNAME_SYSCALL 1 @@ -43,6 +42,7 @@ # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL +# undef __ASSUME_BIND_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 8ae3cdcd96..7fff6dd902 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_SOCKET_SYSCALL 1 -#define __ASSUME_BIND_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index 894f29d381..af4555bb1d 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_SOCKET_SYSCALL 1 -#define __ASSUME_BIND_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index a457c84ba1..ae8dc626b2 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_BIND_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_GETPEERNAME_SYSCALL 1 @@ -43,6 +42,7 @@ # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL +# undef __ASSUME_BIND_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 545bef40fd..2883da92b2 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_SOCKET_SYSCALL 1 -#define __ASSUME_BIND_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index 6cbe189b2f..2b7056c0fb 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -48,10 +48,13 @@ /* These syscalls were added for both 32-bit and 64-bit in 4.4. */ #if __LINUX_KERNEL_VERSION >= 0x040400 -# define __ASSUME_BIND_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 #endif +#if __LINUX_KERNEL_VERSION < 0x040400 +# undef __ASSUME_BIND_SYSCALL +#endif + #ifdef __arch64__ /* sparc64 defines __NR_pause, however it is not supported (ENOSYS). Undefine so pause.c can use a correct alternative. */ From patchwork Wed Oct 19 22:14:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59105 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 95B77383FB97 for ; Wed, 19 Oct 2022 22:19:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95B77383FB97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217956; bh=aDPUwZPD7toZaA/nrOQHhGvgrUa7P2ET0hHAWia4Xxs=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=gaWmNzqG/Ce2X+PPmtdjyzbfmj25LipdoloRPcgsRlQVVTUEKGpYhaXKqBkI1fbz8 igy05elJQcgVXBp0zqF4jNU2bYnM1NZJLclchUSiLos19Y63wpkpILERp8NgGqjNC3 insrQsiSzuCAZClKYKE04fdTXxY+UfEZKOeIkYRY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 0FF353857B87 for ; Wed, 19 Oct 2022 22:15:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0FF353857B87 Received: by mail-oi1-x231.google.com with SMTP id u15so20879679oie.2 for ; Wed, 19 Oct 2022 15:15:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aDPUwZPD7toZaA/nrOQHhGvgrUa7P2ET0hHAWia4Xxs=; b=GU0MyqT9kO42MmCcxv4mMGal5pl/TpLhES06utJueil41csGMevUYGCgtEJ4JtkwTR rWc/TFR7r2PEh87urBuNQvjdRmoZUVW1gG/P0x/gDdL7xuFCgQiLtQuUZKllQDQ2O0EQ mLxM8HAf2Ut+Z0/HFLZkZY38RmXvV2wzugkiZ2amBn0JWFkE5yM32fmwyQfq2OACg2rU 5MpR78cwQ/QDRblc3yvjwxJzHH3w6H9oSkZ0RYwQyHZg0swoD5GXEmMfoPJdng4zPvMt qB9LHB/B4cRqprgUu7nuC8gijE1qaP8TSDSbXpcCi1gL//rmgpf9HiPofDLg6DnhhF7Q EoOw== X-Gm-Message-State: ACrzQf03DzPl2f/VI/9ar/H9Ellw34nEeFs9FrxOJ3FUWfS/CIbtDyom 5HwkgbfEoyHxnS+3qHYG3rn3QRGvUhFWeiT7 X-Google-Smtp-Source: AMsMyM4y/wXgjtIVsk6fy3PZ+XQmGBUAiRUT8Q3f+kigbJg2G9Tx8TFVWaC084RaH3lnimH949msJQ== X-Received: by 2002:aca:b4c1:0:b0:354:84e1:f8fd with SMTP id d184-20020acab4c1000000b0035484e1f8fdmr5122688oif.191.1666217702510; Wed, 19 Oct 2022 15:15:02 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.15.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:15:02 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 19/30] Linux: Assume iand consolidate socket wire-up syscall Date: Wed, 19 Oct 2022 19:14:22 -0300 Message-Id: <20221019221433.1082017-20-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" And disable if kernel does not support it. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - 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 - sysdeps/unix/sysv/linux/socket.c | 7 +------ sysdeps/unix/sysv/linux/sparc/kernel-features.h | 1 - 10 files changed, 5 insertions(+), 14 deletions(-) diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index 889b62bbea..e5a62811a5 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # Socket APIs -socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair listen - listen i:ii __listen listen getsockname - getsockname i:ipp __getsockname getsockname diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index babb0ff83d..4c2f1eb8f5 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_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 @@ -41,6 +40,7 @@ # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL # undef __ASSUME_BIND_SYSCALL +# undef __ASSUME_SOCKET_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 3dc93f5b11..a42b70c85b 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -80,6 +80,7 @@ #define __ASSUME_GETSOCKOPT_SYSCALL 1 #define __ASSUME_SETSOCKOPT_SYSCALL 1 #define __ASSUME_BIND_SYSCALL 1 +#define __ASSUME_SOCKET_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 37209378b9..38ffbdbaed 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_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 @@ -43,6 +42,7 @@ # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL # undef __ASSUME_BIND_SYSCALL +# undef __ASSUME_SOCKET_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 7fff6dd902..389dd146b4 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -18,7 +18,6 @@ #include /* All supported kernel versions for MicroBlaze have these syscalls. */ -#define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index af4555bb1d..9ee1dc2bc7 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -18,7 +18,6 @@ . */ /* New syscalls added for PowerPC in 2.6.37. */ -#define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index ae8dc626b2..d5991b265b 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_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 @@ -43,6 +42,7 @@ # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL # undef __ASSUME_BIND_SYSCALL +# undef __ASSUME_SOCKET_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 2883da92b2..3b57eb7f27 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -23,7 +23,6 @@ #include /* These syscalls were added for SH in 2.6.37. */ -#define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/socket.c b/sysdeps/unix/sysv/linux/socket.c index 0fc7a61d06..0258fff872 100644 --- a/sysdeps/unix/sysv/linux/socket.c +++ b/sysdeps/unix/sysv/linux/socket.c @@ -15,19 +15,14 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include - #include -#include -#include int __socket (int fd, int type, int domain) { #ifdef __ASSUME_SOCKET_SYSCALL - return INLINE_SYSCALL (socket, 3, fd, type, domain); + return INLINE_SYSCALL_CALL (socket, fd, type, domain); #else return SOCKETCALL (socket, fd, type, domain); #endif diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index 2b7056c0fb..f3a5ef6a99 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -41,7 +41,6 @@ # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL #else -# define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif From patchwork Wed Oct 19 22:14:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59100 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9075D3851142 for ; Wed, 19 Oct 2022 22:17:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9075D3851142 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217869; bh=Wr3IOwjqshr6+9ebSW0++ylbUGglhsnyiJqhNUvmrJc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=EbGrsVzE2QFgDcU9DVPonajPkGK2Q76lUKo/CxdeQCjlV9I1G9sfiJAbx9r1Kzy0E jnlvnV2oU0MYQChWQMjRNr7AlAoSJ4J7SoiOmdnoD3Yma6f+4JBiCuTQfZLoKyY09a UlSSbqza/X/onWtAADX2T5VOmq0O4JyWyiPfKmwc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by sourceware.org (Postfix) with ESMTPS id DDAAD3857001 for ; Wed, 19 Oct 2022 22:15:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DDAAD3857001 Received: by mail-oi1-x233.google.com with SMTP id m81so20876852oia.1 for ; Wed, 19 Oct 2022 15:15:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wr3IOwjqshr6+9ebSW0++ylbUGglhsnyiJqhNUvmrJc=; b=az21jxmrs8m6cvKSxwapYxKlH+zJTR8nI0P2ajrB79rmDZsKjbbYo74QI8/iKvwCYP 9SsTszy1LiTk13sn5xZZ4f0aPLQ1a/cypkR7YvmMOtcMr1oRz0L+dzpSFkNWgyqjGY8D 5lCRHxdZs1PKjj5hI2H2HDfS0TOkExg3f7o9Io25gAmdvi4Do3PeoK70cBKZlahdEc8i VjqRsP5Gl/7JL/oyxTjOhUHwZHzr2MtuE4f7adDEQHTysv4EwahXJKkmubP3wi6ZDiDq fZhjGCCJCXndKnEGl8m4hcuMUmEXAJX+wreF/KjWFf8Zw3CORV/VrfMbjj95uyOH66TT sTsw== X-Gm-Message-State: ACrzQf2ij7rxJ3yx2lFvoACJ/TIr7UiRd3VOle1Bhh2KR+WtFZBH8lUE 9wXiIgus+OXIRzr7JGtHPXB9qWdr4KMHJpRA X-Google-Smtp-Source: AMsMyM5Wl9B+e1hPHDASbbWBC7Z/HGenjTtlU2AXFxZkjq9QApTNMFCIrMuOPpJflh35cXAELgM1Yg== X-Received: by 2002:a05:6808:1388:b0:355:4f9a:7893 with SMTP id c8-20020a056808138800b003554f9a7893mr5533403oiw.99.1666217703682; Wed, 19 Oct 2022 15:15:03 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.15.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:15:03 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 20/30] Linux: Assume and consolidate socketpair wire-up syscall Date: Wed, 19 Oct 2022 19:14:23 -0300 Message-Id: <20221019221433.1082017-21-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" And disable if kernel does not support it. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - 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 - sysdeps/unix/sysv/linux/socketpair.c | 7 +------ sysdeps/unix/sysv/linux/sparc/kernel-features.h | 1 - 10 files changed, 5 insertions(+), 14 deletions(-) diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index e5a62811a5..95ed2cbac8 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # Socket APIs -socketpair - socketpair i:iiif __socketpair socketpair listen - listen i:ii __listen listen getsockname - getsockname i:ipp __getsockname getsockname getpeername - getpeername i:ipp __getpeername getpeername diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index 4c2f1eb8f5..8a7fe47602 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_SOCKETPAIR_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_GETPEERNAME_SYSCALL 1 @@ -41,6 +40,7 @@ # undef __ASSUME_SETSOCKOPT_SYSCALL # undef __ASSUME_BIND_SYSCALL # undef __ASSUME_SOCKET_SYSCALL +# undef __ASSUME_SOCKETPAIR_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 a42b70c85b..fd44b39cf4 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -81,6 +81,7 @@ #define __ASSUME_SETSOCKOPT_SYSCALL 1 #define __ASSUME_BIND_SYSCALL 1 #define __ASSUME_SOCKET_SYSCALL 1 +#define __ASSUME_SOCKETPAIR_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 38ffbdbaed..46b3045b56 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_SOCKETPAIR_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_GETPEERNAME_SYSCALL 1 @@ -43,6 +42,7 @@ # undef __ASSUME_SETSOCKOPT_SYSCALL # undef __ASSUME_BIND_SYSCALL # undef __ASSUME_SOCKET_SYSCALL +# undef __ASSUME_SOCKETPAIR_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 389dd146b4..198ff3209d 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -22,7 +22,6 @@ #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 #define __ASSUME_GETPEERNAME_SYSCALL 1 -#define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index 9ee1dc2bc7..72ec2df178 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -22,7 +22,6 @@ #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 #define __ASSUME_GETPEERNAME_SYSCALL 1 -#define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index d5991b265b..01fc98e9ab 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_SOCKETPAIR_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_GETPEERNAME_SYSCALL 1 @@ -43,6 +42,7 @@ # undef __ASSUME_SETSOCKOPT_SYSCALL # undef __ASSUME_BIND_SYSCALL # undef __ASSUME_SOCKET_SYSCALL +# undef __ASSUME_SOCKETPAIR_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 3b57eb7f27..b18314a9cd 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -27,7 +27,6 @@ #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 #define __ASSUME_GETPEERNAME_SYSCALL 1 -#define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/socketpair.c b/sysdeps/unix/sysv/linux/socketpair.c index d06cbbc2c9..65f8cb46dc 100644 --- a/sysdeps/unix/sysv/linux/socketpair.c +++ b/sysdeps/unix/sysv/linux/socketpair.c @@ -15,19 +15,14 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include - #include -#include -#include int __socketpair (int domain, int type, int protocol, int sv[2]) { #ifdef __ASSUME_SOCKETPAIR_SYSCALL - return INLINE_SYSCALL (socketpair, 4, domain, type, protocol, &sv[0]); + return INLINE_SYSCALL_CALL (socketpair, domain, type, protocol, &sv[0]); #else return SOCKETCALL (socketpair, domain, type, protocol, sv); #endif diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index f3a5ef6a99..f43e5c384f 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -41,7 +41,6 @@ # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL #else -# define __ASSUME_SOCKETPAIR_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif From patchwork Wed Oct 19 22:14:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59109 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D63CE38207D3 for ; Wed, 19 Oct 2022 22:20:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D63CE38207D3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666218006; bh=LjUx9kKYhzP1bXBHsc9qYBBAjXOC11vl8FWm2yLklTE=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=wmfbRA04k2yA8r9y9crXCJCvWCcURo2PgohXLqyuicVdGVHbt2Q8Sf5PDmWFllpmT OqUkwHhmvsAym251AokwE7LWajtEtjUSq0iwm+vjqpt3s7RFRqZ/ptufEgTn4GZA0j K4m/VYTF1B5TN2SM5/np0qmxWejB9SyuWVMI85VA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by sourceware.org (Postfix) with ESMTPS id 3ED89385700A for ; Wed, 19 Oct 2022 22:15:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3ED89385700A Received: by mail-oi1-x22d.google.com with SMTP id n83so20839672oif.11 for ; Wed, 19 Oct 2022 15:15:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LjUx9kKYhzP1bXBHsc9qYBBAjXOC11vl8FWm2yLklTE=; b=5pKORTlwvF1O4X9IyMuxoRZ3CDrlqIHsBVTGMAbr1rVHNizJ2aOlXxeyKsn6pHStzk PIK+BiYkETE+Ss3IGYouUzaYjQ0cK5vdSZLJASxXBEtmkKoEZAc+JomyZ4snZ53nZfzZ LufeQDBJjnjBZjvsLwT1SnxdkALU5dFmAIGYrDDhmN702VALP2Kbodar6pH1UyA+ajyD EbTKIgy8XlW+GIXuzDplh93q7Z98l733hP5AFvPEhToQ9wnlubIHA5rMXDjAfi7gC+c5 gZ5M1J/K9ArnPTY2IxdB3sOoYEhUZyVS+xMcrFpkf2E4IoZH/vrQQ1Syw63UMUldelg2 N1bA== X-Gm-Message-State: ACrzQf1wRmxKGjOfnxEzz2phEvEK2bexikc4Hksd6GvNVV9op3a32s7o bHP7pb/TAjlq2hRAVb+00kjPTLTY5IvY2aNR X-Google-Smtp-Source: AMsMyM6ZkrTYopmzS68NDHPpJw5V7nKuqFwOQwh48mmNBMbkiqPF9k33JDjT5HDF3WW+7/z+u9kVPg== X-Received: by 2002:a05:6808:1706:b0:351:6d17:51e0 with SMTP id bc6-20020a056808170600b003516d1751e0mr5492238oib.114.1666217704906; Wed, 19 Oct 2022 15:15:04 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.15.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:15:04 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 21/30] Linux: Assume and consolidate listen wire-up syscall Date: Wed, 19 Oct 2022 19:14:24 -0300 Message-Id: <20221019221433.1082017-22-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" And disable if kernel does not support it. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/i386/kernel-features.h | 2 +- sysdeps/unix/sysv/linux/kernel-features.h | 1 + sysdeps/unix/sysv/linux/listen.c | 7 +------ 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 - sysdeps/unix/sysv/linux/sparc/kernel-features.h | 5 +---- 10 files changed, 6 insertions(+), 17 deletions(-) diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index 95ed2cbac8..706893f245 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # Socket APIs -listen - listen i:ii __listen listen getsockname - getsockname i:ipp __getsockname getsockname getpeername - getpeername i:ipp __getpeername getpeername shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index 8a7fe47602..a79ec679cc 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_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_GETPEERNAME_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 @@ -41,6 +40,7 @@ # undef __ASSUME_BIND_SYSCALL # undef __ASSUME_SOCKET_SYSCALL # undef __ASSUME_SOCKETPAIR_SYSCALL +# undef __ASSUME_LISTEN_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 fd44b39cf4..d1769b2d99 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -82,6 +82,7 @@ #define __ASSUME_BIND_SYSCALL 1 #define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_SOCKETPAIR_SYSCALL 1 +#define __ASSUME_LISTEN_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/listen.c b/sysdeps/unix/sysv/linux/listen.c index 8d7ff85edf..e563e4df6c 100644 --- a/sysdeps/unix/sysv/linux/listen.c +++ b/sysdeps/unix/sysv/linux/listen.c @@ -15,19 +15,14 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include - #include -#include -#include int listen (int fd, int backlog) { #ifdef __ASSUME_LISTEN_SYSCALL - return INLINE_SYSCALL (listen, 2, fd, backlog); + return INLINE_SYSCALL_CALL (listen, fd, backlog); #else return SOCKETCALL (listen, fd, backlog); #endif diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h index 46b3045b56..a65fa63c5e 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_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_GETPEERNAME_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 @@ -43,6 +42,7 @@ # undef __ASSUME_BIND_SYSCALL # undef __ASSUME_SOCKET_SYSCALL # undef __ASSUME_SOCKETPAIR_SYSCALL +# undef __ASSUME_LISTEN_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 198ff3209d..e19e6bb6ba 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_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 #define __ASSUME_GETPEERNAME_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index 72ec2df178..eb73a91a5d 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_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 #define __ASSUME_GETPEERNAME_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index 01fc98e9ab..3daee3f132 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_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_GETPEERNAME_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 @@ -43,6 +42,7 @@ # undef __ASSUME_BIND_SYSCALL # undef __ASSUME_SOCKET_SYSCALL # undef __ASSUME_SOCKETPAIR_SYSCALL +# undef __ASSUME_LISTEN_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 b18314a9cd..23eadf84e0 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_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 #define __ASSUME_GETPEERNAME_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index f43e5c384f..7070aaa1ae 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -45,12 +45,9 @@ #endif /* These syscalls were added for both 32-bit and 64-bit in 4.4. */ -#if __LINUX_KERNEL_VERSION >= 0x040400 -# define __ASSUME_LISTEN_SYSCALL 1 -#endif - #if __LINUX_KERNEL_VERSION < 0x040400 # undef __ASSUME_BIND_SYSCALL +# undef __ASSUME_LISTEN_SYSCALL #endif #ifdef __arch64__ From patchwork Wed Oct 19 22:14:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59106 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 577A83851C25 for ; Wed, 19 Oct 2022 22:19:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 577A83851C25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217965; bh=tOv5hqWe/xVQGycKxlYvoQVeJTuArkl4siJ4l66pM24=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=MJHf4ZzYeNkYjdY9voEZypJADy0TictNSiNJSvs7wOPcdPPotWHoYCIs1N7GmR2wy k1L8URqd3izPEyBkKksRxayq1PmyDkiV5U4pj0nd7xrVXWZwhdIOExVPXIIJIi7Z+1 wwlEsTdzfpHsBDJil7N9cJeB1DWnlSnYH4ZOHBlM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) by sourceware.org (Postfix) with ESMTPS id AE57C3858289 for ; Wed, 19 Oct 2022 22:15:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AE57C3858289 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-136b5dd6655so22411127fac.3 for ; Wed, 19 Oct 2022 15:15:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tOv5hqWe/xVQGycKxlYvoQVeJTuArkl4siJ4l66pM24=; b=RNtSXn1HKt47xq7NcwDNWsiBV7rgFEYShrunB0tF/HiyPiLnyB+T0gTcisFa2pHr/7 v4OpRSBkAPjNZp1z1ObC3VLXY6DMSsG9QntSvhaL8GEnr1RaZ/AH8XKbAX8S6+jVnC8Z pKMfcrSN2MGuhctOeXYNnjl6AQezwDu4lKTUH8OANTzKj+qjgUCRHXTSwX4g+GDSDRli OeIkMnF1qVtado7Tt8G3E8PwlecNn/nd7gzudELIWIK9dsL3+Pq3hP1w8a2vMCO5Btbr FpS8hWYMkdAucYjycgEAW4lszBD4pBXqDhFQmrezFFZpTCPIJqTlFWRmqSSHJ6TIsDxG kWrg== X-Gm-Message-State: ACrzQf2yoeaPEvTvrQS+mNq418PupSrvDbZqzQhRksgMFhCJaBb07fhP VLqi2BbLQC8tAzFrloG3Y8HLDs/5hyhVyYn9 X-Google-Smtp-Source: AMsMyM7Q1d4kV4N0tsPeeuWI91/VXVjT7DvySeJ6pLOmTlE9siru6nX84zc7CNK1+UbGpvytR3r+4w== X-Received: by 2002:a05:6870:42d1:b0:136:3b49:cc26 with SMTP id z17-20020a05687042d100b001363b49cc26mr6489820oah.238.1666217706050; Wed, 19 Oct 2022 15:15:06 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.15.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:15:05 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 22/30] Linux: Assume and consolidate getsockname wire-up syscall Date: Wed, 19 Oct 2022 19:14:25 -0300 Message-Id: <20221019221433.1082017-23-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" And disable if kernel does not support it. Checked on x86_64-linux-gnu and i686-linux-gnu. 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 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); #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 From patchwork Wed Oct 19 22:14:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59113 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 24A32380DBEB for ; Wed, 19 Oct 2022 22:20:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24A32380DBEB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666218050; bh=buqKb1nI+SQAhKHFgSqUgVUG+h8p+YMj+f8OSbsfnTk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=k7adbNd7H2dolGogSbpR8zHUAfE6a0S0Wxitv8SmRrlsVSip7WdFxLb2l1Bqlk3P/ sLkBqQNism1iUG5zAbnfDmLI/D9LFUnUQzt1qk6EuC/XhY7f4ymxvobvICmx6tkiBg tymYzGGKT5VGpkFo1cv+VdiYOPNHywrAf9GAu2oU= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by sourceware.org (Postfix) with ESMTPS id 491963857414 for ; Wed, 19 Oct 2022 22:15:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 491963857414 Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-1324e7a1284so22393672fac.10 for ; Wed, 19 Oct 2022 15:15:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=buqKb1nI+SQAhKHFgSqUgVUG+h8p+YMj+f8OSbsfnTk=; b=Aa353dAFFYHXUzhBq0GtWcSkX3w1yx6wnV3lnMnF+t1kpsgmu7t+LqPfh9H8cTDDp1 sfPjgQMc1fl0cl2sSguwwJw74HaC86XzmGPlKGykKpYScS4bV2YUrNBtENTtbqaGE6t2 wfFKwwx008zL7WgAHykAJDffEVzB6f3t9aWBpHVXRmbZ5awLynKN1e6erPiSHn2Kk9EZ LmmuJ7vRQl5zf0+rrKTjnw36gHp8Bg7uu3kAR1aNUyqbL6YcGLBLp6WnJd07D1fAJ1sG LFrLRHn7vOI7AtFx3gBmWV/jMjx5sC5QkYtZd+wkmm3ZJE8s2kwo5+asmUJupH68ijP5 HKaA== X-Gm-Message-State: ACrzQf15Gp8EUyP0EuaXWrKWtVOulTpNNhc5JYo/8XUkF2KsVaoA2mF5 P0G5ms9G7wwVhtujHiDDCxGWygts172b/hER X-Google-Smtp-Source: AMsMyM7h7lfMESIOxLheAvBdGT+05364vdLsZeAajdhQykCscvDUFsMVMvCydkWvEw2cGft46chnAQ== X-Received: by 2002:a05:6870:b68c:b0:132:b864:2aa2 with SMTP id cy12-20020a056870b68c00b00132b8642aa2mr23053080oab.130.1666217707347; Wed, 19 Oct 2022 15:15:07 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.15.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:15:07 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 23/30] Linux: Assume and consolidate getpeername wire-up syscall Date: Wed, 19 Oct 2022 19:14:26 -0300 Message-Id: <20221019221433.1082017-24-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" And disable if kernel does not support it. Checked on x86_64-linux-gnu and i686-linux-gnu. Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/getpeername.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 a5bb00a3e4..b000ca3c7c 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -1,5 +1,4 @@ # File name Caller Syscall name # args Strong name Weak names # Socket APIs -getpeername - getpeername i:ipp __getpeername getpeername shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/getpeername.c b/sysdeps/unix/sysv/linux/getpeername.c index 09ca76b9ad..63fa8e2fe5 100644 --- a/sysdeps/unix/sysv/linux/getpeername.c +++ b/sysdeps/unix/sysv/linux/getpeername.c @@ -15,19 +15,14 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include - #include -#include -#include int __getpeername (int fd, __SOCKADDR_ARG addr, socklen_t *len) { #ifdef __ASSUME_GETPEERNAME_SYSCALL - return INLINE_SYSCALL (getpeername, 3, fd, addr.__sockaddr__, len); + return INLINE_SYSCALL_CALL (getpeername, fd, addr.__sockaddr__, len); #else return SOCKETCALL (getpeername, 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 f294380215..423edc9017 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_GETPEERNAME_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -41,6 +40,7 @@ # undef __ASSUME_SOCKETPAIR_SYSCALL # undef __ASSUME_LISTEN_SYSCALL # undef __ASSUME_GETSOCKNAME_SYSCALL +# undef __ASSUME_GETPEERNAME_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 6fb99f5c35..c751530cd3 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -84,6 +84,7 @@ #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 +#define __ASSUME_GETPEERNAME_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 898c24ba62..a7b3458a21 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_GETPEERNAME_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -43,6 +42,7 @@ # undef __ASSUME_SOCKETPAIR_SYSCALL # undef __ASSUME_LISTEN_SYSCALL # undef __ASSUME_GETSOCKNAME_SYSCALL +# undef __ASSUME_GETPEERNAME_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 7e2b15859e..328529434d 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_GETPEERNAME_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index 8953cb019f..7fae7ca429 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_GETPEERNAME_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index 1422ee620c..e797b71052 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_GETPEERNAME_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -43,6 +42,7 @@ # undef __ASSUME_SOCKETPAIR_SYSCALL # undef __ASSUME_LISTEN_SYSCALL # undef __ASSUME_GETSOCKNAME_SYSCALL +# undef __ASSUME_GETPEERNAME_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 91dc28f33f..3a0b4e6198 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_GETPEERNAME_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 From patchwork Wed Oct 19 22:14:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59110 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A559F381FE76 for ; Wed, 19 Oct 2022 22:20:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A559F381FE76 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666218013; bh=9aBdtdO8KMlrVVleRdicKQXMKw11XV483Q0zAZEHph8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=jBIkFjkreCiadoUpvISM9o+cdeQhMKrTAMpImm/+EYfRZ7mpe5AgEmJaMqmolAK5O 0R7MPPaIyz94Ipql+uWwRwQatPTSko9TkZkobuqninfrsSefID1TTTkhVYcUridR7E uRKICRPyIH0eYoNiIFh4OHrVS5WjV12fkIF8Ot40= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by sourceware.org (Postfix) with ESMTPS id 729D2385801A for ; Wed, 19 Oct 2022 22:15:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 729D2385801A Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-132fb4fd495so22371139fac.12 for ; Wed, 19 Oct 2022 15:15:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9aBdtdO8KMlrVVleRdicKQXMKw11XV483Q0zAZEHph8=; b=mxTDTSLhhHTh5X6Jcw5FraJL1pF0IYuwEZeBuqNE4pbvUmJ/Lc3a81WaD0dD3sbPeJ /oOTQXAZJQV5CSN/78xRxqLx5NHLq8eyiee0gQnmQEkdb14L4VdVsu1h2ocftaNce85f Gtt5a4qv564YL9zYsDjlqmwNUDB/DVoUv/KDYoc9/2f/4hLwihHiIyPgT8hOEQ8uK5cM R8ZVFNYVUlit/IUr2RF7kfB93vCxzQdjPM5GWHbKLW0PKx86rUbWRBtFPKrBWFEq4aB8 y2zGTY7BoYYuymRsYZOQFzzXs+P7xLF/IdEAbnmRNV1YkRxd9GupKcVHKko+QTpD+HAk eZtw== X-Gm-Message-State: ACrzQf2wUhjHhYf3ch3/c2AH7dtMDzkTPUlZmvVXenO7EOMKXg/xqaCV KOso9lhZYSVg8a88qs99TuoQCHhBkYFw4qnS X-Google-Smtp-Source: AMsMyM7kMaAXndvw88VKtMaZBn+5yinTepSr/o/OBUwACQF9ry4MVpzbcVgnMzXVxkyinijFtY/1Aw== X-Received: by 2002:a05:6870:4284:b0:101:202e:a78d with SMTP id y4-20020a056870428400b00101202ea78dmr23454140oah.37.1666217708547; Wed, 19 Oct 2022 15:15:08 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.15.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:15:08 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 24/30] Linux: Assume and consolidate shutdown wire-up syscall Date: Wed, 19 Oct 2022 19:14:27 -0300 Message-Id: <20221019221433.1082017-25-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" And disable if kernel does not support it. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/generic/syscalls.list | 4 ---- sysdeps/unix/sysv/linux/i386/kernel-features.h | 7 ++----- sysdeps/unix/sysv/linux/kernel-features.h | 1 + sysdeps/unix/sysv/linux/m68k/kernel-features.h | 7 ++----- 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 | 7 ++----- sysdeps/unix/sysv/linux/sh/kernel-features.h | 1 - sysdeps/unix/sysv/linux/shutdown.c | 7 +------ sysdeps/unix/sysv/linux/sparc/kernel-features.h | 2 -- 10 files changed, 8 insertions(+), 30 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/generic/syscalls.list diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list deleted file mode 100644 index b000ca3c7c..0000000000 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ /dev/null @@ -1,4 +0,0 @@ -# File name Caller Syscall name # args Strong name Weak names - -# Socket APIs -shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index 423edc9017..e726fc657a 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -17,15 +17,11 @@ License along with the GNU C Library; if not, see . */ -/* Direct socketcalls available with kernel 4.3. */ -#if __LINUX_KERNEL_VERSION >= 0x040300 -# define __ASSUME_SHUTDOWN_SYSCALL 1 -#endif - #include_next #undef __ASSUME_ACCEPT_SYSCALL +/* Direct socketcalls available with kernel 4.3. */ #if __LINUX_KERNEL_VERSION < 0x040300 # undef __ASSUME_ACCEPT4_SYSCALL # undef __ASSUME_SENDMSG_SYSCALL @@ -41,6 +37,7 @@ # undef __ASSUME_LISTEN_SYSCALL # undef __ASSUME_GETSOCKNAME_SYSCALL # undef __ASSUME_GETPEERNAME_SYSCALL +# undef __ASSUME_SHUTDOWN_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 c751530cd3..23586c88d3 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -85,6 +85,7 @@ #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 #define __ASSUME_GETPEERNAME_SYSCALL 1 +#define __ASSUME_SHUTDOWN_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 a7b3458a21..1ad1193afb 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -17,15 +17,11 @@ License along with the GNU C Library. If not, see . */ -/* Direct socketcalls available with kernel 4.3. */ -#if __LINUX_KERNEL_VERSION >= 0x040300 -# define __ASSUME_SHUTDOWN_SYSCALL 1 -#endif - #include_next #undef __ASSUME_ACCEPT_SYSCALL +/* Direct socketcalls available with kernel 4.3. */ #if __LINUX_KERNEL_VERSION < 0x040300 # undef __ASSUME_ACCEPT4_SYSCALL # undef __ASSUME_RECVMMSG_SYSCALL @@ -43,6 +39,7 @@ # undef __ASSUME_LISTEN_SYSCALL # undef __ASSUME_GETSOCKNAME_SYSCALL # undef __ASSUME_GETPEERNAME_SYSCALL +# undef __ASSUME_SHUTDOWN_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 328529434d..72496aa922 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -21,7 +21,6 @@ #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 -#define __ASSUME_SHUTDOWN_SYSCALL 1 #include_next diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index 7fae7ca429..e2dc7a15a3 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -21,7 +21,6 @@ #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 -#define __ASSUME_SHUTDOWN_SYSCALL 1 /* Define this if your 32-bit syscall API requires 64-bit register pairs to start with an even-number register. */ diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index e797b71052..b39e4736b3 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -17,15 +17,11 @@ License along with the GNU C Library; if not, see . */ -/* Direct socketcalls available with kernel 4.3. */ -#if __LINUX_KERNEL_VERSION >= 0x040300 -# define __ASSUME_SHUTDOWN_SYSCALL 1 -#endif - #include_next #undef __ASSUME_ACCEPT_SYSCALL +/* Direct socketcalls available with kernel 4.3. */ #if __LINUX_KERNEL_VERSION < 0x040300 # undef __ASSUME_ACCEPT4_SYSCALL # undef __ASSUME_RECVMMSG_SYSCALL @@ -43,6 +39,7 @@ # undef __ASSUME_LISTEN_SYSCALL # undef __ASSUME_GETSOCKNAME_SYSCALL # undef __ASSUME_GETPEERNAME_SYSCALL +# undef __ASSUME_SHUTDOWN_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 3a0b4e6198..ae1387e7d7 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -26,7 +26,6 @@ #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 -#define __ASSUME_SHUTDOWN_SYSCALL 1 #include_next diff --git a/sysdeps/unix/sysv/linux/shutdown.c b/sysdeps/unix/sysv/linux/shutdown.c index 26772c9b28..4cee357b9b 100644 --- a/sysdeps/unix/sysv/linux/shutdown.c +++ b/sysdeps/unix/sysv/linux/shutdown.c @@ -15,19 +15,14 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include - #include -#include -#include int __shutdown (int fd, int how) { #ifdef __ASSUME_SHUTDOWN_SYSCALL - return INLINE_SYSCALL (shutdown, 2, fd, how); + return INLINE_SYSCALL_CALL (shutdown, fd, how); #else return SOCKETCALL (shutdown, fd, how); #endif diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index 7070aaa1ae..12e98a9f95 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -40,8 +40,6 @@ # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL -#else -# define __ASSUME_SHUTDOWN_SYSCALL 1 #endif /* These syscalls were added for both 32-bit and 64-bit in 4.4. */ From patchwork Wed Oct 19 22:14:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59108 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0FFB638207D3 for ; Wed, 19 Oct 2022 22:20:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FFB638207D3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666218006; bh=UK0B/uaWtlIfJU9TnvtLKjoLcoRzufSk1VDERrktNoI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=JEAP34tefbgDijbe/rouqneHEbv4Dl7c8AM+8eREEOZxM/P2eaSeBDdntaZQSqryU HyLA6ZIsLrt6NzoR3SVqS07hzPpOKf68wtoI5E5/nokiBUGp5oHazjEgyj6eQDV3hT k6eSEPojH35RXu1EEn3sch3OMTJm2/eyjfoLiTF0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by sourceware.org (Postfix) with ESMTPS id 3AEB23857023 for ; Wed, 19 Oct 2022 22:15:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3AEB23857023 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-1326637be6eso22370671fac.13 for ; Wed, 19 Oct 2022 15:15:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UK0B/uaWtlIfJU9TnvtLKjoLcoRzufSk1VDERrktNoI=; b=kGzNWaq5Zd8PIiiayGGOSilgII+eYpyY1kiRTlKRqroNMkVgu/tEaL8BK3GDv8/KYw fPzlQCKgvBL7GLH9G6KXONIOnyoiWHqC339V/Oc2wd++uyl+laCbBi0soEqRJTUYF8T7 oZBpGGvd68qQRvFwJQXaqwQAGm4yyDzIghHl9EzouXTllHVNBJMWceOC21mLc6hJzT+G FqEkvP/J2w0Cc0clUGRMrJ2GjrJEgz8ET7NWJuJqctkMzFmZ14wqEV/r5IyQvr+oX2Wy 0vuR6rTX+q+JNsFr6oSGsiL0j2+us875UeGw0vuafrS49kFFfuLD/N+pU/GZ10rzKTAJ tAkQ== X-Gm-Message-State: ACrzQf0dWWhJXiCr5jlXwK1GvWOSDQlp9kMSjtXxzKGySlcNkV685K5D Lslo4Qm/nRzvTzNqk9y3r2r8Yk/kRsXuwz9D X-Google-Smtp-Source: AMsMyM6GvmYePnL1b/q6AyY1ItGCdk1cj6pBcikHGuBy7oBwGmxmsxYpKq4Vqa94Nf8SuKBiGrc0tA== X-Received: by 2002:a05:6870:c092:b0:132:a01f:7c31 with SMTP id c18-20020a056870c09200b00132a01f7c31mr6690551oad.56.1666217709741; Wed, 19 Oct 2022 15:15:09 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.15.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:15:09 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 25/30] Linux: Remove unused generic Makefile Date: Wed, 19 Oct 2022 19:14:28 -0300 Message-Id: <20221019221433.1082017-26-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Both are already defined on default linux Makefile. --- sysdeps/unix/sysv/linux/generic/Makefile | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/generic/Makefile diff --git a/sysdeps/unix/sysv/linux/generic/Makefile b/sysdeps/unix/sysv/linux/generic/Makefile deleted file mode 100644 index 7e27e79772..0000000000 --- a/sysdeps/unix/sysv/linux/generic/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -ifeq ($(subdir),misc) -sysdep_routines += epoll_create inotify_init -endif From patchwork Wed Oct 19 22:14:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59114 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B915F38A909D for ; Wed, 19 Oct 2022 22:20:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B915F38A909D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666218057; bh=WLQO0ZepR9L4dHhiH4Qe1pyOpy+o9z4CldfY4edrN2g=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=tEaW4fah9ScpTFq85PeDUCWzBnDIDlGg1nWao5fs/dcAyBUWXHwLItMHJ1IkR9g8d HxCAVOIsVnjxWtrHb0h57OZrDMiY67o6jRifz05pJYZSfUL7/oXJ2CX/vnuQwyw6cC jMwYLzXfKjGCn08AoA+CakBlMdegM4QaiO3gUXm8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) by sourceware.org (Postfix) with ESMTPS id 9A1343857372 for ; Wed, 19 Oct 2022 22:15:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9A1343857372 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-136b5dd6655so22411331fac.3 for ; Wed, 19 Oct 2022 15:15:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WLQO0ZepR9L4dHhiH4Qe1pyOpy+o9z4CldfY4edrN2g=; b=jKUlykbyfpdtY5JvfeGwdEcMJDP3UGznCbYxFbSzY9yCWkL86/iHWLvk45K8H+z6Yd 7XEhCd/NmbjyU2Z9byqkV1oaG07b86RU5HsRjYO3SLuGiMYODVNYL1oWCoE+pOOW8mDg g61yi3ZW5fXwPLzdZ2xf0KE6+ZSfweM3DO2aZzwuPqL+lFrvDMHFsPeHsGJwgmWXtl7H nCVNuud/9rsC20Q8Q/aCs6mm5DJEcJcmS14t3y512Lt7ERIKtSTK5W8sDnJUZv4kfqT+ wK7HpE7fjQPzYmiJdIJBBUPXZJPch+K8JvMGn4Vs2jYYlu8gNuDAWgKEIaiDyeav4fsA 6YqA== X-Gm-Message-State: ACrzQf0Z9X6jaPRyZfzW37kDf9e8yhExPVmyw+qqKQyxNfsnxyoYafR7 9vUWWvCbaORovteh5EdELrdfSL2iy/i3y3p2 X-Google-Smtp-Source: AMsMyM6avJwuLM3Km7cP75SqWzTfkPzfzw9ZNHtrc6ccznO8iEgI0KoyDu//JaL/bCKQxu1pke+1qw== X-Received: by 2002:a05:6870:5b9d:b0:12b:5871:22f4 with SMTP id em29-20020a0568705b9d00b0012b587122f4mr7062977oab.211.1666217710881; Wed, 19 Oct 2022 15:15:10 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.15.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:15:10 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 26/30] Linux: Remove generic sysdep Date: Wed, 19 Oct 2022 19:14:29 -0300 Message-Id: <20221019221433.1082017-27-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The includes chain is added on each architecture sysdep.h and the __NR__llseek hack is moved to lseek.c and lseek64.c. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/aarch64/sysdep.h | 3 ++- sysdeps/unix/sysv/linux/arc/sysdep.h | 4 +++- sysdeps/unix/sysv/linux/csky/sysdep.h | 2 +- sysdeps/unix/sysv/linux/generic/sysdep.h | 26 ---------------------- sysdeps/unix/sysv/linux/loongarch/sysdep.h | 3 ++- sysdeps/unix/sysv/linux/lseek.c | 4 ++++ sysdeps/unix/sysv/linux/lseek64.c | 4 ++++ sysdeps/unix/sysv/linux/nios2/sysdep.h | 2 +- sysdeps/unix/sysv/linux/or1k/sysdep.h | 3 ++- sysdeps/unix/sysv/linux/riscv/sysdep.h | 3 ++- 10 files changed, 21 insertions(+), 33 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/generic/sysdep.h diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h index f1853e012f..df5075aceb 100644 --- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -21,7 +21,8 @@ #include #include -#include +#include +#include /* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */ #include diff --git a/sysdeps/unix/sysv/linux/arc/sysdep.h b/sysdeps/unix/sysv/linux/arc/sysdep.h index d0c1a78381..90a92566a7 100644 --- a/sysdeps/unix/sysv/linux/arc/sysdep.h +++ b/sysdeps/unix/sysv/linux/arc/sysdep.h @@ -20,7 +20,9 @@ #define _LINUX_ARC_SYSDEP_H 1 #include -#include +#include +#include +#include /* "workarounds" for generic code needing to handle 64-bit time_t. */ diff --git a/sysdeps/unix/sysv/linux/csky/sysdep.h b/sysdeps/unix/sysv/linux/csky/sysdep.h index 56c527fa8b..39c13c6d38 100644 --- a/sysdeps/unix/sysv/linux/csky/sysdep.h +++ b/sysdeps/unix/sysv/linux/csky/sysdep.h @@ -20,9 +20,9 @@ #define _LINUX_CSKY_SYSDEP_H 1 /* There is some commonality. */ -#include #include #include +#include /* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */ #include diff --git a/sysdeps/unix/sysv/linux/generic/sysdep.h b/sysdeps/unix/sysv/linux/generic/sysdep.h deleted file mode 100644 index 7af5cb4e16..0000000000 --- a/sysdeps/unix/sysv/linux/generic/sysdep.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 2011-2022 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 -#include - -/* Provide the common name to allow more code reuse. */ -#ifdef __NR_llseek -# define __NR__llseek __NR_llseek -#endif diff --git a/sysdeps/unix/sysv/linux/loongarch/sysdep.h b/sysdeps/unix/sysv/linux/loongarch/sysdep.h index f4a1d23a97..e2bb39a8f8 100644 --- a/sysdeps/unix/sysv/linux/loongarch/sysdep.h +++ b/sysdeps/unix/sysv/linux/loongarch/sysdep.h @@ -19,7 +19,8 @@ #ifndef _LINUX_LOONGARCH_SYSDEP_H #define _LINUX_LOONGARCH_SYSDEP_H 1 -#include +#include +#include #include #ifdef __ASSEMBLER__ diff --git a/sysdeps/unix/sysv/linux/lseek.c b/sysdeps/unix/sysv/linux/lseek.c index 148503d7bc..3f10c8dc96 100644 --- a/sysdeps/unix/sysv/linux/lseek.c +++ b/sysdeps/unix/sysv/linux/lseek.c @@ -41,6 +41,10 @@ static inline off_t lseek_overflow (loff_t res) off_t __lseek (int fd, off_t offset, int whence) { +#ifdef __NR_llseek +# define __NR__llseek __NR_llseek +#endif + # ifdef __NR__llseek loff_t res; int rc = INLINE_SYSCALL_CALL (_llseek, fd, diff --git a/sysdeps/unix/sysv/linux/lseek64.c b/sysdeps/unix/sysv/linux/lseek64.c index 74aab82f5a..d14ba9e12b 100644 --- a/sysdeps/unix/sysv/linux/lseek64.c +++ b/sysdeps/unix/sysv/linux/lseek64.c @@ -26,6 +26,10 @@ off64_t __lseek64 (int fd, off64_t offset, int whence) { +#ifdef __NR_llseek +# define __NR__llseek __NR_llseek +#endif + #ifdef __NR__llseek loff_t res; int rc = INLINE_SYSCALL_CALL (_llseek, fd, diff --git a/sysdeps/unix/sysv/linux/nios2/sysdep.h b/sysdeps/unix/sysv/linux/nios2/sysdep.h index 5fe960c2a5..4c9aba497b 100644 --- a/sysdeps/unix/sysv/linux/nios2/sysdep.h +++ b/sysdeps/unix/sysv/linux/nios2/sysdep.h @@ -19,9 +19,9 @@ #ifndef _LINUX_NIOS2_SYSDEP_H #define _LINUX_NIOS2_SYSDEP_H 1 +#include #include #include -#include /* For RTLD_PRIVATE_ERRNO. */ #include diff --git a/sysdeps/unix/sysv/linux/or1k/sysdep.h b/sysdeps/unix/sysv/linux/or1k/sysdep.h index 941c934554..fd884606ee 100644 --- a/sysdeps/unix/sysv/linux/or1k/sysdep.h +++ b/sysdeps/unix/sysv/linux/or1k/sysdep.h @@ -19,8 +19,9 @@ #ifndef _LINUX_OR1K_SYSDEP_H #define _LINUX_OR1K_SYSDEP_H 1 +#include #include -#include +#include #include /* "workarounds" for generic code needing to handle 64-bit time_t. */ diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h index 9b03b10567..c2c9b0c937 100644 --- a/sysdeps/unix/sysv/linux/riscv/sysdep.h +++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h @@ -19,7 +19,8 @@ #ifndef _LINUX_RISCV_SYSDEP_H #define _LINUX_RISCV_SYSDEP_H 1 -#include +#include +#include #include #undef SYS_ify From patchwork Wed Oct 19 22:14:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59112 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6251D38A8153 for ; Wed, 19 Oct 2022 22:20:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6251D38A8153 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666218049; bh=feV7WKg+BMltVtxtrD7LcxswbQfZlbC4/BvilvsfeRc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=eRQv5c3JVp8XFSoBi7lcvdZ+W6VvRPYXUFVut+fh5mJrNTmJG9tFid74AG+Xs4Eb4 vn2dDooKJWfOgT1D9WMd0cjnxPoVgBdexqEhWbjcHx4UyKZXMfjprqbgThVR9gjJIO kUV2hhw38kMvJMp5ov82XYjbV1J7qSb69r6NWgzk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by sourceware.org (Postfix) with ESMTPS id 0EA343857402 for ; Wed, 19 Oct 2022 22:15:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0EA343857402 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-1364357a691so22393638fac.7 for ; Wed, 19 Oct 2022 15:15:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=feV7WKg+BMltVtxtrD7LcxswbQfZlbC4/BvilvsfeRc=; b=ELKa1Zi0xYFNYtRYLVaj0BrnpMjfoFbgq+cFsu2QLskAKL2GS13GavJwUebO0WYRGy 98qZujfWTQvYDQ4cIErT9j/vae0Mc2JK0xTQtxo6AgG/0A38pNaIjRtC+e0jIBOaz95H f5U5FPYzeml72GfTnoLB91DtSR/aQfObbPFUeMLDZZACRkjGfg2uV18nCZEIPsbtf5/J 91g33bp0WpoDMU7Zkkd9iqSHdZkVljUkx/gxGv1BjA8N9QGBLDoM9XBIlJls1gkmn9lN TavuyY6Z6satvFJTT1p/lLgPl0hZa+k0U3Vfr4HEbDsg9ZKdT3BD533NXRc7222wmu+U RGGw== X-Gm-Message-State: ACrzQf26YeKgVV7tQF/DJ3ILsApGyzvgMJHJWNBl18DxXYJaFOr8OpKE OaiyB/X5tFC1JUscNE7sdt8vDTNnuzM2fv0Z X-Google-Smtp-Source: AMsMyM523fBzFEadZ9vmhzUYc/kycMr39HcOGifQJPKavd7dYSImO+X1AjMm5XYxgBI/3YQdJnCrAg== X-Received: by 2002:a05:6870:f587:b0:13a:af1a:b2ab with SMTP id eh7-20020a056870f58700b0013aaf1ab2abmr4719517oab.135.1666217712148; Wed, 19 Oct 2022 15:15:12 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.15.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:15:11 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 27/30] Linux: make generic xstatver.h the default one Date: Wed, 19 Oct 2022 19:14:30 -0300 Message-Id: <20221019221433.1082017-28-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" And copy the current default one to required ABIs. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/{generic => arm}/xstatver.h | 11 +++++++---- sysdeps/unix/sysv/linux/hppa/xstatver.h | 13 +++++++++++++ sysdeps/unix/sysv/linux/sh/xstatver.h | 13 +++++++++++++ sysdeps/unix/sysv/linux/xstatver.h | 11 ++++------- 4 files changed, 37 insertions(+), 11 deletions(-) rename sysdeps/unix/sysv/linux/{generic => arm}/xstatver.h (52%) create mode 100644 sysdeps/unix/sysv/linux/hppa/xstatver.h create mode 100644 sysdeps/unix/sysv/linux/sh/xstatver.h diff --git a/sysdeps/unix/sysv/linux/generic/xstatver.h b/sysdeps/unix/sysv/linux/arm/xstatver.h similarity index 52% rename from sysdeps/unix/sysv/linux/generic/xstatver.h rename to sysdeps/unix/sysv/linux/arm/xstatver.h index d8fd35beb6..8e1801b603 100644 --- a/sysdeps/unix/sysv/linux/generic/xstatver.h +++ b/sysdeps/unix/sysv/linux/arm/xstatver.h @@ -1,10 +1,13 @@ /* Versions of the 'struct stat' data structure used in compatibility xstat functions. */ -#define _STAT_VER_KERNEL 0 -#define _STAT_VER_LINUX 0 -#define _STAT_VER _STAT_VER_KERNEL +#define _STAT_VER_LINUX_OLD 1 +#define _STAT_VER_KERNEL 1 +#define _STAT_VER_SVR4 2 +#define _STAT_VER_LINUX 3 +#define _STAT_VER _STAT_VER_LINUX /* Versions of the 'xmknod' interface used in compatibility xmknod functions. */ -#define _MKNOD_VER_LINUX 0 +#define _MKNOD_VER_LINUX 1 +#define _MKNOD_VER_SVR4 2 #define _MKNOD_VER _MKNOD_VER_LINUX diff --git a/sysdeps/unix/sysv/linux/hppa/xstatver.h b/sysdeps/unix/sysv/linux/hppa/xstatver.h new file mode 100644 index 0000000000..8e1801b603 --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/xstatver.h @@ -0,0 +1,13 @@ +/* Versions of the 'struct stat' data structure used in compatibility xstat + functions. */ +#define _STAT_VER_LINUX_OLD 1 +#define _STAT_VER_KERNEL 1 +#define _STAT_VER_SVR4 2 +#define _STAT_VER_LINUX 3 +#define _STAT_VER _STAT_VER_LINUX + +/* Versions of the 'xmknod' interface used in compatibility xmknod + functions. */ +#define _MKNOD_VER_LINUX 1 +#define _MKNOD_VER_SVR4 2 +#define _MKNOD_VER _MKNOD_VER_LINUX diff --git a/sysdeps/unix/sysv/linux/sh/xstatver.h b/sysdeps/unix/sysv/linux/sh/xstatver.h new file mode 100644 index 0000000000..8e1801b603 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sh/xstatver.h @@ -0,0 +1,13 @@ +/* Versions of the 'struct stat' data structure used in compatibility xstat + functions. */ +#define _STAT_VER_LINUX_OLD 1 +#define _STAT_VER_KERNEL 1 +#define _STAT_VER_SVR4 2 +#define _STAT_VER_LINUX 3 +#define _STAT_VER _STAT_VER_LINUX + +/* Versions of the 'xmknod' interface used in compatibility xmknod + functions. */ +#define _MKNOD_VER_LINUX 1 +#define _MKNOD_VER_SVR4 2 +#define _MKNOD_VER _MKNOD_VER_LINUX diff --git a/sysdeps/unix/sysv/linux/xstatver.h b/sysdeps/unix/sysv/linux/xstatver.h index 8e1801b603..d8fd35beb6 100644 --- a/sysdeps/unix/sysv/linux/xstatver.h +++ b/sysdeps/unix/sysv/linux/xstatver.h @@ -1,13 +1,10 @@ /* Versions of the 'struct stat' data structure used in compatibility xstat functions. */ -#define _STAT_VER_LINUX_OLD 1 -#define _STAT_VER_KERNEL 1 -#define _STAT_VER_SVR4 2 -#define _STAT_VER_LINUX 3 -#define _STAT_VER _STAT_VER_LINUX +#define _STAT_VER_KERNEL 0 +#define _STAT_VER_LINUX 0 +#define _STAT_VER _STAT_VER_KERNEL /* Versions of the 'xmknod' interface used in compatibility xmknod functions. */ -#define _MKNOD_VER_LINUX 1 -#define _MKNOD_VER_SVR4 2 +#define _MKNOD_VER_LINUX 0 #define _MKNOD_VER _MKNOD_VER_LINUX From patchwork Wed Oct 19 22:14:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59116 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6F38B384F023 for ; Wed, 19 Oct 2022 22:21:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F38B384F023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666218093; bh=4yCzRWieyMnnSAHXfd4KcHLXJNS51PozO9pCw71+wfc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ucKqdNMP4HxGK3PW3Ex1XbuoJIgPqx35ztatd47zmw4iCLQL6ObQmvHBdt7NWhea9 DLyKbEHh7p1wGXJqGwxL/vxywtqtDsZbMy6y2efPmccxgjYkf6VJcuXkYKA5MepME5 rLtv0exG/n2Y7GfWw0KPOYFR0ftBM58SJN4L7KJE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 5ECCA3858415 for ; Wed, 19 Oct 2022 22:15:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5ECCA3858415 Received: by mail-ot1-x32c.google.com with SMTP id v40-20020a056830092800b00661e37421c2so8152789ott.3 for ; Wed, 19 Oct 2022 15:15:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4yCzRWieyMnnSAHXfd4KcHLXJNS51PozO9pCw71+wfc=; b=e79Y50kXDIZJ/YO/u1cKIHtr2G5zj8GMRRugKo2lUoOnL842qFEPty49h6TvRxVcpT beqhb2X3Pp+gwlGdJOxUX5d/exCzrnvJF0VtlD2hBguyrFPln4vktzybrw2ShgyQa0fy TQx8yoMwoAhsP77LhrJNzHXPVJkPb8KIHPcglFavzQ0yyoyYm2pbonm4stzSfcZcTw7c 9BVTv7NeKwLJB6yds26OKgll7d5LeCn5+n7KHbpKI0QOPLt2tQcNYA5/ksFn/2h+xXpu Z5FaIZZG2cBIcUGmYeld7t1kV1JgOX8xO200OEjgI9q37pkp8ZdgLQj2Yb4A0MJZX9SJ dvbA== X-Gm-Message-State: ACrzQf0wWW7lKMapQOhyqx222eM10mgHVaJsS6N1dGlnoBFKq4csKI/m w7uCupIrfQXM/vpxYKefC2o7jSC85u8ncr4W X-Google-Smtp-Source: AMsMyM5VwyJUNmfkm1qChsPuS8O2aMKfYwLejSpz2cCFkexgp1tRUVyBUKS13JokEkGeItGlcstKCQ== X-Received: by 2002:a9d:3e9:0:b0:661:a8a2:7b96 with SMTP id f96-20020a9d03e9000000b00661a8a27b96mr5395860otf.190.1666217713355; Wed, 19 Oct 2022 15:15:13 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.15.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:15:13 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 28/30] Linux: Make generic fcntl.h the default one Date: Wed, 19 Oct 2022 19:14:31 -0300 Message-Id: <20221019221433.1082017-29-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" It is currently used for csky, arc, nios2, and or1k. Newer 64 bit architecture, like riscv32 and loongarch, reimplement it to override F_GETLK64/F_SETLK64/F_SETLKW64. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/bits/fcntl.h | 56 +++++++++++++++++++- sysdeps/unix/sysv/linux/generic/bits/fcntl.h | 55 ------------------- 2 files changed, 54 insertions(+), 57 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/generic/bits/fcntl.h diff --git a/sysdeps/unix/sysv/linux/bits/fcntl.h b/sysdeps/unix/sysv/linux/bits/fcntl.h index be40350e82..112ee96df5 100644 --- a/sysdeps/unix/sysv/linux/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/bits/fcntl.h @@ -1,3 +1,55 @@ -/* bits/fcntl.h is architecture specific. */ -#error "This file must be supplied by every Linux architecture." +/* O_*, F_*, FD_* bit values for the generic Linux ABI. + Copyright (C) 2011-2022 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 + . */ + +#ifndef _FCNTL_H +# error "Never use directly; include instead." +#endif + +#include + +#if __WORDSIZE == 64 +# define __O_LARGEFILE 0 +#endif + +struct flock + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ +#ifndef __USE_FILE_OFFSET64 + __off_t l_start; /* Offset where the lock begins. */ + __off_t l_len; /* Size of the locked area; zero means until EOF. */ +#else + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ +#endif + __pid_t l_pid; /* Process holding the lock. */ + }; + +#ifdef __USE_LARGEFILE64 +struct flock64 + { + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ + __off64_t l_start; /* Offset where the lock begins. */ + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ + __pid_t l_pid; /* Process holding the lock. */ + }; +#endif + +/* Include generic Linux declarations. */ +#include diff --git a/sysdeps/unix/sysv/linux/generic/bits/fcntl.h b/sysdeps/unix/sysv/linux/generic/bits/fcntl.h deleted file mode 100644 index 112ee96df5..0000000000 --- a/sysdeps/unix/sysv/linux/generic/bits/fcntl.h +++ /dev/null @@ -1,55 +0,0 @@ -/* O_*, F_*, FD_* bit values for the generic Linux ABI. - Copyright (C) 2011-2022 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 - . */ - -#ifndef _FCNTL_H -# error "Never use directly; include instead." -#endif - -#include - -#if __WORDSIZE == 64 -# define __O_LARGEFILE 0 -#endif - -struct flock - { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ -#ifndef __USE_FILE_OFFSET64 - __off_t l_start; /* Offset where the lock begins. */ - __off_t l_len; /* Size of the locked area; zero means until EOF. */ -#else - __off64_t l_start; /* Offset where the lock begins. */ - __off64_t l_len; /* Size of the locked area; zero means until EOF. */ -#endif - __pid_t l_pid; /* Process holding the lock. */ - }; - -#ifdef __USE_LARGEFILE64 -struct flock64 - { - short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ - short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ - __off64_t l_start; /* Offset where the lock begins. */ - __off64_t l_len; /* Size of the locked area; zero means until EOF. */ - __pid_t l_pid; /* Process holding the lock. */ - }; -#endif - -/* Include generic Linux declarations. */ -#include From patchwork Wed Oct 19 22:14:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59117 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BE0433858418 for ; Wed, 19 Oct 2022 22:21:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE0433858418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666218101; bh=4zGnnhzJv+HRXwwLAxhCemwxTQG3hA83J10kvv93Mxw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=EJ+lYWa/og79yAeSVCwzF56xE2ltzfA+VVLQh4G3KyqFViCD5e9ZepBCs87iwackR UaJvKvmTquA8if1bG38EqJd8AtkuftbO4ij8WyyAG1IWQB3T6BclRKZJ7mAypULovT 2EPh5IXmEYvRSAVgr+E72ypI1KacR97nj9rs7fJo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by sourceware.org (Postfix) with ESMTPS id D91923857BBC for ; Wed, 19 Oct 2022 22:15:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D91923857BBC Received: by mail-oi1-x22c.google.com with SMTP id n130so20855702oia.6 for ; Wed, 19 Oct 2022 15:15:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4zGnnhzJv+HRXwwLAxhCemwxTQG3hA83J10kvv93Mxw=; b=IyTm/L14+A7spmyHprETAuyCjeI/rJed/JDtO6LHQ3PXKiRqeuwBNvhTwOodYux4AY gugfKka2iny1yCR8kcCM0H0NCdd6jdCeuV+cWOLx7HKFdU5HMmaWDrM9gzOJKPtAN94l Nyekv9chD/bqZe1hSG/JBKY+uRbAIwIicygSc8EqJW0tR32yMTIdgByc+DUw+FqN07zB 9ZkWUSgFFd6FGACUZeDVLzqxpKFR6e2RL1aR93qeJu68Jkly4d9kT86smalsYVGKWnkv CY/FQ+rDQ6TzmRE4+Am7fDkt1V+Ynxwlq9Bou2wsH9WoKOQHR3NmzkeCcamcZc0KKbud zEYw== X-Gm-Message-State: ACrzQf3Yjl4c+5EXwlBZKQCdOKjQMIIXdLFU9A7ag5TWBG4cBlgjp5VK PgdgA3/ncajHXBsYt1L8YjowefPrGexBbO/p X-Google-Smtp-Source: AMsMyM6JX/ZJcvpoLNNJL0yjXb5UGwP2o2qT4IJBdTIgwBNBOA90gEJVsmyUoayWz3b91YuNWg53bA== X-Received: by 2002:a05:6808:2013:b0:354:b69f:497f with SMTP id q19-20020a056808201300b00354b69f497fmr19411094oiw.213.1666217714601; Wed, 19 Oct 2022 15:15:14 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.15.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:15:14 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 29/30] Linux: Consolidate typesizes.h Date: Wed, 19 Oct 2022 19:14:32 -0300 Message-Id: <20221019221433.1082017-30-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The generic (sysdeps/unix/sysv/linux/generic/bits/typesizes.h) and default (bits/typesizes.h) differs in two fields: bits/typesizes.h Linux generic __NLINK_T_TYPE __UWORD_TYPE __U32_TYPE __BLKSIZE_T_TYPE __SLONGWORD_TYPE __S32_TYPE Sinceit leads to different C++ mangling names, the default typesize.h is copied for the requires archtiectures and the generic is make the default Linux one. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/arm/bits/typesizes.h | 74 +++++++++++++++ .../sysv/linux/{generic => }/bits/typesizes.h | 0 sysdeps/unix/sysv/linux/hppa/bits/typesizes.h | 74 +++++++++++++++ sysdeps/unix/sysv/linux/ia64/bits/typesizes.h | 86 +++++++++++++++++ sysdeps/unix/sysv/linux/m68k/bits/typesizes.h | 74 +++++++++++++++ .../sysv/linux/microblaze/bits/typesizes.h | 74 +++++++++++++++ sysdeps/unix/sysv/linux/mips/bits/typesizes.h | 95 +++++++++++++++++++ .../unix/sysv/linux/powerpc/bits/typesizes.h | 95 +++++++++++++++++++ sysdeps/unix/sysv/linux/sh/bits/typesizes.h | 74 +++++++++++++++ 9 files changed, 646 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/arm/bits/typesizes.h rename sysdeps/unix/sysv/linux/{generic => }/bits/typesizes.h (100%) create mode 100644 sysdeps/unix/sysv/linux/hppa/bits/typesizes.h create mode 100644 sysdeps/unix/sysv/linux/ia64/bits/typesizes.h create mode 100644 sysdeps/unix/sysv/linux/m68k/bits/typesizes.h create mode 100644 sysdeps/unix/sysv/linux/microblaze/bits/typesizes.h create mode 100644 sysdeps/unix/sysv/linux/mips/bits/typesizes.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/typesizes.h create mode 100644 sysdeps/unix/sysv/linux/sh/bits/typesizes.h diff --git a/sysdeps/unix/sysv/linux/arm/bits/typesizes.h b/sysdeps/unix/sysv/linux/arm/bits/typesizes.h new file mode 100644 index 0000000000..255bf39de3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/arm/bits/typesizes.h @@ -0,0 +1,74 @@ +/* bits/typesizes.h -- underlying types for *_t. ARM version. + Copyright (C) 2002-2022 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 + . */ + +#ifndef _BITS_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __UWORD_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __FSWORD_T_TYPE __SWORD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE +#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#define __CPU_MASK_TYPE __ULONGWORD_TYPE + +#define __RLIM_T_MATCHES_RLIM64_T 0 +#define __STATFS_MATCHES_STATFS64 0 +/* And for getitimer, setitimer and rusage */ +#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/bits/typesizes.h similarity index 100% rename from sysdeps/unix/sysv/linux/generic/bits/typesizes.h rename to sysdeps/unix/sysv/linux/bits/typesizes.h diff --git a/sysdeps/unix/sysv/linux/hppa/bits/typesizes.h b/sysdeps/unix/sysv/linux/hppa/bits/typesizes.h new file mode 100644 index 0000000000..d32e354d36 --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/bits/typesizes.h @@ -0,0 +1,74 @@ +/* bits/typesizes.h -- underlying types for *_t. HPPA version. + Copyright (C) 2002-2022 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 + . */ + +#ifndef _BITS_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __UWORD_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __FSWORD_T_TYPE __SWORD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE +#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#define __CPU_MASK_TYPE __ULONGWORD_TYPE + +#define __RLIM_T_MATCHES_RLIM64_T 0 +#define __STATFS_MATCHES_STATFS64 0 +/* And for getitimer, setitimer and rusage */ +#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ diff --git a/sysdeps/unix/sysv/linux/ia64/bits/typesizes.h b/sysdeps/unix/sysv/linux/ia64/bits/typesizes.h new file mode 100644 index 0000000000..20a2f886cb --- /dev/null +++ b/sysdeps/unix/sysv/linux/ia64/bits/typesizes.h @@ -0,0 +1,86 @@ +/* bits/typesizes.h -- underlying types for *_t. IA64 version. + Copyright (C) 2002-2022 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 + . */ + +#ifndef _BITS_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __UWORD_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __FSWORD_T_TYPE __SWORD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE +#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#define __CPU_MASK_TYPE __ULONGWORD_TYPE + +/* Tell the libc code that off_t and off64_t are actually the same type + for all ABI purposes, even if possibly expressed as different base types + for C type-checking purposes. */ +#define __OFF_T_MATCHES_OFF64_T 1 + +/* Same for ino_t and ino64_t. */ +#define __INO_T_MATCHES_INO64_T 1 + +/* And for rlim_t and rlim64_t. */ +#define __RLIM_T_MATCHES_RLIM64_T 1 + +/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ +#define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ diff --git a/sysdeps/unix/sysv/linux/m68k/bits/typesizes.h b/sysdeps/unix/sysv/linux/m68k/bits/typesizes.h new file mode 100644 index 0000000000..eeb050200a --- /dev/null +++ b/sysdeps/unix/sysv/linux/m68k/bits/typesizes.h @@ -0,0 +1,74 @@ +/* bits/typesizes.h -- underlying types for *_t. m68k version. + Copyright (C) 2002-2022 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 + . */ + +#ifndef _BITS_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __UWORD_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __FSWORD_T_TYPE __SWORD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE +#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#define __CPU_MASK_TYPE __ULONGWORD_TYPE + +#define __RLIM_T_MATCHES_RLIM64_T 0 +#define __STATFS_MATCHES_STATFS64 0 +/* And for getitimer, setitimer and rusage */ +#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/typesizes.h b/sysdeps/unix/sysv/linux/microblaze/bits/typesizes.h new file mode 100644 index 0000000000..4585f506f9 --- /dev/null +++ b/sysdeps/unix/sysv/linux/microblaze/bits/typesizes.h @@ -0,0 +1,74 @@ +/* bits/typesizes.h -- underlying types for *_t. Microblaze version. + Copyright (C) 2002-2022 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 + . */ + +#ifndef _BITS_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __UWORD_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __FSWORD_T_TYPE __SWORD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE +#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#define __CPU_MASK_TYPE __ULONGWORD_TYPE + +#define __RLIM_T_MATCHES_RLIM64_T 0 +#define __STATFS_MATCHES_STATFS64 0 +/* And for getitimer, setitimer and rusage */ +#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/typesizes.h b/sysdeps/unix/sysv/linux/mips/bits/typesizes.h new file mode 100644 index 0000000000..7e46d0f53f --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/bits/typesizes.h @@ -0,0 +1,95 @@ +/* bits/typesizes.h -- underlying types for *_t. MIPS version. + Copyright (C) 2002-2022 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 + . */ + +#ifndef _BITS_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __UWORD_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __FSWORD_T_TYPE __SWORD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE +#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#define __CPU_MASK_TYPE __ULONGWORD_TYPE + +#ifdef __LP64__ +/* Tell the libc code that off_t and off64_t are actually the same type + for all ABI purposes, even if possibly expressed as different base types + for C type-checking purposes. */ +# define __OFF_T_MATCHES_OFF64_T 1 + +/* Same for ino_t and ino64_t. */ +# define __INO_T_MATCHES_INO64_T 1 + +/* And for rlim_t and rlim64_t. */ +# define __RLIM_T_MATCHES_RLIM64_T 1 + +/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ +# define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 +#else +# define __RLIM_T_MATCHES_RLIM64_T 0 + +# define __STATFS_MATCHES_STATFS64 0 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 +#endif + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/typesizes.h b/sysdeps/unix/sysv/linux/powerpc/bits/typesizes.h new file mode 100644 index 0000000000..d2a15df721 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/typesizes.h @@ -0,0 +1,95 @@ +/* bits/typesizes.h -- underlying types for *_t. PowerPC version. + Copyright (C) 2002-2022 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 + . */ + +#ifndef _BITS_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __UWORD_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __FSWORD_T_TYPE __SWORD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE +#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#define __CPU_MASK_TYPE __ULONGWORD_TYPE + +#ifdef __LP64__ +/* Tell the libc code that off_t and off64_t are actually the same type + for all ABI purposes, even if possibly expressed as different base types + for C type-checking purposes. */ +# define __OFF_T_MATCHES_OFF64_T 1 + +/* Same for ino_t and ino64_t. */ +# define __INO_T_MATCHES_INO64_T 1 + +/* And for rlim_t and rlim64_t. */ +# define __RLIM_T_MATCHES_RLIM64_T 1 + +/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ +# define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 +#else +# define __RLIM_T_MATCHES_RLIM64_T 0 + +# define __STATFS_MATCHES_STATFS64 0 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 +#endif + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ diff --git a/sysdeps/unix/sysv/linux/sh/bits/typesizes.h b/sysdeps/unix/sysv/linux/sh/bits/typesizes.h new file mode 100644 index 0000000000..ab1ac9ea9c --- /dev/null +++ b/sysdeps/unix/sysv/linux/sh/bits/typesizes.h @@ -0,0 +1,74 @@ +/* bits/typesizes.h -- underlying types for *_t. SH version. + Copyright (C) 2002-2022 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 + . */ + +#ifndef _BITS_TYPES_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_TYPESIZES_H +#define _BITS_TYPESIZES_H 1 + +/* See for the meaning of these macros. This file exists so + that need not vary across different GNU platforms. */ + +#define __DEV_T_TYPE __UQUAD_TYPE +#define __UID_T_TYPE __U32_TYPE +#define __GID_T_TYPE __U32_TYPE +#define __INO_T_TYPE __ULONGWORD_TYPE +#define __INO64_T_TYPE __UQUAD_TYPE +#define __MODE_T_TYPE __U32_TYPE +#define __NLINK_T_TYPE __UWORD_TYPE +#define __OFF_T_TYPE __SLONGWORD_TYPE +#define __OFF64_T_TYPE __SQUAD_TYPE +#define __PID_T_TYPE __S32_TYPE +#define __RLIM_T_TYPE __ULONGWORD_TYPE +#define __RLIM64_T_TYPE __UQUAD_TYPE +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE +#define __BLKCNT64_T_TYPE __SQUAD_TYPE +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE +#define __FSWORD_T_TYPE __SWORD_TYPE +#define __ID_T_TYPE __U32_TYPE +#define __CLOCK_T_TYPE __SLONGWORD_TYPE +#define __TIME_T_TYPE __SLONGWORD_TYPE +#define __USECONDS_T_TYPE __U32_TYPE +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __DADDR_T_TYPE __S32_TYPE +#define __KEY_T_TYPE __S32_TYPE +#define __CLOCKID_T_TYPE __S32_TYPE +#define __TIMER_T_TYPE void * +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE +#define __FSID_T_TYPE struct { int __val[2]; } +#define __SSIZE_T_TYPE __SWORD_TYPE +#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE +#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE +#define __CPU_MASK_TYPE __ULONGWORD_TYPE + +#define __RLIM_T_MATCHES_RLIM64_T 0 +#define __STATFS_MATCHES_STATFS64 0 +/* And for getitimer, setitimer and rusage */ +#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +#endif /* bits/typesizes.h */ From patchwork Wed Oct 19 22:14:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 59118 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B1ABB3839DCE for ; Wed, 19 Oct 2022 22:21:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B1ABB3839DCE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666218103; bh=YO3iRf8kWEh86P6lIpaIkB2bNCWyPSaCXlITMcLHTKs=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=O1mB/Zi9aEld9wPQFL8WgKpQaWKEMUoF6vpwY/uYEZTpQr4kAuaItXW1Kf8syQd9H kB36Lsju098cPzDWRPRuUj2E8BZfB7MG5qmxuNLtKk1vVObQoBVbW8KFYkorLCb5tW +fSUTPoPMrWy/MyhdCtOhh0/umMbTk/LJ8HGi7IM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by sourceware.org (Postfix) with ESMTPS id 6513A3857028 for ; Wed, 19 Oct 2022 22:15:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6513A3857028 Received: by mail-oi1-x230.google.com with SMTP id j188so20868918oih.4 for ; Wed, 19 Oct 2022 15:15:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YO3iRf8kWEh86P6lIpaIkB2bNCWyPSaCXlITMcLHTKs=; b=E8EVQbotBNNsiByL+fVLvaskz6+u+lDrneeajBV9yH2dJ+XcOqQCRWe4A82T3fP/3Y +EPTkOfBOF/RJIbpQkuMI9GDqgOWnDMYG0/lpBIA8PHXgCDe2T062zUdX9jL7jfvZskK UpO1Yzq30SRxvhIlQBB9avfJ3MkD+JJUnBz0ir03e2L5kRUl09FJWfauMfnNa9gd3etS QjcY0CPsZpkP7M1t1mfdEoSkLS1dAqReVKbbmQFf/ALxQMuatxb0xAwAgbm2Q02te01Z R0mOkwb2M1bRX2+TIIOLjnFi899I9E+uySuU81yaGw4ocaZym+bZ4s1Hwtr/C87eHh/Q KCBQ== X-Gm-Message-State: ACrzQf3ovA+JEGJHri8X0oTM2urtCLrC0pf7rZ99t+/Y7b2XD/zu0u0m Z6rjWosteQpwAbk7ar/CIvqMejVxZRQ9VnaO X-Google-Smtp-Source: AMsMyM7T5eAHZGQoREFpeKl9H2GBJ9qxkf4aXnYGBjIfPhW4kmwSrQU7JtbyPtCZ+1145roqvZqyIA== X-Received: by 2002:a05:6808:3007:b0:351:5ea9:83d1 with SMTP id ay7-20020a056808300700b003515ea983d1mr5213976oib.150.1666217715771; Wed, 19 Oct 2022 15:15:15 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.15.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:15:15 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 30/30] Linux: Remove generic Implies Date: Wed, 19 Oct 2022 19:14:33 -0300 Message-Id: <20221019221433.1082017-31-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The default Linux implementation already handled the Linux generic ABIs interface used on newer architectures, so there is no need to Imply the generic any longer. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/aarch64/Implies | 1 - sysdeps/unix/sysv/linux/arc/Implies | 2 -- sysdeps/unix/sysv/linux/csky/Implies | 2 -- sysdeps/unix/sysv/linux/generic/README | 11 ----------- sysdeps/unix/sysv/linux/loongarch/lp64/Implies | 1 - sysdeps/unix/sysv/linux/nios2/Implies | 2 -- sysdeps/unix/sysv/linux/or1k/Implies | 2 -- sysdeps/unix/sysv/linux/riscv/rv32/Implies | 2 -- sysdeps/unix/sysv/linux/riscv/rv64/Implies | 1 - 9 files changed, 24 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/generic/README diff --git a/sysdeps/unix/sysv/linux/aarch64/Implies b/sysdeps/unix/sysv/linux/aarch64/Implies index 4409e19b92..9c2d2c9870 100644 --- a/sysdeps/unix/sysv/linux/aarch64/Implies +++ b/sysdeps/unix/sysv/linux/aarch64/Implies @@ -1,3 +1,2 @@ aarch64/nptl -unix/sysv/linux/generic unix/sysv/linux/wordsize-64 diff --git a/sysdeps/unix/sysv/linux/arc/Implies b/sysdeps/unix/sysv/linux/arc/Implies index 7f739a0340..5c1698c045 100644 --- a/sysdeps/unix/sysv/linux/arc/Implies +++ b/sysdeps/unix/sysv/linux/arc/Implies @@ -1,3 +1 @@ arc/nptl -unix/sysv/linux/generic/wordsize-32 -unix/sysv/linux/generic diff --git a/sysdeps/unix/sysv/linux/csky/Implies b/sysdeps/unix/sysv/linux/csky/Implies index f37776ccef..2259772947 100644 --- a/sysdeps/unix/sysv/linux/csky/Implies +++ b/sysdeps/unix/sysv/linux/csky/Implies @@ -1,3 +1 @@ -unix/sysv/linux/generic/wordsize-32 -unix/sysv/linux/generic csky/nptl diff --git a/sysdeps/unix/sysv/linux/generic/README b/sysdeps/unix/sysv/linux/generic/README deleted file mode 100644 index 301a6107e1..0000000000 --- a/sysdeps/unix/sysv/linux/generic/README +++ /dev/null @@ -1,11 +0,0 @@ -This hierarchy supports Linux systems using the new -asm-generic/unistd.h, which removes many familiar old syscalls. For -example, to implement open(), newer Linux architectures require glibc -to invoke the __NR_openat syscall with AT_FDCWD. This hierarchy -provides all those implementations. - -It also provides support for 32-bit platforms using the 64-bit kernel -syscall APIs, as the 32-bit ones are no longer provided. Note that -newer ILP32 environments (x32 or AArch64:ILP32, for example) are -converting to use more 64-bit types in kernel syscalls, so that aspect -of this support is in more flux as of this writing. diff --git a/sysdeps/unix/sysv/linux/loongarch/lp64/Implies b/sysdeps/unix/sysv/linux/loongarch/lp64/Implies index 117c2b8efe..e0390cc3bf 100644 --- a/sysdeps/unix/sysv/linux/loongarch/lp64/Implies +++ b/sysdeps/unix/sysv/linux/loongarch/lp64/Implies @@ -1,3 +1,2 @@ unix/sysv/linux/loongarch -unix/sysv/linux/generic unix/sysv/linux/wordsize-64 diff --git a/sysdeps/unix/sysv/linux/nios2/Implies b/sysdeps/unix/sysv/linux/nios2/Implies index 4d0478bf8f..e6c9be4665 100644 --- a/sysdeps/unix/sysv/linux/nios2/Implies +++ b/sysdeps/unix/sysv/linux/nios2/Implies @@ -1,3 +1 @@ nios2/nptl -unix/sysv/linux/generic/wordsize-32 -unix/sysv/linux/generic diff --git a/sysdeps/unix/sysv/linux/or1k/Implies b/sysdeps/unix/sysv/linux/or1k/Implies index f39f16c04a..07f8e71adc 100644 --- a/sysdeps/unix/sysv/linux/or1k/Implies +++ b/sysdeps/unix/sysv/linux/or1k/Implies @@ -1,3 +1 @@ or1k/nptl -unix/sysv/linux/generic/wordsize-32 -unix/sysv/linux/generic diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/Implies b/sysdeps/unix/sysv/linux/riscv/rv32/Implies index 8b7deb33cd..83db34c5d5 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/Implies +++ b/sysdeps/unix/sysv/linux/riscv/rv32/Implies @@ -1,3 +1 @@ unix/sysv/linux/riscv -unix/sysv/linux/generic/wordsize-32 -unix/sysv/linux/generic diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/Implies b/sysdeps/unix/sysv/linux/riscv/rv64/Implies index f042343bf7..2f9ad9ff94 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/Implies +++ b/sysdeps/unix/sysv/linux/riscv/rv64/Implies @@ -1,3 +1,2 @@ unix/sysv/linux/riscv -unix/sysv/linux/generic unix/sysv/linux/wordsize-64