klibc-bot for Ben Hutchings
2019-Jan-18 19:36 UTC
[klibc] [klibc:master] fcntl: Fix file locking numbers for 64-bit architectures
Commit-ID: 3cb3ceea23ecbf2c804bf732e8234552d097b94f Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=3cb3ceea23ecbf2c804bf732e8234552d097b94f Author: Ben Hutchings <ben at decadent.org.uk> AuthorDate: Fri, 18 Jan 2019 18:39:21 +0000 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Fri, 18 Jan 2019 18:46:45 +0000 [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 at decadent.org.uk> --- usr/include/fcntl.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr/include/fcntl.h b/usr/include/fcntl.h index 16128f8..b08c7c8 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, ...);