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 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 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