brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 74d406f Raw
109 lines · c
1//===-- Definition of macros from fcntl.h ---------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_LIBC_MACROS_LINUX_FCNTL_MACROS_H10#define LLVM_LIBC_MACROS_LINUX_FCNTL_MACROS_H11 12// File creation flags13#define O_CLOEXEC 0200000014#define O_CREAT 0000010015#define O_PATH 01000000016 17#ifdef __aarch64__18#define O_DIRECTORY 04000019#else20#define O_DIRECTORY 0020000021#endif22 23#define O_EXCL 0000020024#define O_NOCTTY 0000040025 26#ifdef __aarch64__27#define O_NOFOLLOW 010000028#else29#define O_NOFOLLOW 0040000030#endif31 32#define O_TRUNC 0000100033#define O_TMPFILE (020000000 | O_DIRECTORY)34 35// File status flags36#define O_APPEND 0000200037#define O_DSYNC 0001000038#define O_NONBLOCK 0000400039#define O_SYNC 04000000 | O_DSYNC40 41// File access mode mask42#define O_ACCMODE 0000000343 44// File access mode flags45#define O_RDONLY 0000000046#define O_RDWR 0000000247#define O_WRONLY 0000000148 49// Special directory FD to indicate that the path argument to50// openat is relative to the current directory.51#define AT_FDCWD -10052 53// Special flag to the function unlinkat to indicate that it54// has to perform the equivalent of "rmdir" on the path argument.55#define AT_REMOVEDIR 0x20056 57// Special flag for functions like lstat to convey that symlinks58// should not be followed.59#define AT_SYMLINK_NOFOLLOW 0x10060 61// Allow empty relative pathname.62#define AT_EMPTY_PATH 0x100063 64// Perform access checks using the effective user and group IDs.65#define AT_EACCESS 0x20066 67// Values of SYS_fcntl commands.68#define F_DUPFD 069#define F_GETFD 170#define F_SETFD 271#define F_GETFL 372#define F_SETFL 473#define F_GETLK 574#define F_SETLK 675#define F_SETLKW 776#define F_SETOWN 877#define F_GETOWN 978#define F_SETSIG 1079#define F_GETSIG 1180#define F_GETLK64 1281#define F_SETLK64 1382#define F_SETLKW64 1483#define F_SETOWN_EX 1584#define F_GETOWN_EX 1685 86// Open File Description Locks.87#define F_OFD_GETLK 3688#define F_OFD_SETLK 3789#define F_OFD_SETLKW 3890 91// Close on succesful92#define F_CLOEXEC 193 94// Close on execute for fcntl.95#define FD_CLOEXEC 196 97#define F_RDLCK 098#define F_WRLCK 199#define F_UNLCK 2100 101// For Large File Support102#if defined(_LARGEFILE64_SOURCE)103#define F_GETLK F_GETLK64104#define F_SETLK F_SETLK64105#define F_SETLKW F_SETLKW64106#endif107 108#endif // LLVM_LIBC_MACROS_LINUX_FCNTL_MACROS_H109