Change owner of Hexagon backend
[llvm-project.git] / libc / include / llvm-libc-macros / linux / fcntl-macros.h
blobcdd1cf22d7b69cbdc0d128d86651feef4278c7db
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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef __LLVM_LIBC_MACROS_LINUX_FCNTL_MACROS_H
10 #define __LLVM_LIBC_MACROS_LINUX_FCNTL_MACROS_H
12 // File creation flags
13 #define O_CLOEXEC 02000000
14 #define O_CREAT 00000100
15 #define O_PATH 010000000
17 #ifdef __aarch64__
18 #define O_DIRECTORY 040000
19 #else
20 #define O_DIRECTORY 00200000
21 #endif
23 #define O_EXCL 00000200
24 #define O_NOCTTY 00000400
26 #ifdef __aarch64__
27 #define O_NOFOLLOW 0100000
28 #else
29 #define O_NOFOLLOW 00400000
30 #endif
32 #define O_TRUNC 00001000
33 #define O_TMPFILE (020000000 | O_DIRECTORY)
35 // File status flags
36 #define O_APPEND 00002000
37 #define O_DSYNC 00010000
38 #define O_NONBLOCK 00004000
39 #define O_SYNC 04000000 | O_DSYNC
41 // File access mode mask
42 #define O_ACCMODE 00000003
44 // File access mode flags
45 #define O_RDONLY 00000000
46 #define O_RDWR 00000002
47 #define O_WRONLY 00000001
49 // File mode flags
50 #define S_IRWXU 0700
51 #define S_IRUSR 0400
52 #define S_IWUSR 0200
53 #define S_IXUSR 0100
54 #define S_IRWXG 070
55 #define S_IRGRP 040
56 #define S_IWGRP 020
57 #define S_IXGRP 010
58 #define S_IRWXO 07
59 #define S_IROTH 04
60 #define S_IWOTH 02
61 #define S_IXOTH 01
62 #define S_ISUID 04000
63 #define S_ISGID 02000
65 // File type flags
66 #define S_IFMT 0170000
67 #define S_IFDIR 0040000
68 #define S_IFCHR 0020000
69 #define S_IFBLK 0060000
70 #define S_IFREG 0100000
71 #define S_FIFO 0010000
72 #define S_IFLNK 0120000
74 // Special directory FD to indicate that the path argument to
75 // openat is relative to the current directory.
76 #define AT_FDCWD -100
78 // Special flag to the function unlinkat to indicate that it
79 // has to perform the equivalent of "rmdir" on the path argument.
80 #define AT_REMOVEDIR 0x200
82 // Special flag for functions like lstat to convey that symlinks
83 // should not be followed.
84 #define AT_SYMLINK_NOFOLLOW 0x100
86 // Allow empty relative pathname.
87 #define AT_EMPTY_PATH 0x1000
89 // Values of SYS_fcntl commands.
90 #define F_DUPFD 0
91 #define F_GETFD 1
92 #define F_SETFD 2
93 #define F_GETFL 3
94 #define F_SETFL 4
96 #endif // __LLVM_LIBC_MACROS_LINUX_FCNTL_MACROS_H