Mercurial > projects > ldc
comparison druntime/import/stdc/posix/fcntl.d @ 760:6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 12 Nov 2008 00:19:18 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
759:d3eb054172f9 | 760:6f33b427bfd1 |
---|---|
1 /** | |
2 * D header file for POSIX. | |
3 * | |
4 * Copyright: Public Domain | |
5 * License: Public Domain | |
6 * Authors: Sean Kelly | |
7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition | |
8 */ | |
9 module stdc.posix.fcntl; | |
10 | |
11 private import stdc.posix.config; | |
12 private import stdc.stdint; | |
13 public import stdc.stddef; // for size_t | |
14 public import stdc.posix.sys.types; // for off_t, mode_t | |
15 public import stdc.posix.sys.stat; // for S_IFMT, etc. | |
16 | |
17 extern (C): | |
18 | |
19 // | |
20 // Required | |
21 // | |
22 /* | |
23 F_DUPFD | |
24 F_GETFD | |
25 F_SETFD | |
26 F_GETFL | |
27 F_SETFL | |
28 F_GETLK | |
29 F_SETLK | |
30 F_SETLKW | |
31 F_GETOWN | |
32 F_SETOWN | |
33 | |
34 FD_CLOEXEC | |
35 | |
36 F_RDLCK | |
37 F_UNLCK | |
38 F_WRLCK | |
39 | |
40 O_CREAT | |
41 O_EXCL | |
42 O_NOCTTY | |
43 O_TRUNC | |
44 | |
45 O_APPEND | |
46 O_DSYNC | |
47 O_NONBLOCK | |
48 O_RSYNC | |
49 O_SYNC | |
50 | |
51 O_ACCMODE | |
52 O_RDONLY | |
53 O_RDWR | |
54 O_WRONLY | |
55 | |
56 struct flock | |
57 { | |
58 short l_type; | |
59 short l_whence; | |
60 off_t l_start; | |
61 off_t l_len; | |
62 pid_t l_pid; | |
63 } | |
64 | |
65 int creat(in char*, mode_t); | |
66 int fcntl(int, int, ...); | |
67 int open(in char*, int, ...); | |
68 */ | |
69 version( linux ) | |
70 { | |
71 const F_DUPFD = 0; | |
72 const F_GETFD = 1; | |
73 const F_SETFD = 2; | |
74 const F_GETFL = 3; | |
75 const F_SETFL = 4; | |
76 static if( __USE_FILE_OFFSET64 ) | |
77 { | |
78 const F_GETLK = 12; | |
79 const F_SETLK = 13; | |
80 const F_SETLKW = 14; | |
81 } | |
82 else | |
83 { | |
84 const F_GETLK = 5; | |
85 const F_SETLK = 6; | |
86 const F_SETLKW = 7; | |
87 } | |
88 const F_GETOWN = 9; | |
89 const F_SETOWN = 8; | |
90 | |
91 const FD_CLOEXEC = 1; | |
92 | |
93 const F_RDLCK = 0; | |
94 const F_UNLCK = 2; | |
95 const F_WRLCK = 1; | |
96 | |
97 const O_CREAT = 0100; | |
98 const O_EXCL = 0200; | |
99 const O_NOCTTY = 0400; | |
100 const O_TRUNC = 01000; | |
101 | |
102 const O_APPEND = 02000; | |
103 const O_NONBLOCK = 04000; | |
104 const O_SYNC = 010000; | |
105 const O_DSYNC = O_SYNC; | |
106 const O_RSYNC = O_SYNC; | |
107 | |
108 const O_ACCMODE = 0003; | |
109 const O_RDONLY = 00; | |
110 const O_WRONLY = 01; | |
111 const O_RDWR = 02; | |
112 | |
113 struct flock | |
114 { | |
115 short l_type; | |
116 short l_whence; | |
117 off_t l_start; | |
118 off_t l_len; | |
119 pid_t l_pid; | |
120 } | |
121 | |
122 static if( __USE_LARGEFILE64 ) | |
123 { | |
124 int creat64(in char*, mode_t); | |
125 alias creat64 creat; | |
126 | |
127 int open64(in char*, int, ...); | |
128 alias open64 open; | |
129 } | |
130 else | |
131 { | |
132 int creat(in char*, mode_t); | |
133 int open(in char*, int, ...); | |
134 } | |
135 } | |
136 else version( darwin ) | |
137 { | |
138 const F_DUPFD = 0; | |
139 const F_GETFD = 1; | |
140 const F_SETFD = 2; | |
141 const F_GETFL = 3; | |
142 const F_SETFL = 4; | |
143 const F_GETOWN = 5; | |
144 const F_SETOWN = 6; | |
145 const F_GETLK = 7; | |
146 const F_SETLK = 8; | |
147 const F_SETLKW = 9; | |
148 | |
149 const FD_CLOEXEC = 1; | |
150 | |
151 const F_RDLCK = 1; | |
152 const F_UNLCK = 2; | |
153 const F_WRLCK = 3; | |
154 | |
155 const O_CREAT = 0x0200; | |
156 const O_EXCL = 0x0800; | |
157 const O_NOCTTY = 0; | |
158 const O_TRUNC = 0x0400; | |
159 | |
160 const O_RDONLY = 0x0000; | |
161 const O_WRONLY = 0x0001; | |
162 const O_RDWR = 0x0002; | |
163 const O_ACCMODE = 0x0003; | |
164 | |
165 const O_NONBLOCK = 0x0004; | |
166 const O_APPEND = 0x0008; | |
167 const O_SYNC = 0x0080; | |
168 //const O_DSYNC | |
169 //const O_RSYNC | |
170 | |
171 struct flock | |
172 { | |
173 off_t l_start; | |
174 off_t l_len; | |
175 pid_t l_pid; | |
176 short l_type; | |
177 short l_whence; | |
178 } | |
179 | |
180 int creat(in char*, mode_t); | |
181 int open(in char*, int, ...); | |
182 } | |
183 else version( freebsd ) | |
184 { | |
185 const F_DUPFD = 0; | |
186 const F_GETFD = 1; | |
187 const F_SETFD = 2; | |
188 const F_GETFL = 3; | |
189 const F_SETFL = 4; | |
190 const F_GETOWN = 5; | |
191 const F_SETOWN = 6; | |
192 const F_GETLK = 7; | |
193 const F_SETLK = 8; | |
194 const F_SETLKW = 9; | |
195 | |
196 const FD_CLOEXEC = 1; | |
197 | |
198 const F_RDLCK = 1; | |
199 const F_UNLCK = 2; | |
200 const F_WRLCK = 3; | |
201 | |
202 const O_CREAT = 0x0200; | |
203 const O_EXCL = 0x0800; | |
204 const O_NOCTTY = 0; | |
205 const O_TRUNC = 0x0400; | |
206 | |
207 const O_RDONLY = 0x0000; | |
208 const O_WRONLY = 0x0001; | |
209 const O_RDWR = 0x0002; | |
210 const O_ACCMODE = 0x0003; | |
211 | |
212 const O_NONBLOCK = 0x0004; | |
213 const O_APPEND = 0x0008; | |
214 const O_SYNC = 0x0080; | |
215 //const O_DSYNC | |
216 //const O_RSYNC | |
217 | |
218 struct flock | |
219 { | |
220 off_t l_start; | |
221 off_t l_len; | |
222 pid_t l_pid; | |
223 short l_type; | |
224 short l_whence; | |
225 } | |
226 | |
227 int creat(in char*, mode_t); | |
228 int open(in char*, int, ...); | |
229 } | |
230 | |
231 //int creat(in char*, mode_t); | |
232 int fcntl(int, int, ...); | |
233 //int open(in char*, int, ...); | |
234 | |
235 // | |
236 // Advisory Information (ADV) | |
237 // | |
238 /* | |
239 POSIX_FADV_NORMAL | |
240 POSIX_FADV_SEQUENTIAL | |
241 POSIX_FADV_RANDOM | |
242 POSIX_FADV_WILLNEED | |
243 POSIX_FADV_DONTNEED | |
244 POSIX_FADV_NOREUSE | |
245 | |
246 int posix_fadvise(int, off_t, off_t, int); | |
247 int posix_fallocate(int, off_t, off_t); | |
248 */ |