From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 7246D3858D20 for ; Tue, 30 May 2023 19:54:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7246D3858D20 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-ot1-x32d.google.com with SMTP id 46e09a7af769-6af6df7f93aso3615629a34.0 for ; Tue, 30 May 2023 12:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685476450; x=1688068450; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=RlwbUx5dZ6EA8zwZETYQFCRjdGsyOP2rTNGxSk1kPuc=; b=dDYjSTz2Wk97W4J6+d7+wKm/SFnvLtALpvj5D7f8U2d/6iNMiyaEcqzH4jfo7E0HWk r3hdJ4pJn2HIT6mA1bmet7DXO9c1i0LmlV0xh8Ms66cXedmF2O1a2tJJGW8AiMqpv6IR +/qngnaUBHuRy2tcCoG1j0MVL17G97YjysPHer2Om+pAXJQOKGDf17dAVn9jc/ub6Sm9 HjLCZb2dUFZEFO0QHXtbZL+ZiCrc0mNkCz5ILt/yPJ6vbGw45fD9/aE+g7sUCF29HWqm S3FhHhaIrDObTPihIRrya/p/7aPuCzC9Y0YNdQEtQ1V98ESTO+MHLBdCG5zD5hb6j7Sf PKyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685476450; x=1688068450; 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=RlwbUx5dZ6EA8zwZETYQFCRjdGsyOP2rTNGxSk1kPuc=; b=lGkYddkqbVzBZNFjBH43Fc7BOLqw9beC86MoJNd9MB8K/zHBQ8EtsS506Bce70xpbE TugHR7UjIdzzANytXE5Dno3K+UcjnADlH+7RloUd0pNrFRwTITXEww1aJ3lMtG1nClCt nUtLWB8CAwOnn2G7P5+qbv+2KIOsnoDyymBNnLGFnAnFPMRtPmuDML9dE0xzPCNrRwqZ CPJnaCgvetbcoqMxzG5RD3Tu9ZzOEmpnII4q01jeAvZNA/Nx+LNddoXUsJtxb994VKzC TOMaKXm0KjtqqZdkP2g3PiHAzhntLrSArJeZmAm+4ug9FPRZA6pJcmMMzgGbNfXK/FVG gnOQ== X-Gm-Message-State: AC+VfDxg4HyFE7xy0I6LX3hBuDp1OhsLqCgZsYVmLXZhu62dxQO8nrha W9FYA4h7YpEQjZEP66qKTnQffOz43EKwqYDQDPwtVQ== X-Google-Smtp-Source: ACHHUZ6KGuWxkqZQZmq00AkTi997hTxgYJQwatcM5ZWXprWJCas+MP9oshBAYed0q8IQ3wo7I584dA== X-Received: by 2002:a05:6871:40c:b0:184:d82:e13d with SMTP id d12-20020a056871040c00b001840d82e13dmr1792290oag.16.1685476450399; Tue, 30 May 2023 12:54:10 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c1:4dd5:946a:2241:9066:6bf3]) by smtp.gmail.com with ESMTPSA id w4-20020a056808018400b003896e31867esm5810729oic.49.2023.05.30.12.54.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 12:54:09 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH] io: Fix F_GETLK64, F_SETLK64, and F_SETLKW64 for powerpc64 Date: Tue, 30 May 2023 16:54:06 -0300 Message-Id: <20230530195406.2073780-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.6 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. --- sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h index 0905cd833c..46ebda7057 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h @@ -33,6 +33,16 @@ # define __O_LARGEFILE 0200000 #endif +#if defined(__PPC64__) || defined(__powerpc64__) +# define F_GETLK 5 +# define F_SETLK 6 +# define F_SETLKW 7 + +# define F_GETLK64 12 +# define F_SETLK64 13 +# define F_SETLKW64 14 +#endif + struct flock { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ -- 2.34.1