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