From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2f.google.com (mail-oa1-x2f.google.com [IPv6:2001:4860:4864:20::2f]) by sourceware.org (Postfix) with ESMTPS id 3087A3858D20 for ; Wed, 31 May 2023 18:47:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3087A3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-19f9f11ba3dso80277fac.2 for ; Wed, 31 May 2023 11:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685558822; x=1688150822; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=XWOx8lHVq6rWPrpqJjmfUMfzruCHiPsrW7CHAn/xEL4=; b=gd/m1esz+gxVdAPpMG0JxAusgOGbbllnpS6rxQsnqL+ue33edDhIWVvlaMl0N/Zd+I M+qIk3hFv+ZJxDiuY+G3FHO3YvAozgk3xkfvHWkkQ4ckm36yWwiI9uW7gCrS1fcrdfSv 8e76anSoKi0642JTZYxD2uLPpgh7Qczx3eCsmTxT7Lt7hY6WGa8/UUZlaYZOyzl4GEpv q9EYnvTn8W/tyMmUGnX0EZjlB1dH8VhzA3zQQv9QP97MOV6BJiwIwPu6EmH0gWrDWHbd 7dTb05MQgai80hqelqZ34h/UcAl7U1AUfQF20ojLX4IVEaGCH/oqq8q5/OCSKgcQpXq8 ZtGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685558822; x=1688150822; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XWOx8lHVq6rWPrpqJjmfUMfzruCHiPsrW7CHAn/xEL4=; b=c92fq62dfAJtIvqOxjRlLk4cqdjmKCibbYQdUjhKMEQXP7A22t4hR85uxVorLdHdum MKoLjemBBeKzukaiP1sJ0NJcO40BNv/HSIyuspQIX5mkdr/6MC6lHw2yS8dTOMHU0rxL P26Q4Npu2gT4iuDhKXB0USBRTkqFZHUDcUyKy5CMmTtK03b2Bl1nkmsYwjz3AlQiYV0q LCYEKMGqsdlYj9laGmxj0Lbl8gWYdszelMognsoJU6zSHZrivNOTyK0o0qalUYtOXVoL y56DstpobG212b8M43oFA+xokYmCDl5v4jjc2/+QkizxJnLLIl5P1FMCbzNuGgNb4uIm 7b5w== X-Gm-Message-State: AC+VfDzvOqZEo8FuOPvSP6zQEhbcHbynU9sE7Ei3Zs79riUCsX6wLfFB I03Pjyq34rhBn9PV4kD/Nr4ygqak3RvJvlp1928wZw== X-Google-Smtp-Source: ACHHUZ4YnTRCN1mglBxxjtj8Yzc9+o4xGH7ykLkrsRSFVxBzRrIcf7EjAD+aTGZDoO3DRWKRaYrvqQ== X-Received: by 2002:a05:6870:51c2:b0:19f:4467:3121 with SMTP id b2-20020a05687051c200b0019f44673121mr4367668oaj.0.1685558821886; Wed, 31 May 2023 11:47:01 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c1:4dd5:a09a:e097:d6b0:1baf]) by smtp.gmail.com with ESMTPSA id h7-20020a056870d34700b0018e996a507esm859337oag.31.2023.05.31.11.47.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 11:47:01 -0700 (PDT) From: Adhemerval Zanella To: libc-stable@sourceware.org Subject: [COMMITTED 2.37] io: Fix F_GETLK, F_SETLK, and F_SETLKW for powerpc64 Date: Wed, 31 May 2023 15:46:57 -0300 Message-Id: <20230531184657.36373-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: 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) --- 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 0905cd833c..f7615a447e 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. */ -- 2.34.1