From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com [IPv6:2607:f8b0:4864:20::c36]) by sourceware.org (Postfix) with ESMTPS id 199203858D20 for ; Wed, 31 May 2023 18:44:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 199203858D20 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-oo1-xc36.google.com with SMTP id 006d021491bc7-5552f7a9bc5so28417eaf.1 for ; Wed, 31 May 2023 11:44:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685558667; x=1688150667; 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=Uuzva85PkkWFlL64OvqjUAH7y6elT6hXCsxCJZelm3HVe+prKoA84xIBhMa6mlov31 A3WAWnQXZ0aPvS97EghGiQTXalfEbKaVEQdO7g5RXrkprBUicI85eABb/iQFEaOvT1o1 dd/ob4YV0BWE+1ZN6trI/ky+UEGnnDzCjTCeZkXUUThN0dnSxfSYBYJGDbnozfB6dlnG eQMVLIwZ0e6BHosKQX/jRu940jwjM8rytJZ6W7n+4ezjYqtyxGqsNbYmLDBBqJe8cnPz Y6Hl0rx2Hbj4MyutpERY+g9QiaLbVnciydfE3rjtN0btaNNqx3Uz1bwA+xDy7uAJATTS BXbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685558667; x=1688150667; 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=cqFVovZPifod0+kPb7TDi+OrlhTRJ96PWD7yX/yL8ckTyEzgPVDCeWQBFzbTXqjJQs lzhfC6PfStd8VXO3GHt1IyfoeFzUalj746iKXvYtei6dwGFDmmhmsdEike9Gonjb2Xvp 1/2VqIGxju/hUKPrgUM8QS89kDRrbGmyZ+jMZBu+efreNj5fb+HvYq4nZCpSe6w7hMQu HB9btTYeMfDPvqGw9zcJdjHr384WW4hfi7Jm4gHJRosHnM8U2w0l3Duc5zz2Y1+USs8T YTEr9+VMyjERP2VGgwY6n63Z/I4PUGF2wdbX/uNvVHnvQvjaAK2LaWEu3vMk7gLAkGX6 miFg== X-Gm-Message-State: AC+VfDwHdh13tYvX5bmSyJlzzOoDG5QnDkGBzaUGXn5wZFfSo9Sr3Pjr EpnVn7tTtquqza/PF4MiMBiQPAOsz1v27cyqqX7qHg== X-Google-Smtp-Source: ACHHUZ7bgnURMX0Xs8cw9oLf31HY4Ol+fC+/lsoYW/EZfKZtgjLHubsWTvpqQvq8de4qfN+HwNxqLA== X-Received: by 2002:a4a:3787:0:b0:555:5307:1e5f with SMTP id r129-20020a4a3787000000b0055553071e5fmr3329680oor.1.1685558666856; Wed, 31 May 2023 11:44:26 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c1:4dd5:a09a:e097:d6b0:1baf]) by smtp.gmail.com with ESMTPSA id j26-20020a4ad6da000000b00529cc3986c8sm6439698oot.40.2023.05.31.11.44.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 11:44:26 -0700 (PDT) From: Adhemerval Zanella To: libc-stable@sourceware.org Subject: [COMMITTED 2.36] io: Fix F_GETLK, F_SETLK, and F_SETLKW for powerpc64 Date: Wed, 31 May 2023 15:44:22 -0300 Message-Id: <20230531184422.4178097-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