Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _LINUX_FCNTL_H |
| 2 | #define _LINUX_FCNTL_H |
| 3 | |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 4 | #include <uapi/linux/fcntl.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | |
Yoav Zach | ef3daed | 2005-06-23 00:09:58 -0700 | [diff] [blame] | 7 | #ifndef force_o_largefile |
| 8 | #define force_o_largefile() (BITS_PER_LONG != 32) |
| 9 | #endif |
| 10 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | #if BITS_PER_LONG == 32 |
| 12 | #define IS_GETLK32(cmd) ((cmd) == F_GETLK) |
| 13 | #define IS_SETLK32(cmd) ((cmd) == F_SETLK) |
| 14 | #define IS_SETLKW32(cmd) ((cmd) == F_SETLKW) |
| 15 | #define IS_GETLK64(cmd) ((cmd) == F_GETLK64) |
| 16 | #define IS_SETLK64(cmd) ((cmd) == F_SETLK64) |
| 17 | #define IS_SETLKW64(cmd) ((cmd) == F_SETLKW64) |
| 18 | #else |
| 19 | #define IS_GETLK32(cmd) (0) |
| 20 | #define IS_SETLK32(cmd) (0) |
| 21 | #define IS_SETLKW32(cmd) (0) |
| 22 | #define IS_GETLK64(cmd) ((cmd) == F_GETLK) |
| 23 | #define IS_SETLK64(cmd) ((cmd) == F_SETLK) |
| 24 | #define IS_SETLKW64(cmd) ((cmd) == F_SETLKW) |
| 25 | #endif /* BITS_PER_LONG == 32 */ |
| 26 | |
| 27 | #define IS_GETLK(cmd) (IS_GETLK32(cmd) || IS_GETLK64(cmd)) |
| 28 | #define IS_SETLK(cmd) (IS_SETLK32(cmd) || IS_SETLK64(cmd)) |
| 29 | #define IS_SETLKW(cmd) (IS_SETLKW32(cmd) || IS_SETLKW64(cmd)) |
| 30 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | #endif |