aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2019-01-18 18:39:21 +0000
committerBen Hutchings <ben@decadent.org.uk>2019-01-18 18:46:45 +0000
commit3cb3ceea23ecbf2c804bf732e8234552d097b94f (patch)
treee2f34beee8c75d07bbba3ef47034c9935c030587
parentc8fc455bb5667c97e21a76621ae8317e1bf0ad24 (diff)
downloadklibc-3cb3ceea23ecbf2c804bf732e8234552d097b94f.tar.gz
[klibc] fcntl: Fix file locking numbers for 64-bit architectures
On 64-bit architectures F_{GETLK,SETLK{,W}}64 are *not* aliases for the non-64 fcntl numbers and are not implemented at all. Only use them in 32-bit configurations. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--usr/include/fcntl.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr/include/fcntl.h b/usr/include/fcntl.h
index 16128f83e42296..b08c7c8c60eeba 100644
--- a/usr/include/fcntl.h
+++ b/usr/include/fcntl.h
@@ -13,6 +13,9 @@
# include <klibc/archfcntl.h>
#endif
#include <linux/fcntl.h>
+#include <bitsize.h>
+
+#if _BITSIZE == 32
/* This is ugly, but "struct flock" has actually been defined with
a long off_t, so it's really "struct flock64". It just happens
@@ -35,6 +38,8 @@
# define F_SETLKW F_SETLKW64
#endif
+#endif /* _BITSIZE == 32 */
+
/* This is defined here as well as in <unistd.h> */
#ifndef _KLIBC_IN_OPEN_C
__extern int open(const char *, int, ...);