about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-05-24 16:24:19 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-05-30 09:43:17 -0300
commit53b58a681d62ec3eadae331326ddcc71fdf1e32a (patch)
treeb2d9e33b74b21bd93912a8cad102614012c7d7be /sysdeps
parent93bd77104cdd7380823d80c778776d2eafb69a91 (diff)
downloadglibc-53b58a681d62ec3eadae331326ddcc71fdf1e32a.tar.gz
glibc-53b58a681d62ec3eadae331326ddcc71fdf1e32a.tar.xz
glibc-53b58a681d62ec3eadae331326ddcc71fdf1e32a.zip
io: Fix record locking contants on 32 bit arch with 64 bit default time_t (BZ#30477)
For architecture with default 64 bit time_t support, the kernel
does not provide LFS and non-LFS values for F_GETLK, F_GETLK, and
F_GETLK (the default value used for 64 bit architecture are used).

This is might be considered an ABI break, but the currenct exported
values is bogus anyway.

The POSIX lockf is not affected since it is aliased to lockf64,
which already uses the LFS values.

Checked on i686-linux-gnu and the new tests on a riscv32.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 4d0fe291aed3a476a3b59c4ecfae9d35ac0f15e8)
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/bits/fcntl-linux.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
index 33ff88ce59..bfc674235d 100644
--- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
+++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
@@ -101,7 +101,7 @@
 #endif
 
 #ifndef F_GETLK
-# ifndef __USE_FILE_OFFSET64
+# if !defined __USE_FILE_OFFSET64 && __TIMESIZE != 64
 #  define F_GETLK	5	/* Get record locking info.  */
 #  define F_SETLK	6	/* Set record locking info (non-blocking).  */
 #  define F_SETLKW	7	/* Set record locking info (blocking).  */