From patchwork Wed May 31 11:37:49 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: 1788267 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=ZgBEdU8a; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QWS1w6JBSz20Py for ; Wed, 31 May 2023 21:38:12 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D31E13858000 for ; Wed, 31 May 2023 11:38:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D31E13858000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685533090; bh=iul3jlNYPzjI3yQC4l8K8E34vvDTo3v+iS/ILI3oDmo=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ZgBEdU8axVo8h6jWcVhFira73tCrnIge+ErkWVlZi5e+kLxQ47Jg2tak1Wflvp+xK H0vHcz6PkrxY9rBVPKD096rfjqRDMAMzlrm47Qrruvipq+1Orp0EWaDKO3vEPs3yhk 3DHIx14Kf1BlrddLdhk3aWGLBxv4rJhi301JaDGE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by sourceware.org (Postfix) with ESMTPS id 24E213858D20 for ; Wed, 31 May 2023 11:37:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 24E213858D20 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-392116ae103so3510514b6e.0 for ; Wed, 31 May 2023 04:37:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685533074; x=1688125074; 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=iul3jlNYPzjI3yQC4l8K8E34vvDTo3v+iS/ILI3oDmo=; b=QXMfcOcb80imKkSF/x523HRyzDS7kkTh7jdxoKRivLXVV2/i3GCqd222NEDfcmXV4A ySLwePEN8uYNTo5W8nNeCHDPq0iPN176F5rLbFVEe816c60HrelOYzrqiYfRLMPFqQqi mRZc5uTi2eyBWigTpCcjv57nGj1fruHcl/Hd1xZ3VfRrMKN9yHjvJRY5ofWu9dP5Gmw4 x/qbgn3zacUs+Dx1CVO0ytpC98Y0ykg/E7M+VNIC9J1joQ+No2kLXi9faxM4c/cg/zo+ ARWVfVhFuf+3NmXYrpPV/n5YKHhVK1oYvZqYIemgR1ITG8gKTgVIT3pbULEQUOnEbCFv H3Hw== X-Gm-Message-State: AC+VfDziEbq2GFymWXJGdrR50jSJRoRrwzHGJE9Z6Vzm+ksyi5p0gG7D WanGialmHfax75hMgMW5eq1j1jNBA3E0oJN9gu9/Vg== X-Google-Smtp-Source: ACHHUZ7I8KOHv+9YuHLchveo3AnBk9taS5yuD8e88Lb5S26TLI6mnBF4eFuikwHYM9iOJJRiw2JqKQ== X-Received: by 2002:a05:6808:152a:b0:398:5bd4:ae25 with SMTP id u42-20020a056808152a00b003985bd4ae25mr3267677oiw.31.1685533073863; Wed, 31 May 2023 04:37:53 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c1:4dd5:a09a:e097:d6b0:1baf]) by smtp.gmail.com with ESMTPSA id j125-20020acab983000000b0039600e3376asm452446oif.1.2023.05.31.04.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 04:37:53 -0700 (PDT) To: libc-alpha@sourceware.org, Andreas Schwab Subject: [PATCH v2] io: Fix F_GETLK64, F_SETLK64, and F_SETLKW64 for powerpc64 Date: Wed, 31 May 2023 08:37:49 -0300 Message-Id: <20230531113749.22479-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 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+incoming=patchwork.ozlabs.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..33fe09f218 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 __WORDSIZE == 64 +# 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. */