Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _UAPI_LINUX_FCNTL_H
0003 #define _UAPI_LINUX_FCNTL_H
0004 
0005 #include <asm/fcntl.h>
0006 #include <linux/openat2.h>
0007 
0008 #define F_SETLEASE  (F_LINUX_SPECIFIC_BASE + 0)
0009 #define F_GETLEASE  (F_LINUX_SPECIFIC_BASE + 1)
0010 
0011 /*
0012  * Cancel a blocking posix lock; internal use only until we expose an
0013  * asynchronous lock api to userspace:
0014  */
0015 #define F_CANCELLK  (F_LINUX_SPECIFIC_BASE + 5)
0016 
0017 /* Create a file descriptor with FD_CLOEXEC set. */
0018 #define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
0019 
0020 /*
0021  * Request nofications on a directory.
0022  * See below for events that may be notified.
0023  */
0024 #define F_NOTIFY    (F_LINUX_SPECIFIC_BASE+2)
0025 
0026 /*
0027  * Set and get of pipe page size array
0028  */
0029 #define F_SETPIPE_SZ    (F_LINUX_SPECIFIC_BASE + 7)
0030 #define F_GETPIPE_SZ    (F_LINUX_SPECIFIC_BASE + 8)
0031 
0032 /*
0033  * Set/Get seals
0034  */
0035 #define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
0036 #define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
0037 
0038 /*
0039  * Types of seals
0040  */
0041 #define F_SEAL_SEAL 0x0001  /* prevent further seals from being set */
0042 #define F_SEAL_SHRINK   0x0002  /* prevent file from shrinking */
0043 #define F_SEAL_GROW 0x0004  /* prevent file from growing */
0044 #define F_SEAL_WRITE    0x0008  /* prevent writes */
0045 #define F_SEAL_FUTURE_WRITE 0x0010  /* prevent future writes while mapped */
0046 /* (1U << 31) is reserved for signed error codes */
0047 
0048 /*
0049  * Set/Get write life time hints. {GET,SET}_RW_HINT operate on the
0050  * underlying inode, while {GET,SET}_FILE_RW_HINT operate only on
0051  * the specific file.
0052  */
0053 #define F_GET_RW_HINT       (F_LINUX_SPECIFIC_BASE + 11)
0054 #define F_SET_RW_HINT       (F_LINUX_SPECIFIC_BASE + 12)
0055 #define F_GET_FILE_RW_HINT  (F_LINUX_SPECIFIC_BASE + 13)
0056 #define F_SET_FILE_RW_HINT  (F_LINUX_SPECIFIC_BASE + 14)
0057 
0058 /*
0059  * Valid hint values for F_{GET,SET}_RW_HINT. 0 is "not set", or can be
0060  * used to clear any hints previously set.
0061  */
0062 #define RWH_WRITE_LIFE_NOT_SET  0
0063 #define RWH_WRITE_LIFE_NONE 1
0064 #define RWH_WRITE_LIFE_SHORT    2
0065 #define RWH_WRITE_LIFE_MEDIUM   3
0066 #define RWH_WRITE_LIFE_LONG 4
0067 #define RWH_WRITE_LIFE_EXTREME  5
0068 
0069 /*
0070  * The originally introduced spelling is remained from the first
0071  * versions of the patch set that introduced the feature, see commit
0072  * v4.13-rc1~212^2~51.
0073  */
0074 #define RWF_WRITE_LIFE_NOT_SET  RWH_WRITE_LIFE_NOT_SET
0075 
0076 /*
0077  * Types of directory notifications that may be requested.
0078  */
0079 #define DN_ACCESS   0x00000001  /* File accessed */
0080 #define DN_MODIFY   0x00000002  /* File modified */
0081 #define DN_CREATE   0x00000004  /* File created */
0082 #define DN_DELETE   0x00000008  /* File removed */
0083 #define DN_RENAME   0x00000010  /* File renamed */
0084 #define DN_ATTRIB   0x00000020  /* File changed attibutes */
0085 #define DN_MULTISHOT    0x80000000  /* Don't remove notifier */
0086 
0087 /*
0088  * The constants AT_REMOVEDIR and AT_EACCESS have the same value.  AT_EACCESS is
0089  * meaningful only to faccessat, while AT_REMOVEDIR is meaningful only to
0090  * unlinkat.  The two functions do completely different things and therefore,
0091  * the flags can be allowed to overlap.  For example, passing AT_REMOVEDIR to
0092  * faccessat would be undefined behavior and thus treating it equivalent to
0093  * AT_EACCESS is valid undefined behavior.
0094  */
0095 #define AT_FDCWD        -100    /* Special value used to indicate
0096                                            openat should use the current
0097                                            working directory. */
0098 #define AT_SYMLINK_NOFOLLOW 0x100   /* Do not follow symbolic links.  */
0099 #define AT_EACCESS      0x200   /* Test access permitted for
0100                                            effective IDs, not real IDs.  */
0101 #define AT_REMOVEDIR        0x200   /* Remove directory instead of
0102                                            unlinking file.  */
0103 #define AT_SYMLINK_FOLLOW   0x400   /* Follow symbolic links.  */
0104 #define AT_NO_AUTOMOUNT     0x800   /* Suppress terminal automount traversal */
0105 #define AT_EMPTY_PATH       0x1000  /* Allow empty relative pathname */
0106 
0107 #define AT_STATX_SYNC_TYPE  0x6000  /* Type of synchronisation required from statx() */
0108 #define AT_STATX_SYNC_AS_STAT   0x0000  /* - Do whatever stat() does */
0109 #define AT_STATX_FORCE_SYNC 0x2000  /* - Force the attributes to be sync'd with the server */
0110 #define AT_STATX_DONT_SYNC  0x4000  /* - Don't sync attributes with the server */
0111 
0112 #define AT_RECURSIVE        0x8000  /* Apply to the entire subtree */
0113 
0114 #endif /* _UAPI_LINUX_FCNTL_H */