From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id E44F33858CD1; Wed, 31 May 2023 18:41:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E44F33858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685558484; bh=zpi8ivexw0WqKIdLX2ZNQpgLoeag8+YXdMyX4r/xYsQ=; h=From:To:Subject:Date:From; b=QCUG1QCV9+aODKnAuquwwixUw5nkAQ5ItRNqkzCtiQ9sQhHC7HY1gM0en7Fy4Ln/e FglZE2jliAQnJinYJFv4KT0iWY6SUGVyRomGieeBfgVY4ijvChe8O5V/TLPFnb072p 3l4RPVkrsLMp++YSC5l+3FgMTeoApK4EOFt0jm/c= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/release/2.35/master] io: Fix F_GETLK, F_SETLK, and F_SETLKW for powerpc64 X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/release/2.35/master X-Git-Oldrev: 0967fb586124e1b84532fd32fc5bb201161a5e7f X-Git-Newrev: cbceb903c4d770acc7e4ba5641036516830ed69b Message-Id: <20230531184124.E44F33858CD1@sourceware.org> Date: Wed, 31 May 2023 18:41:24 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cbceb903c4d770acc7e4ba5641036516830ed69b commit cbceb903c4d770acc7e4ba5641036516830ed69b Author: Adhemerval Zanella Date: Tue May 30 16:40:38 2023 -0300 io: Fix F_GETLK, F_SETLK, and F_SETLKW for powerpc64 Different than other 64 bit architectures, powerpc64 defines the LFS POSIX lock constants with values similar to 32 ABI, which are meant to be used with fcntl64 syscall. Since powerpc64 kABI does not have fcntl, the constants are adjusted with the FCNTL_ADJUST_CMD macro. The 4d0fe291aed3a476a changed the logic of generic constants LFS value are equal to the default values; which is now wrong for powerpc64. Fix the value by explicit define the previous glibc constants (powerpc64 does not need to use the 32 kABI value, but it simplifies the FCNTL_ADJUST_CMD which should be kept as compatibility). Checked on powerpc64-linux-gnu and powerpc-linux-gnu. (cherry picked from commit 5f828ff824e3b7cd133ef905b8ae25ab8a8f3d66) Diff: --- sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h index d7cf158b33..49c8fac0fb 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h @@ -33,6 +33,12 @@ # define __O_LARGEFILE 0200000 #endif +#if __WORDSIZE == 64 +# define F_GETLK 5 +# define F_SETLK 6 +# define F_SETLKW 7 +#endif + struct flock { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */