linux/include/uapi/linux/fcntl.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_LINUX_FCNTL_H
#define _UAPI_LINUX_FCNTL_H

#include <asm/fcntl.h>
#include <linux/openat2.h>

#define F_SETLEASE
#define F_GETLEASE

/*
 * Request nofications on a directory.
 * See below for events that may be notified.
 */
#define F_NOTIFY

#define F_DUPFD_QUERY

/*
 * Cancel a blocking posix lock; internal use only until we expose an
 * asynchronous lock api to userspace:
 */
#define F_CANCELLK

/* Create a file descriptor with FD_CLOEXEC set. */
#define F_DUPFD_CLOEXEC

/*
 * Set and get of pipe page size array
 */
#define F_SETPIPE_SZ
#define F_GETPIPE_SZ

/*
 * Set/Get seals
 */
#define F_ADD_SEALS
#define F_GET_SEALS

/*
 * Types of seals
 */
#define F_SEAL_SEAL
#define F_SEAL_SHRINK
#define F_SEAL_GROW
#define F_SEAL_WRITE
#define F_SEAL_FUTURE_WRITE
#define F_SEAL_EXEC
/* (1U << 31) is reserved for signed error codes */

/*
 * Set/Get write life time hints. {GET,SET}_RW_HINT operate on the
 * underlying inode, while {GET,SET}_FILE_RW_HINT operate only on
 * the specific file.
 */
#define F_GET_RW_HINT
#define F_SET_RW_HINT
#define F_GET_FILE_RW_HINT
#define F_SET_FILE_RW_HINT

/*
 * Valid hint values for F_{GET,SET}_RW_HINT. 0 is "not set", or can be
 * used to clear any hints previously set.
 */
#define RWH_WRITE_LIFE_NOT_SET
#define RWH_WRITE_LIFE_NONE
#define RWH_WRITE_LIFE_SHORT
#define RWH_WRITE_LIFE_MEDIUM
#define RWH_WRITE_LIFE_LONG
#define RWH_WRITE_LIFE_EXTREME

/*
 * The originally introduced spelling is remained from the first
 * versions of the patch set that introduced the feature, see commit
 * v4.13-rc1~212^2~51.
 */
#define RWF_WRITE_LIFE_NOT_SET

/*
 * Types of directory notifications that may be requested.
 */
#define DN_ACCESS
#define DN_MODIFY
#define DN_CREATE
#define DN_DELETE
#define DN_RENAME
#define DN_ATTRIB
#define DN_MULTISHOT

/*
 * The constants AT_REMOVEDIR and AT_EACCESS have the same value.  AT_EACCESS is
 * meaningful only to faccessat, while AT_REMOVEDIR is meaningful only to
 * unlinkat.  The two functions do completely different things and therefore,
 * the flags can be allowed to overlap.  For example, passing AT_REMOVEDIR to
 * faccessat would be undefined behavior and thus treating it equivalent to
 * AT_EACCESS is valid undefined behavior.
 */
#define AT_FDCWD
#define AT_SYMLINK_NOFOLLOW
#define AT_EACCESS
#define AT_REMOVEDIR
#define AT_SYMLINK_FOLLOW
#define AT_NO_AUTOMOUNT
#define AT_EMPTY_PATH

#define AT_STATX_SYNC_TYPE
#define AT_STATX_SYNC_AS_STAT
#define AT_STATX_FORCE_SYNC
#define AT_STATX_DONT_SYNC

#define AT_RECURSIVE

/* Flags for name_to_handle_at(2). We reuse AT_ flag space to save bits... */
#define AT_HANDLE_FID
#if defined(__KERNEL__)
#define AT_GETATTR_NOSEC
#endif

#endif /* _UAPI_LINUX_FCNTL_H */