sbbs/fcntl-linux.h.patch

27 lines
1001 B
Diff

diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
index 7e5b0aecdcb4..5a4aad0698b8 100644
--- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
+++ b/usr/include/arm-linux-gnueabihf/bits/fcntl-linux.h
@@ -127,11 +127,17 @@
This means that they are inherited across fork or clone with CLONE_FILES
like BSD (flock) locks, and they are only released automatically when the
last reference to the the file description against which they were acquired
- is put. */
+ is put.
+
+ Note that Linux does not support legacy (non-LFS) struct flock on 32-bit
+ arches with OFD locks. On those arches you need define both _GNU_SOURCE
+ and _FILE_OFFSET_BITS=64. */
#ifdef __USE_GNU
-# define F_OFD_GETLK 36
-# define F_OFD_SETLK 37
-# define F_OFD_SETLKW 38
+# if __OFF_T_MATCHES_OFF64_T || defined __USE_FILE_OFFSET64
+# define F_OFD_GETLK 36
+# define F_OFD_SETLK 37
+# define F_OFD_SETLKW 38
+# endif
#endif
#ifdef __USE_LARGEFILE64