From patchwork Tue May 30 19:54:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 70331 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9DEEF3857704 for ; Tue, 30 May 2023 19:54:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DEEF3857704 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685476475; bh=RlwbUx5dZ6EA8zwZETYQFCRjdGsyOP2rTNGxSk1kPuc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=O71Xj9CmRJdnTGk3sYLSCTRy6s9XD4c15yFCccTvX/dZD8je/i9xYBuGK3+Bz0QdB fOrub8Cdawo9JERgMyh6pKeo+uMSzgcE9xky/b7GXbuh0aYsy5SNLFhVRDhewwLMiD hLXq1DjxSHSiFwQfJMWVSgb3oWjIagYvNL8rL0ug= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-6af6df7f93aso3615629a34.0 for ; Tue, 30 May 2023 12:54:12 -0700 (PDT) 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) 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 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 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" 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. */