fcntl: define F_GETLK, F_SETLK, F_SETLKW to 64-bit versions if __OFF_T_MATCHES_OFF64_T is enabled

Message ID 1476203966-23614-1-git-send-email-ynorov@caviumnetworks.com
State New, archived
Headers

Commit Message

Yury Norov Oct. 11, 2016, 4:39 p.m. UTC
  If __OFF_T_MATCHES_OFF64_T is enabled, the behavior of sys_fcntl should
be the same as if __USE_FILE_OFFSET64 is enabled. This patch adds
required definitions.

Tested with aarch64/lp64 and aarch64/ilp32

	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h: define F_GETLK,
	  F_SETLK, F_SETLKW to 64-bit versions depending on
	  __OFF_T_MATCHES_OFF64_T

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 sysdeps/unix/sysv/linux/bits/fcntl-linux.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Yury Norov Oct. 25, 2016, 9:02 p.m. UTC | #1
On Tue, Oct 11, 2016 at 07:39:26PM +0300, Yury Norov wrote:
> If __OFF_T_MATCHES_OFF64_T is enabled, the behavior of sys_fcntl should
> be the same as if __USE_FILE_OFFSET64 is enabled. This patch adds
> required definitions.
> 
> Tested with aarch64/lp64 and aarch64/ilp32
> 
> 	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h: define F_GETLK,
> 	  F_SETLK, F_SETLKW to 64-bit versions depending on
> 	  __OFF_T_MATCHES_OFF64_T
> 
> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> ---

Ping?
  

Patch

diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
index 7e5b0ae..2e84835 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) && !defined (__OFF_T_MATCHES_OFF64_T)
 #  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).	*/