From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id A1E3D3871F94 for ; Tue, 6 Dec 2022 17:36:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A1E3D3871F94 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670348166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IMT6brTx9qDG6W+IhfhospT++hLBX4e7cWt7n/JDH44=; b=hFrs2SlkS5ApFI9lN0ZbIrD7EmZMmV+FDJtvQF1VTw+3A7SurGqUkOJGuIlXEDS69pvRPp zt967u2WB8CI6W2aSqOCH4ZUw8GE643SGXqmGKOrsU1y646thn7FIQaZo625DwZZpStGK9 RIvgGvYTnqTPKmBxZvmqjWYrGANTfTw= Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-643-YuPHH0uWNo-liqIblgASBQ-1; Tue, 06 Dec 2022 12:36:05 -0500 X-MC-Unique: YuPHH0uWNo-liqIblgASBQ-1 Received: by mail-il1-f199.google.com with SMTP id j20-20020a056e02219400b00300a22a7fe0so14850320ila.3 for ; Tue, 06 Dec 2022 09:36:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IMT6brTx9qDG6W+IhfhospT++hLBX4e7cWt7n/JDH44=; b=VAsWVT/ms4gcftlhJDNlnOVFuRpPuzCQCmz/4lRCWH3ABhbD9XdNkyz0i2sdK7QfsT q5SCrx2WdQ4bTisxk4a215MB+3lPfH6VSlw0w6moCLoIwjniJNpwUafYWtJJNLGwcBor UiUhklzjHDpPhk8Ysy6UuGx3CU/nNe7n2ak6iIPkCAYf5UFHg9s3NOe8mAQwD9ROttdz N2DEFDOpS2/1U/FcAHiRQY154+gLJqAqMifUtzMRPznhz1TSCMQHrGAYUK8v1b96slhP JVtkFT+n8wXcOnAsd44zcizUAWd42LYphwYD6mzV7EGjQIbwLQklaDXx4MseR0NlUW87 QUAw== X-Gm-Message-State: ANoB5pnz7qiwwqBUpueM/PHnTR9ovhWeGzDnXugBQfNRRGK13Q35WQtT 0v3zRpyYlyqHwxErZAr+G//nwLniGsFX3mkeeXQRhxYkdkZLuBpyhN04q/Cd/77UL9mLz+oXCDc /0b8Cd54FQFWzEpgJ+Kyr X-Received: by 2002:a92:a304:0:b0:302:504e:e289 with SMTP id a4-20020a92a304000000b00302504ee289mr33090362ili.129.1670348164114; Tue, 06 Dec 2022 09:36:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf4jCguhvJF4qCIg275OGVnxVji1iBLciyF2Tt6qykH/sNdXP1zV68jv4trmdLTkiHihKH8F0A== X-Received: by 2002:a92:a304:0:b0:302:504e:e289 with SMTP id a4-20020a92a304000000b00302504ee289mr33090345ili.129.1670348163809; Tue, 06 Dec 2022 09:36:03 -0800 (PST) Received: from [192.168.0.241] (192-0-145-146.cpe.teksavvy.com. [192.0.145.146]) by smtp.gmail.com with ESMTPSA id f40-20020a0284ab000000b00374ff5df5ccsm6872176jai.167.2022.12.06.09.36.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Dec 2022 09:36:03 -0800 (PST) Message-ID: <88a45e8e-d803-bf90-57b1-328842283bb3@redhat.com> Date: Tue, 6 Dec 2022 12:36:02 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH 28/30] Linux: Make generic fcntl.h the default one To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> <20221019221433.1082017-29-adhemerval.zanella@linaro.org> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <20221019221433.1082017-29-adhemerval.zanella@linaro.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 List-Id: On 10/19/22 18:14, Adhemerval Zanella via Libc-alpha wrote: > 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. LGTM. No regressions on x86_64 and i686. 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 OK. Move generic to linux. Flattens the structure and one less file to maintain. > 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 -- Cheers, Carlos.