SHA256
1
0
forked from pool/glibc
glibc/powerpc64-fcntl-lock.patch
Andreas Schwab 98df90238a Accepting request 1098077 from home:Andreas_Schwab:Factory
- gshadow-erange-rhandling.patch: gshadow: Matching sgetsgent, sgetsgent_r
  ERANGE handling (BZ #30151)
- system-sigchld-block.patch: posix: Fix system blocks SIGCHLD erroneously
  (BZ #30163)
- gmon-buffer-alloc.patch: gmon: Fix allocated buffer overflow (BZ #29444)
- check-pf-cancel-handler.patch: __check_pf: Add a cancellation cleanup
  handler (BZ #20975)
- powerpc64-fcntl-lock.patch: io: Fix F_GETLK, F_SETLK, and F_SETLKW for
  powerpc64
- realloc-limit-chunk-reuse.patch: realloc: Limit chunk reuse to only
  growing requests (BZ #30579)
- dl-find-object-return.patch: elf: _dl_find_object may return 1 during
  early startup (BZ #30515)

- Need to build with GCC 12 as minimum

- fix-locking-in-_IO_cleanup.patch: Update to final version

OBS-URL: https://build.opensuse.org/request/show/1098077
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=655
2023-07-11 07:54:23 +00:00

45 lines
1.5 KiB
Diff

From 5f828ff824e3b7cd133ef905b8ae25ab8a8f3d66 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue, 30 May 2023 16:40:38 -0300
Subject: [PATCH] io: Fix F_GETLK, F_SETLK, and F_SETLKW for powerpc64
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 | 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 0905cd833c..f7615a447e 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.41.0