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