Path: blob/main/contrib/llvm-project/libc/include/llvm-libc-macros/linux/fcntl-macros.h
213799 views
//===-- Definition of macros from fcntl.h ---------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_LIBC_MACROS_LINUX_FCNTL_MACROS_H9#define LLVM_LIBC_MACROS_LINUX_FCNTL_MACROS_H1011// File creation flags12#define O_CLOEXEC 0200000013#define O_CREAT 0000010014#define O_PATH 0100000001516#ifdef __aarch64__17#define O_DIRECTORY 04000018#else19#define O_DIRECTORY 0020000020#endif2122#define O_EXCL 0000020023#define O_NOCTTY 000004002425#ifdef __aarch64__26#define O_NOFOLLOW 010000027#else28#define O_NOFOLLOW 0040000029#endif3031#define O_TRUNC 0000100032#define O_TMPFILE (020000000 | O_DIRECTORY)3334// File status flags35#define O_APPEND 0000200036#define O_DSYNC 0001000037#define O_NONBLOCK 0000400038#define O_SYNC 04000000 | O_DSYNC3940// File access mode mask41#define O_ACCMODE 000000034243// File access mode flags44#define O_RDONLY 0000000045#define O_RDWR 0000000246#define O_WRONLY 000000014748// Special directory FD to indicate that the path argument to49// openat is relative to the current directory.50#define AT_FDCWD -1005152// Special flag to the function unlinkat to indicate that it53// has to perform the equivalent of "rmdir" on the path argument.54#define AT_REMOVEDIR 0x2005556// Special flag for functions like lstat to convey that symlinks57// should not be followed.58#define AT_SYMLINK_NOFOLLOW 0x1005960// Allow empty relative pathname.61#define AT_EMPTY_PATH 0x10006263// Values of SYS_fcntl commands.64#define F_DUPFD 065#define F_GETFD 166#define F_SETFD 267#define F_GETFL 368#define F_SETFL 469#define F_GETLK 570#define F_SETLK 671#define F_SETLKW 772#define F_SETOWN 873#define F_GETOWN 974#define F_SETSIG 1075#define F_GETSIG 1176#define F_GETLK64 1277#define F_SETLK64 1378#define F_SETLKW64 1479#define F_SETOWN_EX 1580#define F_GETOWN_EX 168182// Open File Description Locks.83#define F_OFD_GETLK 3684#define F_OFD_SETLK 3785#define F_OFD_SETLKW 388687// Close on succesful88#define F_CLOEXEC 18990// Close on execute for fcntl.91#define FD_CLOEXEC 19293#define F_RDLCK 094#define F_WRLCK 195#define F_UNLCK 29697// For Large File Support98#if defined(_LARGEFILE64_SOURCE)99#define F_GETLK F_GETLK64100#define F_SETLK F_SETLK64101#define F_SETLKW F_SETLKW64102#endif103104#endif // LLVM_LIBC_MACROS_LINUX_FCNTL_MACROS_H105106107