llvm/libc/include/llvm-libc-macros/linux/fcntl-macros.h

//===-- Definition of macros from fcntl.h ---------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_MACROS_LINUX_FCNTL_MACROS_H
#define LLVM_LIBC_MACROS_LINUX_FCNTL_MACROS_H

// File creation flags
#define O_CLOEXEC
#define O_CREAT
#define O_PATH

#ifdef __aarch64__
#define O_DIRECTORY
#else
#define O_DIRECTORY
#endif

#define O_EXCL
#define O_NOCTTY

#ifdef __aarch64__
#define O_NOFOLLOW
#else
#define O_NOFOLLOW
#endif

#define O_TRUNC
#define O_TMPFILE

// File status flags
#define O_APPEND
#define O_DSYNC
#define O_NONBLOCK
#define O_SYNC

// File access mode mask
#define O_ACCMODE

// File access mode flags
#define O_RDONLY
#define O_RDWR
#define O_WRONLY

// Special directory FD to indicate that the path argument to
// openat is relative to the current directory.
#define AT_FDCWD

// Special flag to the function unlinkat to indicate that it
// has to perform the equivalent of "rmdir" on the path argument.
#define AT_REMOVEDIR

// Special flag for functions like lstat to convey that symlinks
// should not be followed.
#define AT_SYMLINK_NOFOLLOW

// Allow empty relative pathname.
#define AT_EMPTY_PATH

// Values of SYS_fcntl commands.
#define F_DUPFD
#define F_GETFD
#define F_SETFD
#define F_GETFL
#define F_SETFL
#define F_GETLK
#define F_SETLK
#define F_SETLKW
#define F_SETOWN
#define F_GETOWN
#define F_SETSIG
#define F_GETSIG
#define F_GETLK64
#define F_SETLK64
#define F_SETLKW64
#define F_SETOWN_EX
#define F_GETOWN_EX

// Open File Description Locks.
#define F_OFD_GETLK
#define F_OFD_SETLK
#define F_OFD_SETLKW

// Close on succesful
#define F_CLOEXEC

#define F_RDLCK
#define F_WRLCK
#define F_UNLCK

// For Large File Support
#if defined(_LARGEFILE64_SOURCE)
#define F_GETLK
#define F_SETLK
#define F_SETLKW
#endif

#endif // LLVM_LIBC_MACROS_LINUX_FCNTL_MACROS_H