From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by sourceware.org (Postfix) with ESMTPS id 7C41D3858D20 for ; Wed, 31 May 2023 18:41:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7C41D3858D20 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-x2c.google.com with SMTP id 586e51a60fabf-19f30256921so88720fac.1 for ; Wed, 31 May 2023 11:41:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685558511; x=1688150511; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=wEhtIAclO4m/hhsIRj5T09AY/yQVH0fIlOBBxOhznP8=; b=yPolfBlDY7r7PNsp7h9ZjgRMIQh3gug52P7IZ+8+xSZyZKMTTLYRAHT34nVAKHVrsI AF+doJYoQU2MmDIxuxcMx4sTUIiU8NZNdxFi7M/FmeqSOnBm71I7iL+cGJ6oVTyHUzkW 2c+oD0xq/5u1qpo3jXqOuSdQeeDXzhwQsuvAPomMEP02QpLrCIkEv6Zxacawirb3U36L OU/Y8BikQr7OWuUcWnRWoCakRbukOAKkjxzgPidMRu0qnU3FA05TZFrvlrocVNRQIigC R2Nz/o5Znwf66nbflj0+OXiAJFSPyk6+dLRlh7IKtrs0SEV3B0xqj20it9YCRR7RmkYb 71Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685558511; x=1688150511; 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=wEhtIAclO4m/hhsIRj5T09AY/yQVH0fIlOBBxOhznP8=; b=A/o2UnrOdBucngbfeP9XHrQXmjtu0BIArUar9pBbevfIuq+Dbk/cFKaHrl2Jo5KbVf My0zpLMxvMCmleNzjmIlr1sN06yP4RjCGxMDhhUrFaTO3e/QdTl/IwRnbDZO3ECFArFK lR2BEEnFXmy2ZCy/cUwcqkjGhcuPeoQI1lj/9DoHYxoMdOz7FZD8zA8wdjoCPpjPnZ3w 2qPNW+nd4iDsLDHSnsSd0N/mdzE8ls2C9tKZkPe80M2ZgAQdUwhxoeEMgMaNnx7xHdCE A/CrNZPNCCrfTaitMgL+xjubYvyby38VKHittd9KKoG1YQ0/HEzMM4m1+XhFc67jTmVU 5Vcw== X-Gm-Message-State: AC+VfDwytIR6EDvnJndFUbC8Qbo3Zbg+GM26j651y771uTmXP2L267X8 0iSqQp4Jqu1UJueuNSvbOwdt0t0tQVYIPxKnpdgLGg== X-Google-Smtp-Source: ACHHUZ6Y1Z4vDNPVubNGfJ0BY0IPVjZmTOxn7rolMe2MRhiO+VP6ybebtkp6HC4+hqNvDtYZWSATLw== X-Received: by 2002:a05:6870:494b:b0:192:92e4:4bad with SMTP id fl11-20020a056870494b00b0019292e44badmr5307331oab.32.1685558511261; Wed, 31 May 2023 11:41:51 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c1:4dd5:a09a:e097:d6b0:1baf]) by smtp.gmail.com with ESMTPSA id b7-20020a4aba07000000b0055516447257sm6425495oop.29.2023.05.31.11.41.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 11:41:50 -0700 (PDT) From: Adhemerval Zanella To: libc-stable@sourceware.org Subject: [COMMITTED 2.35] io: Fix F_GETLK, F_SETLK, and F_SETLKW for powerpc64 Date: Wed, 31 May 2023 15:41:47 -0300 Message-Id: <20230531184147.4126490-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 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. */ -- 2.34.1