blob: 76ce329e656d1eaca5a6d6792f97d3c067fa37c6 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_FCNTL_H
2#define _LINUX_FCNTL_H
3
David Howells607ca462012-10-13 10:46:48 +01004#include <uapi/linux/fcntl.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
Yoav Zachef3daed2005-06-23 00:09:58 -07007#ifndef force_o_largefile
8#define force_o_largefile() (BITS_PER_LONG != 32)
9#endif
10
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#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 Torvalds1da177e2005-04-16 15:20:36 -070031#endif