OLD | NEW |
1 #ifndef»_FCNTL_H | 1 #ifndef _FCNTL_H |
2 #define»_FCNTL_H | 2 #define _FCNTL_H |
3 | 3 |
4 #ifdef __cplusplus | 4 #ifdef __cplusplus |
5 extern "C" { | 5 extern "C" { |
6 #endif | 6 #endif |
7 | 7 |
8 #include <features.h> | 8 #include <features.h> |
9 | 9 |
10 #define __NEED_off_t | 10 #define __NEED_off_t |
11 #define __NEED_pid_t | 11 #define __NEED_pid_t |
12 #define __NEED_mode_t | 12 #define __NEED_mode_t |
13 | 13 |
14 #ifdef _GNU_SOURCE | 14 #ifdef _GNU_SOURCE |
15 #define __NEED_size_t | 15 #define __NEED_size_t |
16 #define __NEED_ssize_t | 16 #define __NEED_ssize_t |
17 #define __NEED_struct_iovec | 17 #define __NEED_struct_iovec |
18 #endif | 18 #endif |
19 | 19 |
20 #include <bits/alltypes.h> | 20 #include <bits/alltypes.h> |
21 | 21 |
22 #include <bits/fcntl.h> | 22 #include <bits/fcntl.h> |
23 | 23 |
24 struct flock | 24 struct flock { |
25 { | 25 short l_type; |
26 » short l_type; | 26 short l_whence; |
27 » short l_whence; | 27 off_t l_start; |
28 » off_t l_start; | 28 off_t l_len; |
29 » off_t l_len; | 29 pid_t l_pid; |
30 » pid_t l_pid; | |
31 }; | 30 }; |
32 | 31 |
33 int creat(const char *, mode_t); | 32 int creat(const char*, mode_t); |
34 int fcntl(int, int, ...); | 33 int fcntl(int, int, ...); |
35 int open(const char *, int, ...); | 34 int open(const char*, int, ...); |
36 int openat(int, const char *, int, ...); | 35 int openat(int, const char*, int, ...); |
37 int posix_fadvise(int, off_t, off_t, int); | 36 int posix_fadvise(int, off_t, off_t, int); |
38 int posix_fallocate(int, off_t, off_t); | 37 int posix_fallocate(int, off_t, off_t); |
39 | 38 |
40 #define O_SEARCH O_PATH | 39 #define O_SEARCH O_PATH |
41 #define O_EXEC O_PATH | 40 #define O_EXEC O_PATH |
42 | 41 |
43 #define O_ACCMODE (03|O_SEARCH) | 42 #define O_ACCMODE (03 | O_SEARCH) |
44 #define O_RDONLY 00 | 43 #define O_RDONLY 00 |
45 #define O_WRONLY 01 | 44 #define O_WRONLY 01 |
46 #define O_RDWR 02 | 45 #define O_RDWR 02 |
47 | 46 |
48 #define F_OFD_GETLK 36 | 47 #define F_OFD_GETLK 36 |
49 #define F_OFD_SETLK 37 | 48 #define F_OFD_SETLK 37 |
50 #define F_OFD_SETLKW 38 | 49 #define F_OFD_SETLKW 38 |
51 | 50 |
52 #define F_DUPFD_CLOEXEC 1030 | 51 #define F_DUPFD_CLOEXEC 1030 |
53 | 52 |
54 #define F_RDLCK 0 | 53 #define F_RDLCK 0 |
55 #define F_WRLCK 1 | 54 #define F_WRLCK 1 |
56 #define F_UNLCK 2 | 55 #define F_UNLCK 2 |
57 | 56 |
58 #define FD_CLOEXEC 1 | 57 #define FD_CLOEXEC 1 |
59 | 58 |
60 #define AT_FDCWD (-100) | 59 #define AT_FDCWD (-100) |
61 #define AT_SYMLINK_NOFOLLOW 0x100 | 60 #define AT_SYMLINK_NOFOLLOW 0x100 |
62 #define AT_REMOVEDIR 0x200 | 61 #define AT_REMOVEDIR 0x200 |
63 #define AT_SYMLINK_FOLLOW 0x400 | 62 #define AT_SYMLINK_FOLLOW 0x400 |
64 #define AT_EACCESS 0x200 | 63 #define AT_EACCESS 0x200 |
65 | 64 |
66 #define POSIX_FADV_NORMAL 0 | 65 #define POSIX_FADV_NORMAL 0 |
67 #define POSIX_FADV_RANDOM 1 | 66 #define POSIX_FADV_RANDOM 1 |
68 #define POSIX_FADV_SEQUENTIAL 2 | 67 #define POSIX_FADV_SEQUENTIAL 2 |
69 #define POSIX_FADV_WILLNEED 3 | 68 #define POSIX_FADV_WILLNEED 3 |
70 #define POSIX_FADV_DONTNEED 4 | 69 #define POSIX_FADV_DONTNEED 4 |
71 #define POSIX_FADV_NOREUSE 5 | 70 #define POSIX_FADV_NOREUSE 5 |
72 | 71 |
73 #undef SEEK_SET | 72 #undef SEEK_SET |
74 #undef SEEK_CUR | 73 #undef SEEK_CUR |
75 #undef SEEK_END | 74 #undef SEEK_END |
76 #define SEEK_SET 0 | 75 #define SEEK_SET 0 |
77 #define SEEK_CUR 1 | 76 #define SEEK_CUR 1 |
78 #define SEEK_END 2 | 77 #define SEEK_END 2 |
79 | 78 |
80 #ifndef S_IRUSR | 79 #ifndef S_IRUSR |
81 #define S_ISUID 04000 | 80 #define S_ISUID 04000 |
(...skipping 21 matching lines...) Expand all Loading... |
103 #define FFSYNC O_FSYNC | 102 #define FFSYNC O_FSYNC |
104 #define FASYNC O_ASYNC | 103 #define FASYNC O_ASYNC |
105 #define FNONBLOCK O_NONBLOCK | 104 #define FNONBLOCK O_NONBLOCK |
106 #define FNDELAY O_NDELAY | 105 #define FNDELAY O_NDELAY |
107 | 106 |
108 #define F_OK 0 | 107 #define F_OK 0 |
109 #define R_OK 4 | 108 #define R_OK 4 |
110 #define W_OK 2 | 109 #define W_OK 2 |
111 #define X_OK 1 | 110 #define X_OK 1 |
112 #define F_ULOCK 0 | 111 #define F_ULOCK 0 |
113 #define F_LOCK 1 | 112 #define F_LOCK 1 |
114 #define F_TLOCK 2 | 113 #define F_TLOCK 2 |
115 #define F_TEST 3 | 114 #define F_TEST 3 |
116 | 115 |
117 #define F_SETLEASE» 1024 | 116 #define F_SETLEASE 1024 |
118 #define F_GETLEASE» 1025 | 117 #define F_GETLEASE 1025 |
119 #define F_NOTIFY» 1026 | 118 #define F_NOTIFY 1026 |
120 #define F_CANCELLK» 1029 | 119 #define F_CANCELLK 1029 |
121 #define F_SETPIPE_SZ» 1031 | 120 #define F_SETPIPE_SZ 1031 |
122 #define F_GETPIPE_SZ» 1032 | 121 #define F_GETPIPE_SZ 1032 |
123 #define F_ADD_SEALS» 1033 | 122 #define F_ADD_SEALS 1033 |
124 #define F_GET_SEALS» 1034 | 123 #define F_GET_SEALS 1034 |
125 | 124 |
126 #define F_SEAL_SEAL» 0x0001 | 125 #define F_SEAL_SEAL 0x0001 |
127 #define F_SEAL_SHRINK» 0x0002 | 126 #define F_SEAL_SHRINK 0x0002 |
128 #define F_SEAL_GROW» 0x0004 | 127 #define F_SEAL_GROW 0x0004 |
129 #define F_SEAL_WRITE» 0x0008 | 128 #define F_SEAL_WRITE 0x0008 |
130 | 129 |
131 #define DN_ACCESS» 0x00000001 | 130 #define DN_ACCESS 0x00000001 |
132 #define DN_MODIFY» 0x00000002 | 131 #define DN_MODIFY 0x00000002 |
133 #define DN_CREATE» 0x00000004 | 132 #define DN_CREATE 0x00000004 |
134 #define DN_DELETE» 0x00000008 | 133 #define DN_DELETE 0x00000008 |
135 #define DN_RENAME» 0x00000010 | 134 #define DN_RENAME 0x00000010 |
136 #define DN_ATTRIB» 0x00000020 | 135 #define DN_ATTRIB 0x00000020 |
137 #define DN_MULTISHOT» 0x80000000 | 136 #define DN_MULTISHOT 0x80000000 |
138 | 137 |
139 int lockf(int, int, off_t); | 138 int lockf(int, int, off_t); |
140 #endif | 139 #endif |
141 | 140 |
142 #if defined(_GNU_SOURCE) | 141 #if defined(_GNU_SOURCE) |
143 #define F_OWNER_TID 0 | 142 #define F_OWNER_TID 0 |
144 #define F_OWNER_PID 1 | 143 #define F_OWNER_PID 1 |
145 #define F_OWNER_PGRP 2 | 144 #define F_OWNER_PGRP 2 |
146 #define F_OWNER_GID 2 | 145 #define F_OWNER_GID 2 |
147 struct f_owner_ex { | 146 struct f_owner_ex { |
148 » int type; | 147 int type; |
149 » pid_t pid; | 148 pid_t pid; |
150 }; | 149 }; |
151 #define FALLOC_FL_KEEP_SIZE 1 | 150 #define FALLOC_FL_KEEP_SIZE 1 |
152 #define FALLOC_FL_PUNCH_HOLE 2 | 151 #define FALLOC_FL_PUNCH_HOLE 2 |
153 #define SYNC_FILE_RANGE_WAIT_BEFORE 1 | 152 #define SYNC_FILE_RANGE_WAIT_BEFORE 1 |
154 #define SYNC_FILE_RANGE_WRITE 2 | 153 #define SYNC_FILE_RANGE_WRITE 2 |
155 #define SYNC_FILE_RANGE_WAIT_AFTER 4 | 154 #define SYNC_FILE_RANGE_WAIT_AFTER 4 |
156 #define SPLICE_F_MOVE 1 | 155 #define SPLICE_F_MOVE 1 |
157 #define SPLICE_F_NONBLOCK 2 | 156 #define SPLICE_F_NONBLOCK 2 |
158 #define SPLICE_F_MORE 4 | 157 #define SPLICE_F_MORE 4 |
159 #define SPLICE_F_GIFT 8 | 158 #define SPLICE_F_GIFT 8 |
160 int fallocate(int, int, off_t, off_t); | 159 int fallocate(int, int, off_t, off_t); |
161 #define fallocate64 fallocate | 160 #define fallocate64 fallocate |
162 ssize_t readahead(int, off_t, size_t); | 161 ssize_t readahead(int, off_t, size_t); |
163 int sync_file_range(int, off_t, off_t, unsigned); | 162 int sync_file_range(int, off_t, off_t, unsigned); |
164 ssize_t vmsplice(int, const struct iovec *, size_t, unsigned); | 163 ssize_t vmsplice(int, const struct iovec*, size_t, unsigned); |
165 ssize_t splice(int, off_t *, int, off_t *, size_t, unsigned); | 164 ssize_t splice(int, off_t*, int, off_t*, size_t, unsigned); |
166 ssize_t tee(int, int, size_t, unsigned); | 165 ssize_t tee(int, int, size_t, unsigned); |
167 #define loff_t off_t | 166 #define loff_t off_t |
168 #endif | 167 #endif |
169 | 168 |
170 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) | 169 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) |
171 #define F_GETLK64 F_GETLK | 170 #define F_GETLK64 F_GETLK |
172 #define F_SETLK64 F_SETLK | 171 #define F_SETLK64 F_SETLK |
173 #define F_SETLKW64 F_SETLKW | 172 #define F_SETLKW64 F_SETLKW |
174 #define flock64 flock | 173 #define flock64 flock |
175 #define open64 open | 174 #define open64 open |
176 #define openat64 openat | 175 #define openat64 openat |
177 #define creat64 creat | 176 #define creat64 creat |
178 #define lockf64 lockf | 177 #define lockf64 lockf |
179 #define posix_fadvise64 posix_fadvise | 178 #define posix_fadvise64 posix_fadvise |
180 #define posix_fallocate64 posix_fallocate | 179 #define posix_fallocate64 posix_fallocate |
181 #define off64_t off_t | 180 #define off64_t off_t |
182 #endif | 181 #endif |
183 | 182 |
184 #ifdef __cplusplus | 183 #ifdef __cplusplus |
185 } | 184 } |
186 #endif | 185 #endif |
187 | 186 |
188 #endif | 187 #endif |
OLD | NEW |