Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _LINUX_FCNTL_H |
| 2 | #define _LINUX_FCNTL_H |
| 3 | |
| 4 | #include <asm/fcntl.h> |
| 5 | |
Ulrich Drepper | 22d2b35 | 2007-10-16 23:30:26 -0700 | [diff] [blame] | 6 | #define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0) |
| 7 | #define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1) |
Marc Eshel | 9b9d2ab | 2007-01-18 17:52:58 -0500 | [diff] [blame] | 8 | |
Ulrich Drepper | 22d2b35 | 2007-10-16 23:30:26 -0700 | [diff] [blame] | 9 | /* |
| 10 | * Cancel a blocking posix lock; internal use only until we expose an |
| 11 | * asynchronous lock api to userspace: |
| 12 | */ |
| 13 | #define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5) |
| 14 | |
| 15 | /* Create a file descriptor with FD_CLOEXEC set. */ |
| 16 | #define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | |
| 18 | /* |
| 19 | * Request nofications on a directory. |
| 20 | * See below for events that may be notified. |
| 21 | */ |
| 22 | #define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2) |
| 23 | |
| 24 | /* |
| 25 | * Types of directory notifications that may be requested. |
| 26 | */ |
| 27 | #define DN_ACCESS 0x00000001 /* File accessed */ |
| 28 | #define DN_MODIFY 0x00000002 /* File modified */ |
| 29 | #define DN_CREATE 0x00000004 /* File created */ |
| 30 | #define DN_DELETE 0x00000008 /* File removed */ |
| 31 | #define DN_RENAME 0x00000010 /* File renamed */ |
| 32 | #define DN_ATTRIB 0x00000020 /* File changed attibutes */ |
| 33 | #define DN_MULTISHOT 0x80000000 /* Don't remove notifier */ |
| 34 | |
Ulrich Drepper | 5590ff0 | 2006-01-18 17:43:53 -0800 | [diff] [blame] | 35 | #define AT_FDCWD -100 /* Special value used to indicate |
| 36 | openat should use the current |
| 37 | working directory. */ |
| 38 | #define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */ |
| 39 | #define AT_REMOVEDIR 0x200 /* Remove directory instead of |
| 40 | unlinking file. */ |
Ulrich Drepper | 45c9b11a | 2006-06-25 05:49:11 -0700 | [diff] [blame] | 41 | #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ |
Ulrich Drepper | 5590ff0 | 2006-01-18 17:43:53 -0800 | [diff] [blame] | 42 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | #ifdef __KERNEL__ |
| 44 | |
Yoav Zach | ef3daed | 2005-06-23 00:09:58 -0700 | [diff] [blame] | 45 | #ifndef force_o_largefile |
| 46 | #define force_o_largefile() (BITS_PER_LONG != 32) |
| 47 | #endif |
| 48 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | #if BITS_PER_LONG == 32 |
| 50 | #define IS_GETLK32(cmd) ((cmd) == F_GETLK) |
| 51 | #define IS_SETLK32(cmd) ((cmd) == F_SETLK) |
| 52 | #define IS_SETLKW32(cmd) ((cmd) == F_SETLKW) |
| 53 | #define IS_GETLK64(cmd) ((cmd) == F_GETLK64) |
| 54 | #define IS_SETLK64(cmd) ((cmd) == F_SETLK64) |
| 55 | #define IS_SETLKW64(cmd) ((cmd) == F_SETLKW64) |
| 56 | #else |
| 57 | #define IS_GETLK32(cmd) (0) |
| 58 | #define IS_SETLK32(cmd) (0) |
| 59 | #define IS_SETLKW32(cmd) (0) |
| 60 | #define IS_GETLK64(cmd) ((cmd) == F_GETLK) |
| 61 | #define IS_SETLK64(cmd) ((cmd) == F_SETLK) |
| 62 | #define IS_SETLKW64(cmd) ((cmd) == F_SETLKW) |
| 63 | #endif /* BITS_PER_LONG == 32 */ |
| 64 | |
| 65 | #define IS_GETLK(cmd) (IS_GETLK32(cmd) || IS_GETLK64(cmd)) |
| 66 | #define IS_SETLK(cmd) (IS_SETLK32(cmd) || IS_SETLK64(cmd)) |
| 67 | #define IS_SETLKW(cmd) (IS_SETLKW32(cmd) || IS_SETLKW64(cmd)) |
| 68 | |
| 69 | #endif /* __KERNEL__ */ |
| 70 | |
| 71 | #endif |