From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) by sourceware.org (Postfix) with ESMTPS id 261C7385740B for ; Wed, 18 May 2022 07:33:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 261C7385740B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=arndb.de Received: from mail-yw1-f177.google.com ([209.85.128.177]) by mrelayeu.kundenserver.de (mreue010 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MXXhv-1oO14K2lmp-00Z1df for ; Wed, 18 May 2022 09:33:03 +0200 Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-2f16645872fso15044417b3.4 for ; Wed, 18 May 2022 00:33:03 -0700 (PDT) X-Gm-Message-State: AOAM532eF2mWuMJokxK5VCFFKhqfqBGSCXBDLF3Vs/LKqcvRfyq79zGf /k4xwkSix6y+0kPeV9ge5JumJs7koBdc700btE0= X-Google-Smtp-Source: ABdhPJwJ9mpT5wUhRPVDrIrc2nnR8cwubEBTIIFvcrZexhdy4xDXWwBFjXWglWMKU+zkJAUj4HHiTGZqO0HpnmXvR6k= X-Received: by 2002:a0d:fc83:0:b0:2e5:b0f4:c125 with SMTP id m125-20020a0dfc83000000b002e5b0f4c125mr29844321ywf.347.1652859182532; Wed, 18 May 2022 00:33:02 -0700 (PDT) MIME-Version: 1.0 References: <20220509022611.1248063-1-caiyinyu@loongson.cn> <20220509022611.1248063-10-caiyinyu@loongson.cn> In-Reply-To: From: Arnd Bergmann Date: Wed, 18 May 2022 08:33:05 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 09/13] LoongArch: Linux ABI To: caiyinyu Cc: Adhemerval Zanella , GNU C Library , xuchenghua@loongson.cn, joseph_myers@mentor.com, Arnd Bergmann Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:JTD3cPwx8o1RfquIpus/CZRR3H1mYHgkVLIoTOp6M58uCanleAW J4YDeeKfDtMZBXvU3gwsxkE+kX/Z4L9J6wFDpp7MPvnXVLOQGH9Gl99EHHwHr+hZlpprUfN O8mV1AFNSDNZgTCiTRzRYBK2CPz7J1wDmfdFDhCW5UJaLv2B2KOC3Ob7v6BcT2GdPIPb6sw nVyOZk1NgOfxU/0HS401g== X-UI-Out-Filterresults: notjunk:1;V03:K0:y42cUBI6b6g=:FSjfOh+N6zU130b8/t3hc0 AFz1TzyYeGAIqCVzS7dWXNvJ9o29Kp0VCvwwAHpBXQJrxXekIROHCpweDEKCSs5l3yI4hNdDO VfpmPuiB/H+lPq7Q+96W7z4dQU8BV0m6UKu1qbtomMugncUxJu2WCIJC4pmMXE7IlV2cbodVc bclgvZhK04z2tds+7EV6+9sP+2fOcKoW2fRiDAppVXT8fuseezgaCgH0Eoy50DWglFBylG8c1 tpbcx3wsTHlKxcFaHFGyGTocNVItHKr3y7AXuIBfojX/jo+t6hAuwxZAmltNLcH7K1WeXXwSC dt8+P6JDL2siS3Lp7RSG5IyuTPFdtZ+Y1YvLte5D83z8HhW+D3kHTHFciFH7s3yOWazvi5k+P cV7/iHsDDNLsegEZmgdTr9YThQyx3k2ny6wh04ELTaKkIFr/YkrifMd6qgAaN9bHcT+6s99mK +n416Zik46zqWh0/w9uCX5Z0xkIg0CVisrLEIWgJoNofhLzJRydOyGrxjTxvROFgHomRDRsEa XecJkf2gy1kySg5FdYGQFU0UvfPj4oDMuxbvwLQnzlr7Kmnt36iA4BP1tu8QpyCtzmTqbfQxt 1nfh/N2mI00Z899M8gEPw0F8fQa6SzUYcEe0mdQSCH+9fqquwUIBk1/r074QzVKNUzr4jtQlU V0XE5cWtZGfwkTMxm9hUQQynOhc+/ggFlySKyssSIqRNqlP5IYxBf0hWin1FImHBoZCHH6DKi nW7wqmd9JjaEtgJhW2fb1BGwoMkkEl3I8fCySw== X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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-List-Received-Date: Wed, 18 May 2022 07:33:06 -0000 On Wed, May 18, 2022 at 4:40 AM caiyinyu wrote: > =E5=9C=A8 2022/5/11 =E4=B8=8B=E5=8D=883:08, Arnd Bergmann =E5=86=99=E9=81= =93: > > On Mon, May 9, 2022 at 4:26 AM caiyinyu wrote: > > There are struct flock and flock64 we need in glibc bits/fcntl.h, but > the macro F_GETLK64 F_SETLK64 F_SETLKW64 in > sysdeps/unix/sysv/linux/bits/fcntl-linux.h are: > > ... > # define F_GETLK64 12 /* Get record locking info. */ > # define F_SETLK64 13 /* Set record locking info > (non-blocking). */ > # define F_SETLKW64 14 /* Set record locking info (blocking). *= / > ... > > what we need: > > +#define F_GETLK64 5 /* Get record locking info. */ > +#define F_SETLK64 6 /* Set record locking info (non-blocking). */ > +#define F_SETLKW64 7 /* Set record locking info (blocking). */ > > x86 ia64 s390 and aarch64 have the same problem and they all use their > own fcntl.h. > > Define new value of these macro in > sysdeps/unix/sysv/linux/bits/fcntl-linux.h or > add fcntl-linux.h in loongarch port or keep the status quo?? > > any ideas?? I think the problem is different views of the macros in Linux and glibc: - In Linux, all 32-bit architectures use the 'flock64' interface, while all 64-bit architectures use 'flock'. Older 32-bit architectures also provide the 32-bit 'off_t' interfaces with 'flock' for compatibility with existing user space. - glibc describes the same interfaces differently. Here, all architectures have both the traditional 'flock' and the new 'flock64' version that gets used when building with largerfile64 support enabled, but they may get aliased to the same one depending on which off_t definition glibc was using when the port was started. Adhemerval's suggestion for addressing this in glibc sounds good to me, so you can just keep you extra copy of the same logic for the moment and someone can consolidate the workarounds for 64-bit architectures in the future. Arnd