]>
Commit | Line | Data |
---|---|---|
92a42be0 SL |
1 | //! Apple (ios/darwin)-specific definitions |
2 | //! | |
3 | //! This covers *-apple-* triples currently | |
4 | ||
5 | pub type clock_t = c_ulong; | |
6 | pub type time_t = c_long; | |
7 | pub type suseconds_t = i32; | |
8 | pub type dev_t = i32; | |
9 | pub type ino_t = u64; | |
10 | pub type mode_t = u16; | |
11 | pub type nlink_t = u16; | |
12 | pub type blksize_t = i32; | |
13 | pub type rlim_t = u64; | |
14 | pub type mach_timebase_info_data_t = mach_timebase_info; | |
15 | pub type pthread_key_t = c_ulong; | |
16 | pub type sigset_t = u32; | |
9cc50fc6 SL |
17 | pub type fsblkcnt_t = ::c_uint; |
18 | pub type fsfilcnt_t = ::c_uint; | |
19 | pub type speed_t = ::c_ulong; | |
20 | pub type tcflag_t = ::c_ulong; | |
92a42be0 SL |
21 | |
22 | pub enum timezone {} | |
23 | ||
24 | s! { | |
25 | pub struct glob_t { | |
26 | pub gl_pathc: ::size_t, | |
27 | __unused1: ::c_int, | |
28 | pub gl_offs: ::size_t, | |
29 | __unused2: ::c_int, | |
30 | pub gl_pathv: *mut *mut ::c_char, | |
31 | ||
32 | __unused3: *mut ::c_void, | |
33 | ||
34 | __unused4: *mut ::c_void, | |
35 | __unused5: *mut ::c_void, | |
36 | __unused6: *mut ::c_void, | |
37 | __unused7: *mut ::c_void, | |
38 | __unused8: *mut ::c_void, | |
39 | } | |
40 | ||
41 | pub struct sockaddr_storage { | |
42 | pub ss_len: u8, | |
43 | pub ss_family: ::sa_family_t, | |
44 | __ss_pad1: [u8; 6], | |
45 | __ss_align: i64, | |
46 | __ss_pad2: [u8; 112], | |
47 | } | |
48 | ||
49 | pub struct addrinfo { | |
50 | pub ai_flags: ::c_int, | |
51 | pub ai_family: ::c_int, | |
52 | pub ai_socktype: ::c_int, | |
53 | pub ai_protocol: ::c_int, | |
54 | pub ai_addrlen: ::socklen_t, | |
55 | pub ai_canonname: *mut ::c_char, | |
56 | pub ai_addr: *mut ::sockaddr, | |
57 | pub ai_next: *mut addrinfo, | |
58 | } | |
59 | ||
60 | pub struct mach_timebase_info { | |
61 | pub numer: u32, | |
62 | pub denom: u32, | |
63 | } | |
64 | ||
65 | pub struct stat { | |
66 | pub st_dev: dev_t, | |
67 | pub st_mode: mode_t, | |
68 | pub st_nlink: nlink_t, | |
69 | pub st_ino: ino_t, | |
70 | pub st_uid: ::uid_t, | |
71 | pub st_gid: ::gid_t, | |
72 | pub st_rdev: dev_t, | |
73 | pub st_atime: time_t, | |
74 | pub st_atime_nsec: c_long, | |
75 | pub st_mtime: time_t, | |
76 | pub st_mtime_nsec: c_long, | |
77 | pub st_ctime: time_t, | |
78 | pub st_ctime_nsec: c_long, | |
79 | pub st_birthtime: time_t, | |
80 | pub st_birthtime_nsec: c_long, | |
81 | pub st_size: ::off_t, | |
82 | pub st_blocks: ::blkcnt_t, | |
83 | pub st_blksize: blksize_t, | |
84 | pub st_flags: ::uint32_t, | |
85 | pub st_gen: ::uint32_t, | |
86 | pub st_lspare: ::int32_t, | |
87 | pub st_qspare: [::int64_t; 2], | |
88 | } | |
89 | ||
90 | pub struct dirent { | |
91 | pub d_ino: u64, | |
92 | pub d_seekoff: u64, | |
93 | pub d_reclen: u16, | |
94 | pub d_namlen: u16, | |
95 | pub d_type: u8, | |
96 | pub d_name: [::c_char; 1024], | |
97 | } | |
98 | ||
99 | pub struct pthread_mutex_t { | |
100 | __sig: ::c_long, | |
101 | __opaque: [u8; __PTHREAD_MUTEX_SIZE__], | |
102 | } | |
103 | ||
104 | pub struct pthread_mutexattr_t { | |
105 | __sig: ::c_long, | |
106 | __opaque: [u8; 8], | |
107 | } | |
108 | ||
109 | pub struct pthread_cond_t { | |
110 | __sig: ::c_long, | |
111 | __opaque: [u8; __PTHREAD_COND_SIZE__], | |
112 | } | |
113 | ||
114 | pub struct pthread_rwlock_t { | |
115 | __sig: ::c_long, | |
116 | __opaque: [u8; __PTHREAD_RWLOCK_SIZE__], | |
117 | } | |
118 | ||
119 | pub struct siginfo_t { | |
120 | pub si_signo: ::c_int, | |
121 | pub si_errno: ::c_int, | |
122 | pub si_code: ::c_int, | |
123 | pub si_pid: ::pid_t, | |
124 | pub si_uid: ::uid_t, | |
125 | pub si_status: ::c_int, | |
126 | pub si_addr: *mut ::c_void, | |
127 | _pad: [usize; 9], | |
128 | } | |
129 | ||
130 | pub struct sigaction { | |
131 | pub sa_sigaction: ::sighandler_t, | |
132 | pub sa_mask: sigset_t, | |
133 | pub sa_flags: ::c_int, | |
134 | } | |
135 | ||
136 | pub struct stack_t { | |
137 | pub ss_sp: *mut ::c_void, | |
138 | pub ss_size: ::size_t, | |
139 | pub ss_flags: ::c_int, | |
140 | } | |
141 | ||
142 | pub struct fstore_t { | |
143 | pub fst_flags: ::c_uint, | |
144 | pub fst_posmode: ::c_int, | |
145 | pub fst_offset: ::off_t, | |
146 | pub fst_length: ::off_t, | |
147 | pub fst_bytesalloc: ::off_t, | |
148 | } | |
149 | ||
150 | pub struct radvisory { | |
151 | pub ra_offset: ::off_t, | |
152 | pub ra_count: ::c_int, | |
153 | } | |
154 | ||
155 | pub struct statvfs { | |
156 | pub f_bsize: ::c_ulong, | |
157 | pub f_frsize: ::c_ulong, | |
158 | pub f_blocks: ::fsblkcnt_t, | |
159 | pub f_bfree: ::fsblkcnt_t, | |
160 | pub f_bavail: ::fsblkcnt_t, | |
161 | pub f_files: ::fsfilcnt_t, | |
162 | pub f_ffree: ::fsfilcnt_t, | |
163 | pub f_favail: ::fsfilcnt_t, | |
164 | pub f_fsid: ::c_ulong, | |
165 | pub f_flag: ::c_ulong, | |
166 | pub f_namemax: ::c_ulong, | |
167 | } | |
9cc50fc6 SL |
168 | |
169 | pub struct Dl_info { | |
170 | pub dli_fname: *const ::c_char, | |
171 | pub dli_fbase: *mut ::c_void, | |
172 | pub dli_sname: *const ::c_char, | |
173 | pub dli_saddr: *mut ::c_void, | |
174 | } | |
175 | ||
176 | pub struct sockaddr_in { | |
177 | pub sin_len: u8, | |
178 | pub sin_family: ::sa_family_t, | |
179 | pub sin_port: ::in_port_t, | |
180 | pub sin_addr: ::in_addr, | |
181 | pub sin_zero: [::c_char; 8], | |
182 | } | |
183 | ||
184 | pub struct statfs { | |
185 | pub f_bsize: ::uint32_t, | |
186 | pub f_iosize: ::int32_t, | |
187 | pub f_blocks: ::uint64_t, | |
188 | pub f_bfree: ::uint64_t, | |
189 | pub f_bavail: ::uint64_t, | |
190 | pub f_files: ::uint64_t, | |
191 | pub f_ffree: ::uint64_t, | |
192 | pub f_fsid: ::fsid_t, | |
193 | pub f_owner: ::uid_t, | |
194 | pub f_type: ::uint32_t, | |
195 | pub f_flags: ::uint32_t, | |
196 | pub f_fssubtype: ::uint32_t, | |
197 | pub f_fstypename: [::c_char; 16], | |
198 | pub f_mntonname: [::c_char; 1024], | |
199 | pub f_mntfromname: [::c_char; 1024], | |
200 | pub f_reserved: [::uint32_t; 8], | |
201 | } | |
202 | ||
203 | // FIXME: this should have align 4 but it's got align 8 on 64-bit | |
204 | pub struct kevent { | |
205 | pub ident: ::uintptr_t, | |
206 | pub filter: ::int16_t, | |
207 | pub flags: ::uint16_t, | |
208 | pub fflags: ::uint32_t, | |
209 | pub data: ::intptr_t, | |
210 | pub udata: *mut ::c_void, | |
211 | } | |
212 | ||
213 | pub struct kevent64_s { | |
214 | pub ident: ::uint64_t, | |
215 | pub filter: ::int16_t, | |
216 | pub flags: ::uint16_t, | |
217 | pub fflags: ::uint32_t, | |
218 | pub data: ::int64_t, | |
219 | pub udata: ::uint64_t, | |
220 | pub ext: [::uint64_t; 2], | |
221 | } | |
222 | ||
223 | pub struct dqblk { | |
224 | pub dqb_bhardlimit: ::uint64_t, | |
225 | pub dqb_bsoftlimit: ::uint64_t, | |
226 | pub dqb_curbytes: ::uint64_t, | |
227 | pub dqb_ihardlimit: ::uint32_t, | |
228 | pub dqb_isoftlimit: ::uint32_t, | |
229 | pub dqb_curinodes: ::uint32_t, | |
230 | pub dqb_btime: ::uint32_t, | |
231 | pub dqb_itime: ::uint32_t, | |
232 | pub dqb_id: ::uint32_t, | |
233 | pub dqb_spare: [::uint32_t; 4], | |
234 | } | |
235 | ||
236 | pub struct termios { | |
237 | pub c_iflag: ::tcflag_t, | |
238 | pub c_oflag: ::tcflag_t, | |
239 | pub c_cflag: ::tcflag_t, | |
240 | pub c_lflag: ::tcflag_t, | |
241 | pub c_cc: [::cc_t; ::NCCS], | |
242 | pub c_ispeed: ::speed_t, | |
243 | pub c_ospeed: ::speed_t, | |
244 | } | |
7453a54e SL |
245 | |
246 | pub struct flock { | |
247 | pub l_start: ::off_t, | |
248 | pub l_len: ::off_t, | |
249 | pub l_pid: ::pid_t, | |
250 | pub l_type: ::c_short, | |
251 | pub l_whence: ::c_short, | |
252 | } | |
253 | ||
254 | pub struct sf_hdtr { | |
255 | pub headers: *mut ::iovec, | |
256 | pub hdr_cnt: ::c_int, | |
257 | pub trailers: *mut ::iovec, | |
258 | pub trl_cnt: ::c_int, | |
259 | } | |
54a0048b SL |
260 | |
261 | pub struct lconv { | |
262 | pub decimal_point: *mut ::c_char, | |
263 | pub thousands_sep: *mut ::c_char, | |
264 | pub grouping: *mut ::c_char, | |
265 | pub int_curr_symbol: *mut ::c_char, | |
266 | pub currency_symbol: *mut ::c_char, | |
267 | pub mon_decimal_point: *mut ::c_char, | |
268 | pub mon_thousands_sep: *mut ::c_char, | |
269 | pub mon_grouping: *mut ::c_char, | |
270 | pub positive_sign: *mut ::c_char, | |
271 | pub negative_sign: *mut ::c_char, | |
272 | pub int_frac_digits: ::c_char, | |
273 | pub frac_digits: ::c_char, | |
274 | pub p_cs_precedes: ::c_char, | |
275 | pub p_sep_by_space: ::c_char, | |
276 | pub n_cs_precedes: ::c_char, | |
277 | pub n_sep_by_space: ::c_char, | |
278 | pub p_sign_posn: ::c_char, | |
279 | pub n_sign_posn: ::c_char, | |
280 | pub int_p_cs_precedes: ::c_char, | |
281 | pub int_n_cs_precedes: ::c_char, | |
282 | pub int_p_sep_by_space: ::c_char, | |
283 | pub int_n_sep_by_space: ::c_char, | |
284 | pub int_p_sign_posn: ::c_char, | |
285 | pub int_n_sign_posn: ::c_char, | |
286 | } | |
92a42be0 SL |
287 | } |
288 | ||
289 | pub const EXIT_FAILURE: ::c_int = 1; | |
290 | pub const EXIT_SUCCESS: ::c_int = 0; | |
291 | pub const RAND_MAX: ::c_int = 2147483647; | |
292 | pub const EOF: ::c_int = -1; | |
293 | pub const SEEK_SET: ::c_int = 0; | |
294 | pub const SEEK_CUR: ::c_int = 1; | |
295 | pub const SEEK_END: ::c_int = 2; | |
296 | pub const _IOFBF: ::c_int = 0; | |
297 | pub const _IONBF: ::c_int = 2; | |
298 | pub const _IOLBF: ::c_int = 1; | |
299 | pub const BUFSIZ: ::c_uint = 1024; | |
300 | pub const FOPEN_MAX: ::c_uint = 20; | |
301 | pub const FILENAME_MAX: ::c_uint = 1024; | |
302 | pub const L_tmpnam: ::c_uint = 1024; | |
303 | pub const TMP_MAX: ::c_uint = 308915776; | |
304 | pub const _PC_NAME_MAX: ::c_int = 4; | |
305 | ||
306 | pub const O_RDONLY: ::c_int = 0; | |
307 | pub const O_WRONLY: ::c_int = 1; | |
308 | pub const O_RDWR: ::c_int = 2; | |
309 | pub const O_APPEND: ::c_int = 8; | |
310 | pub const O_CREAT: ::c_int = 512; | |
311 | pub const O_EXCL: ::c_int = 2048; | |
312 | pub const O_NOCTTY: ::c_int = 131072; | |
313 | pub const O_TRUNC: ::c_int = 1024; | |
314 | pub const O_CLOEXEC: ::c_int = 0x1000000; | |
9cc50fc6 | 315 | pub const O_DIRECTORY: ::c_int = 0x100000; |
92a42be0 SL |
316 | pub const S_IFIFO: mode_t = 4096; |
317 | pub const S_IFCHR: mode_t = 8192; | |
318 | pub const S_IFBLK: mode_t = 24576; | |
319 | pub const S_IFDIR: mode_t = 16384; | |
320 | pub const S_IFREG: mode_t = 32768; | |
321 | pub const S_IFLNK: mode_t = 40960; | |
322 | pub const S_IFSOCK: mode_t = 49152; | |
323 | pub const S_IFMT: mode_t = 61440; | |
324 | pub const S_IEXEC: mode_t = 64; | |
325 | pub const S_IWRITE: mode_t = 128; | |
326 | pub const S_IREAD: mode_t = 256; | |
327 | pub const S_IRWXU: mode_t = 448; | |
328 | pub const S_IXUSR: mode_t = 64; | |
329 | pub const S_IWUSR: mode_t = 128; | |
330 | pub const S_IRUSR: mode_t = 256; | |
331 | pub const S_IRWXG: mode_t = 56; | |
332 | pub const S_IXGRP: mode_t = 8; | |
333 | pub const S_IWGRP: mode_t = 16; | |
334 | pub const S_IRGRP: mode_t = 32; | |
335 | pub const S_IRWXO: mode_t = 7; | |
336 | pub const S_IXOTH: mode_t = 1; | |
337 | pub const S_IWOTH: mode_t = 2; | |
338 | pub const S_IROTH: mode_t = 4; | |
339 | pub const F_OK: ::c_int = 0; | |
340 | pub const R_OK: ::c_int = 4; | |
341 | pub const W_OK: ::c_int = 2; | |
342 | pub const X_OK: ::c_int = 1; | |
343 | pub const STDIN_FILENO: ::c_int = 0; | |
344 | pub const STDOUT_FILENO: ::c_int = 1; | |
345 | pub const STDERR_FILENO: ::c_int = 2; | |
346 | pub const F_LOCK: ::c_int = 1; | |
347 | pub const F_TEST: ::c_int = 3; | |
348 | pub const F_TLOCK: ::c_int = 2; | |
349 | pub const F_ULOCK: ::c_int = 0; | |
7453a54e SL |
350 | pub const F_GETLK: ::c_int = 7; |
351 | pub const F_SETLK: ::c_int = 8; | |
352 | pub const F_SETLKW: ::c_int = 9; | |
92a42be0 SL |
353 | pub const SIGHUP: ::c_int = 1; |
354 | pub const SIGINT: ::c_int = 2; | |
355 | pub const SIGQUIT: ::c_int = 3; | |
356 | pub const SIGILL: ::c_int = 4; | |
357 | pub const SIGABRT: ::c_int = 6; | |
358 | pub const SIGFPE: ::c_int = 8; | |
359 | pub const SIGKILL: ::c_int = 9; | |
360 | pub const SIGSEGV: ::c_int = 11; | |
361 | pub const SIGPIPE: ::c_int = 13; | |
362 | pub const SIGALRM: ::c_int = 14; | |
363 | pub const SIGTERM: ::c_int = 15; | |
364 | ||
365 | pub const PROT_NONE: ::c_int = 0; | |
366 | pub const PROT_READ: ::c_int = 1; | |
367 | pub const PROT_WRITE: ::c_int = 2; | |
368 | pub const PROT_EXEC: ::c_int = 4; | |
369 | ||
370 | pub const MAP_FILE: ::c_int = 0x0000; | |
371 | pub const MAP_SHARED: ::c_int = 0x0001; | |
372 | pub const MAP_PRIVATE: ::c_int = 0x0002; | |
373 | pub const MAP_FIXED: ::c_int = 0x0010; | |
374 | pub const MAP_ANON: ::c_int = 0x1000; | |
375 | ||
376 | pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; | |
377 | ||
378 | pub const MCL_CURRENT: ::c_int = 0x0001; | |
379 | pub const MCL_FUTURE: ::c_int = 0x0002; | |
380 | ||
381 | pub const MS_ASYNC: ::c_int = 0x0001; | |
382 | pub const MS_INVALIDATE: ::c_int = 0x0002; | |
383 | pub const MS_SYNC: ::c_int = 0x0010; | |
384 | ||
385 | pub const MS_KILLPAGES: ::c_int = 0x0004; | |
386 | pub const MS_DEACTIVATE: ::c_int = 0x0008; | |
387 | ||
388 | pub const EPERM: ::c_int = 1; | |
389 | pub const ENOENT: ::c_int = 2; | |
390 | pub const ESRCH: ::c_int = 3; | |
391 | pub const EINTR: ::c_int = 4; | |
392 | pub const EIO: ::c_int = 5; | |
393 | pub const ENXIO: ::c_int = 6; | |
394 | pub const E2BIG: ::c_int = 7; | |
395 | pub const ENOEXEC: ::c_int = 8; | |
396 | pub const EBADF: ::c_int = 9; | |
397 | pub const ECHILD: ::c_int = 10; | |
398 | pub const EDEADLK: ::c_int = 11; | |
399 | pub const ENOMEM: ::c_int = 12; | |
400 | pub const EACCES: ::c_int = 13; | |
401 | pub const EFAULT: ::c_int = 14; | |
402 | pub const ENOTBLK: ::c_int = 15; | |
403 | pub const EBUSY: ::c_int = 16; | |
404 | pub const EEXIST: ::c_int = 17; | |
405 | pub const EXDEV: ::c_int = 18; | |
406 | pub const ENODEV: ::c_int = 19; | |
407 | pub const ENOTDIR: ::c_int = 20; | |
408 | pub const EISDIR: ::c_int = 21; | |
409 | pub const EINVAL: ::c_int = 22; | |
410 | pub const ENFILE: ::c_int = 23; | |
411 | pub const EMFILE: ::c_int = 24; | |
412 | pub const ENOTTY: ::c_int = 25; | |
413 | pub const ETXTBSY: ::c_int = 26; | |
414 | pub const EFBIG: ::c_int = 27; | |
415 | pub const ENOSPC: ::c_int = 28; | |
416 | pub const ESPIPE: ::c_int = 29; | |
417 | pub const EROFS: ::c_int = 30; | |
418 | pub const EMLINK: ::c_int = 31; | |
419 | pub const EPIPE: ::c_int = 32; | |
420 | pub const EDOM: ::c_int = 33; | |
421 | pub const ERANGE: ::c_int = 34; | |
422 | pub const EAGAIN: ::c_int = 35; | |
423 | pub const EWOULDBLOCK: ::c_int = EAGAIN; | |
424 | pub const EINPROGRESS: ::c_int = 36; | |
425 | pub const EALREADY: ::c_int = 37; | |
426 | pub const ENOTSOCK: ::c_int = 38; | |
427 | pub const EDESTADDRREQ: ::c_int = 39; | |
428 | pub const EMSGSIZE: ::c_int = 40; | |
429 | pub const EPROTOTYPE: ::c_int = 41; | |
430 | pub const ENOPROTOOPT: ::c_int = 42; | |
431 | pub const EPROTONOSUPPORT: ::c_int = 43; | |
432 | pub const ESOCKTNOSUPPORT: ::c_int = 44; | |
433 | pub const ENOTSUP: ::c_int = 45; | |
434 | pub const EPFNOSUPPORT: ::c_int = 46; | |
435 | pub const EAFNOSUPPORT: ::c_int = 47; | |
436 | pub const EADDRINUSE: ::c_int = 48; | |
437 | pub const EADDRNOTAVAIL: ::c_int = 49; | |
438 | pub const ENETDOWN: ::c_int = 50; | |
439 | pub const ENETUNREACH: ::c_int = 51; | |
440 | pub const ENETRESET: ::c_int = 52; | |
441 | pub const ECONNABORTED: ::c_int = 53; | |
442 | pub const ECONNRESET: ::c_int = 54; | |
443 | pub const ENOBUFS: ::c_int = 55; | |
444 | pub const EISCONN: ::c_int = 56; | |
445 | pub const ENOTCONN: ::c_int = 57; | |
446 | pub const ESHUTDOWN: ::c_int = 58; | |
447 | pub const ETOOMANYREFS: ::c_int = 59; | |
448 | pub const ETIMEDOUT: ::c_int = 60; | |
449 | pub const ECONNREFUSED: ::c_int = 61; | |
450 | pub const ELOOP: ::c_int = 62; | |
451 | pub const ENAMETOOLONG: ::c_int = 63; | |
452 | pub const EHOSTDOWN: ::c_int = 64; | |
453 | pub const EHOSTUNREACH: ::c_int = 65; | |
454 | pub const ENOTEMPTY: ::c_int = 66; | |
455 | pub const EPROCLIM: ::c_int = 67; | |
456 | pub const EUSERS: ::c_int = 68; | |
457 | pub const EDQUOT: ::c_int = 69; | |
458 | pub const ESTALE: ::c_int = 70; | |
459 | pub const EREMOTE: ::c_int = 71; | |
460 | pub const EBADRPC: ::c_int = 72; | |
461 | pub const ERPCMISMATCH: ::c_int = 73; | |
462 | pub const EPROGUNAVAIL: ::c_int = 74; | |
463 | pub const EPROGMISMATCH: ::c_int = 75; | |
464 | pub const EPROCUNAVAIL: ::c_int = 76; | |
465 | pub const ENOLCK: ::c_int = 77; | |
466 | pub const ENOSYS: ::c_int = 78; | |
467 | pub const EFTYPE: ::c_int = 79; | |
468 | pub const EAUTH: ::c_int = 80; | |
469 | pub const ENEEDAUTH: ::c_int = 81; | |
470 | pub const EPWROFF: ::c_int = 82; | |
471 | pub const EDEVERR: ::c_int = 83; | |
472 | pub const EOVERFLOW: ::c_int = 84; | |
473 | pub const EBADEXEC: ::c_int = 85; | |
474 | pub const EBADARCH: ::c_int = 86; | |
475 | pub const ESHLIBVERS: ::c_int = 87; | |
476 | pub const EBADMACHO: ::c_int = 88; | |
477 | pub const ECANCELED: ::c_int = 89; | |
478 | pub const EIDRM: ::c_int = 90; | |
479 | pub const ENOMSG: ::c_int = 91; | |
480 | pub const EILSEQ: ::c_int = 92; | |
481 | pub const ENOATTR: ::c_int = 93; | |
482 | pub const EBADMSG: ::c_int = 94; | |
483 | pub const EMULTIHOP: ::c_int = 95; | |
484 | pub const ENODATA: ::c_int = 96; | |
485 | pub const ENOLINK: ::c_int = 97; | |
486 | pub const ENOSR: ::c_int = 98; | |
487 | pub const ENOSTR: ::c_int = 99; | |
488 | pub const EPROTO: ::c_int = 100; | |
489 | pub const ETIME: ::c_int = 101; | |
490 | pub const EOPNOTSUPP: ::c_int = 102; | |
491 | pub const ENOPOLICY: ::c_int = 103; | |
492 | pub const ENOTRECOVERABLE: ::c_int = 104; | |
493 | pub const EOWNERDEAD: ::c_int = 105; | |
494 | pub const EQFULL: ::c_int = 106; | |
495 | pub const ELAST: ::c_int = 106; | |
496 | ||
497 | pub const F_DUPFD: ::c_int = 0; | |
498 | pub const F_DUPFD_CLOEXEC: ::c_int = 67; | |
499 | pub const F_GETFD: ::c_int = 1; | |
500 | pub const F_SETFD: ::c_int = 2; | |
501 | pub const F_GETFL: ::c_int = 3; | |
502 | pub const F_SETFL: ::c_int = 4; | |
503 | pub const F_PREALLOCATE: ::c_int = 42; | |
504 | pub const F_RDADVISE: ::c_int = 44; | |
505 | pub const F_RDAHEAD: ::c_int = 45; | |
506 | pub const F_NOCACHE: ::c_int = 48; | |
507 | pub const F_GETPATH: ::c_int = 50; | |
508 | pub const F_FULLFSYNC: ::c_int = 51; | |
509 | pub const F_FREEZE_FS: ::c_int = 53; | |
510 | pub const F_THAW_FS: ::c_int = 54; | |
511 | pub const F_GLOBAL_NOCACHE: ::c_int = 55; | |
512 | pub const F_NODIRECT: ::c_int = 62; | |
513 | ||
514 | pub const F_ALLOCATECONTIG: ::c_uint = 0x02; | |
515 | pub const F_ALLOCATEALL: ::c_uint = 0x04; | |
516 | ||
517 | pub const F_PEOFPOSMODE: ::c_int = 3; | |
518 | pub const F_VOLPOSMODE: ::c_int = 4; | |
519 | ||
520 | pub const O_ACCMODE: ::c_int = 3; | |
521 | ||
54a0048b SL |
522 | pub const TIOCMODG: ::c_ulong = 0x40047403; |
523 | pub const TIOCMODS: ::c_ulong = 0x80047404; | |
524 | pub const TIOCM_LE: ::c_int = 0x1; | |
525 | pub const TIOCM_DTR: ::c_int = 0x2; | |
526 | pub const TIOCM_RTS: ::c_int = 0x4; | |
527 | pub const TIOCM_ST: ::c_int = 0x8; | |
528 | pub const TIOCM_SR: ::c_int = 0x10; | |
529 | pub const TIOCM_CTS: ::c_int = 0x20; | |
530 | pub const TIOCM_CAR: ::c_int = 0x40; | |
531 | pub const TIOCM_CD: ::c_int = 0x40; | |
532 | pub const TIOCM_RNG: ::c_int = 0x80; | |
533 | pub const TIOCM_RI: ::c_int = 0x80; | |
534 | pub const TIOCM_DSR: ::c_int = 0x100; | |
535 | pub const TIOCEXCL: ::c_int = 0x2000740d; | |
536 | pub const TIOCNXCL: ::c_int = 0x2000740e; | |
537 | pub const TIOCFLUSH: ::c_ulong = 0x80047410; | |
538 | pub const TIOCGETD: ::c_ulong = 0x4004741a; | |
539 | pub const TIOCSETD: ::c_ulong = 0x8004741b; | |
540 | pub const TIOCIXON: ::c_uint = 0x20007481; | |
541 | pub const TIOCIXOFF: ::c_uint = 0x20007480; | |
542 | pub const TIOCSBRK: ::c_uint = 0x2000747b; | |
543 | pub const TIOCCBRK: ::c_uint = 0x2000747a; | |
544 | pub const TIOCSDTR: ::c_uint = 0x20007479; | |
545 | pub const TIOCCDTR: ::c_uint = 0x20007478; | |
546 | pub const TIOCGPGRP: ::c_ulong = 0x40047477; | |
547 | pub const TIOCSPGRP: ::c_ulong = 0x80047476; | |
548 | pub const TIOCOUTQ: ::c_ulong = 0x40047473; | |
549 | pub const TIOCSTI: ::c_ulong = 0x80017472; | |
550 | pub const TIOCNOTTY: ::c_uint = 0x20007471; | |
551 | pub const TIOCPKT: ::c_ulong = 0x80047470; | |
552 | pub const TIOCPKT_DATA: ::c_int = 0x0; | |
553 | pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1; | |
554 | pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2; | |
555 | pub const TIOCPKT_STOP: ::c_int = 0x4; | |
556 | pub const TIOCPKT_START: ::c_int = 0x8; | |
557 | pub const TIOCPKT_NOSTOP: ::c_int = 0x10; | |
558 | pub const TIOCPKT_DOSTOP: ::c_int = 0x20; | |
559 | pub const TIOCPKT_IOCTL: ::c_int = 0x40; | |
560 | pub const TIOCSTOP: ::c_uint = 0x2000746f; | |
561 | pub const TIOCSTART: ::c_uint = 0x2000746e; | |
562 | pub const TIOCMSET: ::c_ulong = 0x8004746d; | |
563 | pub const TIOCMBIS: ::c_ulong = 0x8004746c; | |
564 | pub const TIOCMBIC: ::c_ulong = 0x8004746b; | |
565 | pub const TIOCMGET: ::c_ulong = 0x4004746a; | |
566 | pub const TIOCREMOTE: ::c_ulong = 0x80047469; | |
567 | pub const TIOCGWINSZ: ::c_ulong = 0x40087468; | |
568 | pub const TIOCSWINSZ: ::c_ulong = 0x80087467; | |
569 | pub const TIOCUCNTL: ::c_ulong = 0x80047466; | |
570 | pub const TIOCSTAT: ::c_uint = 0x20007465; | |
571 | pub const TIOCSCONS: ::c_uint = 0x20007463; | |
572 | pub const TIOCCONS: ::c_ulong = 0x80047462; | |
573 | pub const TIOCSCTTY: ::c_uint = 0x20007461; | |
574 | pub const TIOCEXT: ::c_ulong = 0x80047460; | |
575 | pub const TIOCSIG: ::c_uint = 0x2000745f; | |
576 | pub const TIOCDRAIN: ::c_uint = 0x2000745e; | |
577 | pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b; | |
578 | pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a; | |
579 | pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457; | |
580 | pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456; | |
581 | pub const TIOCDSIMICROCODE: ::c_uint = 0x20007455; | |
582 | pub const TIOCPTYGRANT: ::c_uint = 0x20007454; | |
583 | pub const TIOCPTYGNAME: ::c_uint = 0x40807453; | |
584 | pub const TIOCPTYUNLK: ::c_uint = 0x20007452; | |
585 | ||
92a42be0 SL |
586 | pub const SIGTRAP: ::c_int = 5; |
587 | ||
588 | pub const GLOB_APPEND : ::c_int = 0x0001; | |
589 | pub const GLOB_DOOFFS : ::c_int = 0x0002; | |
590 | pub const GLOB_ERR : ::c_int = 0x0004; | |
591 | pub const GLOB_MARK : ::c_int = 0x0008; | |
592 | pub const GLOB_NOCHECK : ::c_int = 0x0010; | |
593 | pub const GLOB_NOSORT : ::c_int = 0x0020; | |
594 | pub const GLOB_NOESCAPE: ::c_int = 0x2000; | |
595 | ||
596 | pub const GLOB_NOSPACE : ::c_int = -1; | |
597 | pub const GLOB_ABORTED : ::c_int = -2; | |
598 | pub const GLOB_NOMATCH : ::c_int = -3; | |
599 | ||
600 | pub const POSIX_MADV_NORMAL: ::c_int = 0; | |
601 | pub const POSIX_MADV_RANDOM: ::c_int = 1; | |
602 | pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; | |
603 | pub const POSIX_MADV_WILLNEED: ::c_int = 3; | |
604 | pub const POSIX_MADV_DONTNEED: ::c_int = 4; | |
605 | ||
606 | pub const _SC_IOV_MAX: ::c_int = 56; | |
607 | pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70; | |
608 | pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71; | |
609 | pub const _SC_LOGIN_NAME_MAX: ::c_int = 73; | |
610 | pub const _SC_MQ_PRIO_MAX: ::c_int = 75; | |
611 | pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82; | |
612 | pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83; | |
613 | pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85; | |
614 | pub const _SC_THREAD_KEYS_MAX: ::c_int = 86; | |
615 | pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87; | |
616 | pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88; | |
617 | pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89; | |
618 | pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90; | |
619 | pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91; | |
620 | pub const _SC_THREAD_STACK_MIN: ::c_int = 93; | |
621 | pub const _SC_THREAD_THREADS_MAX: ::c_int = 94; | |
622 | pub const _SC_THREADS: ::c_int = 96; | |
623 | pub const _SC_TTY_NAME_MAX: ::c_int = 101; | |
624 | pub const _SC_ATEXIT_MAX: ::c_int = 107; | |
625 | pub const _SC_XOPEN_CRYPT: ::c_int = 108; | |
626 | pub const _SC_XOPEN_ENH_I18N: ::c_int = 109; | |
627 | pub const _SC_XOPEN_LEGACY: ::c_int = 110; | |
628 | pub const _SC_XOPEN_REALTIME: ::c_int = 111; | |
629 | pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112; | |
630 | pub const _SC_XOPEN_SHM: ::c_int = 113; | |
631 | pub const _SC_XOPEN_UNIX: ::c_int = 115; | |
632 | pub const _SC_XOPEN_VERSION: ::c_int = 116; | |
633 | pub const _SC_XOPEN_XCU_VERSION: ::c_int = 121; | |
634 | ||
635 | pub const PTHREAD_CREATE_JOINABLE: ::c_int = 1; | |
636 | pub const PTHREAD_CREATE_DETACHED: ::c_int = 2; | |
637 | pub const PTHREAD_STACK_MIN: ::size_t = 8192; | |
638 | ||
639 | pub const RLIMIT_CPU: ::c_int = 0; | |
640 | pub const RLIMIT_FSIZE: ::c_int = 1; | |
641 | pub const RLIMIT_DATA: ::c_int = 2; | |
642 | pub const RLIMIT_STACK: ::c_int = 3; | |
643 | pub const RLIMIT_CORE: ::c_int = 4; | |
644 | pub const RLIMIT_AS: ::c_int = 5; | |
645 | pub const RLIMIT_MEMLOCK: ::c_int = 6; | |
646 | pub const RLIMIT_NPROC: ::c_int = 7; | |
647 | pub const RLIMIT_NOFILE: ::c_int = 8; | |
648 | pub const RLIM_NLIMITS: ::c_int = 9; | |
649 | pub const _RLIMIT_POSIX_FLAG: ::c_int = 0x1000; | |
650 | ||
651 | pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff; | |
652 | ||
653 | pub const RUSAGE_SELF: ::c_int = 0; | |
654 | pub const RUSAGE_CHILDREN: ::c_int = -1; | |
655 | ||
656 | pub const MADV_NORMAL: ::c_int = 0; | |
657 | pub const MADV_RANDOM: ::c_int = 1; | |
658 | pub const MADV_SEQUENTIAL: ::c_int = 2; | |
659 | pub const MADV_WILLNEED: ::c_int = 3; | |
660 | pub const MADV_DONTNEED: ::c_int = 4; | |
661 | pub const MADV_FREE: ::c_int = 5; | |
662 | pub const MADV_ZERO_WIRED_PAGES: ::c_int = 6; | |
663 | pub const MADV_FREE_REUSABLE: ::c_int = 7; | |
664 | pub const MADV_FREE_REUSE: ::c_int = 8; | |
665 | pub const MADV_CAN_REUSE: ::c_int = 9; | |
666 | ||
667 | pub const MINCORE_INCORE: ::c_int = 0x1; | |
668 | pub const MINCORE_REFERENCED: ::c_int = 0x2; | |
669 | pub const MINCORE_MODIFIED: ::c_int = 0x4; | |
670 | pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8; | |
671 | pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10; | |
672 | ||
673 | pub const AF_UNIX: ::c_int = 1; | |
674 | pub const AF_INET: ::c_int = 2; | |
675 | pub const AF_INET6: ::c_int = 30; | |
676 | pub const SOCK_STREAM: ::c_int = 1; | |
677 | pub const SOCK_DGRAM: ::c_int = 2; | |
678 | pub const SOCK_RAW: ::c_int = 3; | |
679 | pub const IPPROTO_TCP: ::c_int = 6; | |
680 | pub const IPPROTO_IP: ::c_int = 0; | |
681 | pub const IPPROTO_IPV6: ::c_int = 41; | |
682 | pub const IP_MULTICAST_TTL: ::c_int = 10; | |
683 | pub const IP_MULTICAST_LOOP: ::c_int = 11; | |
684 | pub const IP_TTL: ::c_int = 4; | |
685 | pub const IP_HDRINCL: ::c_int = 2; | |
686 | pub const IP_ADD_MEMBERSHIP: ::c_int = 12; | |
687 | pub const IP_DROP_MEMBERSHIP: ::c_int = 13; | |
688 | pub const IPV6_JOIN_GROUP: ::c_int = 12; | |
689 | pub const IPV6_LEAVE_GROUP: ::c_int = 13; | |
690 | ||
691 | pub const TCP_NODELAY: ::c_int = 0x01; | |
692 | pub const TCP_KEEPALIVE: ::c_int = 0x10; | |
693 | pub const SOL_SOCKET: ::c_int = 0xffff; | |
694 | ||
695 | pub const SO_DEBUG: ::c_int = 0x01; | |
696 | pub const SO_ACCEPTCONN: ::c_int = 0x0002; | |
697 | pub const SO_REUSEADDR: ::c_int = 0x0004; | |
698 | pub const SO_KEEPALIVE: ::c_int = 0x0008; | |
699 | pub const SO_DONTROUTE: ::c_int = 0x0010; | |
700 | pub const SO_BROADCAST: ::c_int = 0x0020; | |
701 | pub const SO_USELOOPBACK: ::c_int = 0x0040; | |
702 | pub const SO_LINGER: ::c_int = 0x0080; | |
703 | pub const SO_OOBINLINE: ::c_int = 0x0100; | |
704 | pub const SO_REUSEPORT: ::c_int = 0x0200; | |
705 | pub const SO_SNDBUF: ::c_int = 0x1001; | |
706 | pub const SO_RCVBUF: ::c_int = 0x1002; | |
707 | pub const SO_SNDLOWAT: ::c_int = 0x1003; | |
708 | pub const SO_RCVLOWAT: ::c_int = 0x1004; | |
709 | pub const SO_SNDTIMEO: ::c_int = 0x1005; | |
710 | pub const SO_RCVTIMEO: ::c_int = 0x1006; | |
711 | pub const SO_ERROR: ::c_int = 0x1007; | |
712 | pub const SO_TYPE: ::c_int = 0x1008; | |
713 | ||
714 | pub const IFF_LOOPBACK: ::c_int = 0x8; | |
715 | ||
716 | pub const SHUT_RD: ::c_int = 0; | |
717 | pub const SHUT_WR: ::c_int = 1; | |
718 | pub const SHUT_RDWR: ::c_int = 2; | |
719 | ||
720 | pub const LOCK_SH: ::c_int = 1; | |
721 | pub const LOCK_EX: ::c_int = 2; | |
722 | pub const LOCK_NB: ::c_int = 4; | |
723 | pub const LOCK_UN: ::c_int = 8; | |
724 | ||
725 | pub const O_DSYNC: ::c_int = 4194304; | |
726 | pub const O_SYNC: ::c_int = 128; | |
727 | pub const O_NONBLOCK: ::c_int = 4; | |
728 | ||
729 | pub const MAP_COPY: ::c_int = 0x0002; | |
730 | pub const MAP_RENAME: ::c_int = 0x0020; | |
731 | pub const MAP_NORESERVE: ::c_int = 0x0040; | |
732 | pub const MAP_NOEXTEND: ::c_int = 0x0100; | |
733 | pub const MAP_HASSEMAPHORE: ::c_int = 0x0200; | |
734 | pub const MAP_NOCACHE: ::c_int = 0x0400; | |
735 | pub const MAP_JIT: ::c_int = 0x0800; | |
736 | ||
737 | pub const IPPROTO_RAW: ::c_int = 255; | |
738 | ||
739 | pub const SO_NREAD: ::c_int = 0x1020; | |
740 | pub const SO_NKE: ::c_int = 0x1021; | |
741 | pub const SO_NOSIGPIPE: ::c_int = 0x1022; | |
742 | pub const SO_NOADDRERR: ::c_int = 0x1023; | |
743 | pub const SO_NWRITE: ::c_int = 0x1024; | |
744 | pub const SO_DONTTRUNC: ::c_int = 0x2000; | |
745 | pub const SO_WANTMORE: ::c_int = 0x4000; | |
746 | pub const SO_WANTOOBFLAG: ::c_int = 0x8000; | |
747 | ||
92a42be0 SL |
748 | pub const _SC_ARG_MAX: ::c_int = 1; |
749 | pub const _SC_CHILD_MAX: ::c_int = 2; | |
750 | pub const _SC_CLK_TCK: ::c_int = 3; | |
751 | pub const _SC_NGROUPS_MAX: ::c_int = 4; | |
752 | pub const _SC_OPEN_MAX: ::c_int = 5; | |
753 | pub const _SC_JOB_CONTROL: ::c_int = 6; | |
754 | pub const _SC_SAVED_IDS: ::c_int = 7; | |
755 | pub const _SC_VERSION: ::c_int = 8; | |
756 | pub const _SC_BC_BASE_MAX: ::c_int = 9; | |
757 | pub const _SC_BC_DIM_MAX: ::c_int = 10; | |
758 | pub const _SC_BC_SCALE_MAX: ::c_int = 11; | |
759 | pub const _SC_BC_STRING_MAX: ::c_int = 12; | |
760 | pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13; | |
761 | pub const _SC_EXPR_NEST_MAX: ::c_int = 14; | |
762 | pub const _SC_LINE_MAX: ::c_int = 15; | |
763 | pub const _SC_RE_DUP_MAX: ::c_int = 16; | |
764 | pub const _SC_2_VERSION: ::c_int = 17; | |
765 | pub const _SC_2_C_BIND: ::c_int = 18; | |
766 | pub const _SC_2_C_DEV: ::c_int = 19; | |
767 | pub const _SC_2_CHAR_TERM: ::c_int = 20; | |
768 | pub const _SC_2_FORT_DEV: ::c_int = 21; | |
769 | pub const _SC_2_FORT_RUN: ::c_int = 22; | |
770 | pub const _SC_2_LOCALEDEF: ::c_int = 23; | |
771 | pub const _SC_2_SW_DEV: ::c_int = 24; | |
772 | pub const _SC_2_UPE: ::c_int = 25; | |
773 | pub const _SC_STREAM_MAX: ::c_int = 26; | |
774 | pub const _SC_TZNAME_MAX: ::c_int = 27; | |
775 | pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28; | |
776 | pub const _SC_PAGESIZE: ::c_int = 29; | |
777 | pub const _SC_MEMLOCK: ::c_int = 30; | |
778 | pub const _SC_MEMLOCK_RANGE: ::c_int = 31; | |
779 | pub const _SC_MEMORY_PROTECTION: ::c_int = 32; | |
780 | pub const _SC_MESSAGE_PASSING: ::c_int = 33; | |
781 | pub const _SC_PRIORITIZED_IO: ::c_int = 34; | |
782 | pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35; | |
783 | pub const _SC_REALTIME_SIGNALS: ::c_int = 36; | |
784 | pub const _SC_SEMAPHORES: ::c_int = 37; | |
785 | pub const _SC_FSYNC: ::c_int = 38; | |
786 | pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39; | |
787 | pub const _SC_SYNCHRONIZED_IO: ::c_int = 40; | |
788 | pub const _SC_TIMERS: ::c_int = 41; | |
789 | pub const _SC_AIO_LISTIO_MAX: ::c_int = 42; | |
790 | pub const _SC_AIO_MAX: ::c_int = 43; | |
791 | pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44; | |
792 | pub const _SC_DELAYTIMER_MAX: ::c_int = 45; | |
793 | pub const _SC_MQ_OPEN_MAX: ::c_int = 46; | |
794 | pub const _SC_MAPPED_FILES: ::c_int = 47; | |
795 | pub const _SC_RTSIG_MAX: ::c_int = 48; | |
796 | pub const _SC_SEM_NSEMS_MAX: ::c_int = 49; | |
797 | pub const _SC_SEM_VALUE_MAX: ::c_int = 50; | |
798 | pub const _SC_SIGQUEUE_MAX: ::c_int = 51; | |
799 | pub const _SC_TIMER_MAX: ::c_int = 52; | |
800 | pub const _SC_NPROCESSORS_CONF: ::c_int = 57; | |
801 | pub const _SC_NPROCESSORS_ONLN: ::c_int = 58; | |
802 | pub const _SC_2_PBS: ::c_int = 59; | |
803 | pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60; | |
804 | pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61; | |
805 | pub const _SC_2_PBS_LOCATE: ::c_int = 62; | |
806 | pub const _SC_2_PBS_MESSAGE: ::c_int = 63; | |
807 | pub const _SC_2_PBS_TRACK: ::c_int = 64; | |
808 | pub const _SC_ADVISORY_INFO: ::c_int = 65; | |
809 | pub const _SC_BARRIERS: ::c_int = 66; | |
810 | pub const _SC_CLOCK_SELECTION: ::c_int = 67; | |
811 | pub const _SC_CPUTIME: ::c_int = 68; | |
812 | pub const _SC_FILE_LOCKING: ::c_int = 69; | |
813 | pub const _SC_HOST_NAME_MAX: ::c_int = 72; | |
814 | pub const _SC_MONOTONIC_CLOCK: ::c_int = 74; | |
815 | pub const _SC_READER_WRITER_LOCKS: ::c_int = 76; | |
816 | pub const _SC_REGEXP: ::c_int = 77; | |
817 | pub const _SC_SHELL: ::c_int = 78; | |
818 | pub const _SC_SPAWN: ::c_int = 79; | |
819 | pub const _SC_SPIN_LOCKS: ::c_int = 80; | |
820 | pub const _SC_SPORADIC_SERVER: ::c_int = 81; | |
821 | pub const _SC_THREAD_CPUTIME: ::c_int = 84; | |
822 | pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92; | |
823 | pub const _SC_TIMEOUTS: ::c_int = 95; | |
824 | pub const _SC_TRACE: ::c_int = 97; | |
825 | pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98; | |
826 | pub const _SC_TRACE_INHERIT: ::c_int = 99; | |
827 | pub const _SC_TRACE_LOG: ::c_int = 100; | |
828 | pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102; | |
829 | pub const _SC_V6_ILP32_OFF32: ::c_int = 103; | |
830 | pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104; | |
831 | pub const _SC_V6_LP64_OFF64: ::c_int = 105; | |
832 | pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106; | |
833 | pub const _SC_IPV6: ::c_int = 118; | |
834 | pub const _SC_RAW_SOCKETS: ::c_int = 119; | |
835 | pub const _SC_SYMLOOP_MAX: ::c_int = 120; | |
836 | pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; | |
837 | pub const _SC_XOPEN_STREAMS: ::c_int = 114; | |
838 | pub const _SC_XBS5_ILP32_OFF32: ::c_int = 122; | |
839 | pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 123; | |
840 | pub const _SC_XBS5_LP64_OFF64: ::c_int = 124; | |
841 | pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 125; | |
842 | pub const _SC_SS_REPL_MAX: ::c_int = 126; | |
843 | pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 127; | |
844 | pub const _SC_TRACE_NAME_MAX: ::c_int = 128; | |
845 | pub const _SC_TRACE_SYS_MAX: ::c_int = 129; | |
846 | pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 130; | |
847 | pub const _SC_PASS_MAX: ::c_int = 131; | |
848 | ||
849 | pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; | |
850 | pub const _PTHREAD_MUTEX_SIG_init: ::c_long = 0x32AAABA7; | |
851 | pub const _PTHREAD_COND_SIG_init: ::c_long = 0x3CB0B1BB; | |
852 | pub const _PTHREAD_RWLOCK_SIG_init: ::c_long = 0x2DA8B3B4; | |
853 | pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { | |
854 | __sig: _PTHREAD_MUTEX_SIG_init, | |
855 | __opaque: [0; __PTHREAD_MUTEX_SIZE__], | |
856 | }; | |
857 | pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { | |
858 | __sig: _PTHREAD_COND_SIG_init, | |
859 | __opaque: [0; __PTHREAD_COND_SIZE__], | |
860 | }; | |
861 | pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { | |
862 | __sig: _PTHREAD_RWLOCK_SIG_init, | |
863 | __opaque: [0; __PTHREAD_RWLOCK_SIZE__], | |
864 | }; | |
865 | ||
866 | pub const SIGSTKSZ: ::size_t = 131072; | |
867 | ||
9cc50fc6 SL |
868 | pub const FD_SETSIZE: usize = 1024; |
869 | ||
870 | pub const ST_NOSUID: ::c_ulong = 2; | |
871 | ||
872 | pub const HW_AVAILCPU: ::c_int = 25; | |
873 | ||
874 | pub const EVFILT_AIO: ::int16_t = 0xfffd; | |
875 | pub const EVFILT_PROC: ::int16_t = 0xfffb; | |
876 | pub const EVFILT_READ: ::int16_t = 0xffff; | |
877 | pub const EVFILT_SIGNAL: ::int16_t = 0xfffa; | |
878 | pub const EVFILT_SYSCOUNT: ::int16_t = 0xe; | |
879 | pub const EVFILT_TIMER: ::int16_t = 0xfff9; | |
880 | pub const EVFILT_VNODE: ::int16_t = 0xfffc; | |
881 | pub const EVFILT_WRITE: ::int16_t = 0xfffe; | |
882 | pub const EVFILT_FS: ::int16_t = 0xfff7; | |
883 | pub const EVFILT_MACHPORT: ::int16_t = 0xfff8; | |
884 | pub const EVFILT_USER: ::int16_t = 0xfff6; | |
885 | pub const EVFILT_VM: ::int16_t = 0xfff4; | |
886 | ||
887 | pub const EV_DISPATCH: ::uint16_t = 0x80; | |
888 | pub const EV_FLAG0: ::uint16_t = 0x1000; | |
889 | pub const EV_OOBAND: ::uint16_t = 0x2000; | |
890 | pub const EV_POLL: ::uint16_t = 0x1000; | |
891 | pub const EV_RECEIPT: ::uint16_t = 0x40; | |
892 | ||
893 | pub const NOTE_ABSOLUTE: ::uint32_t = 0x8; | |
894 | pub const NOTE_EXITSTATUS: ::uint32_t = 0x04000000; | |
895 | pub const NOTE_EXIT_REPARENTED: ::uint32_t = 0x00080000; | |
896 | pub const NOTE_FFAND: ::uint32_t = 0x40000000; | |
897 | pub const NOTE_FFCOPY: ::uint32_t = 0xc0000000; | |
898 | pub const NOTE_FFCTRLMASK: ::uint32_t = 0xc0000000; | |
899 | pub const NOTE_FFLAGSMASK: ::uint32_t = 0x00ffffff; | |
900 | pub const NOTE_FFNOP: ::uint32_t = 0x0; | |
901 | pub const NOTE_FFOR: ::uint32_t = 0x80000000; | |
902 | pub const NOTE_NONE: ::uint32_t = 0x80; | |
903 | pub const NOTE_NSECONDS: ::uint32_t = 0x4; | |
904 | pub const NOTE_REAP: ::uint32_t = 0x10000000; | |
905 | pub const NOTE_SECONDS: ::uint32_t = 0x1; | |
906 | pub const NOTE_SIGNAL: ::uint32_t = 0x8000000; | |
907 | pub const NOTE_TRIGGER: ::uint32_t = 0x01000000; | |
908 | pub const NOTE_USECONDS: ::uint32_t = 0x2; | |
909 | pub const NOTE_VM_ERROR: ::uint32_t = 0x10000000; | |
910 | pub const NOTE_VM_PRESSURE: ::uint32_t = 0x80000000; | |
911 | pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: ::uint32_t = 0x20000000; | |
912 | pub const NOTE_VM_PRESSURE_TERMINATE: ::uint32_t = 0x40000000; | |
913 | pub const NOTE_PCTRLMASK: ::uint32_t = 0xfff00000; | |
914 | ||
7453a54e SL |
915 | pub const NL0: ::c_int = 0x00000000; |
916 | pub const NL1: ::c_int = 0x00000100; | |
917 | pub const TAB0: ::c_int = 0x00000000; | |
918 | pub const TAB1: ::c_int = 0x00000400; | |
919 | pub const TAB2: ::c_int = 0x00000800; | |
920 | pub const CR0: ::c_int = 0x00000000; | |
921 | pub const CR1: ::c_int = 0x00001000; | |
922 | pub const CR2: ::c_int = 0x00002000; | |
923 | pub const CR3: ::c_int = 0x00003000; | |
924 | pub const FF0: ::c_int = 0x00000000; | |
925 | pub const FF1: ::c_int = 0x00004000; | |
926 | pub const BS0: ::c_int = 0x00000000; | |
927 | pub const BS1: ::c_int = 0x00008000; | |
9cc50fc6 SL |
928 | pub const TAB3: ::c_int = 0x00000004; |
929 | pub const VT0: ::c_int = 0x00000000; | |
930 | pub const VT1: ::c_int = 0x00010000; | |
931 | pub const IUTF8: ::tcflag_t = 0x00004000; | |
932 | pub const CRTSCTS: ::tcflag_t = 0x00030000; | |
933 | ||
934 | pub const NI_MAXHOST: ::socklen_t = 1025; | |
935 | ||
7453a54e SL |
936 | pub const Q_GETQUOTA: ::c_int = 0x300; |
937 | pub const Q_SETQUOTA: ::c_int = 0x400; | |
938 | ||
939 | pub const RTLD_LOCAL: ::c_int = 0x4; | |
940 | pub const RTLD_FIRST: ::c_int = 0x100; | |
941 | pub const RTLD_NODELETE: ::c_int = 0x80; | |
942 | pub const RTLD_NOLOAD: ::c_int = 0x10; | |
943 | pub const RTLD_GLOBAL: ::c_int = 0x8; | |
944 | ||
92a42be0 | 945 | extern { |
9cc50fc6 SL |
946 | pub fn getnameinfo(sa: *const ::sockaddr, |
947 | salen: ::socklen_t, | |
948 | host: *mut ::c_char, | |
949 | hostlen: ::socklen_t, | |
950 | serv: *mut ::c_char, | |
951 | sevlen: ::socklen_t, | |
952 | flags: ::c_int) -> ::c_int; | |
953 | pub fn mincore(addr: *const ::c_void, len: ::size_t, | |
954 | vec: *mut ::c_char) -> ::c_int; | |
955 | pub fn sysctlnametomib(name: *const ::c_char, | |
956 | mibp: *mut ::c_int, | |
957 | sizep: *mut ::size_t) | |
958 | -> ::c_int; | |
92a42be0 SL |
959 | #[cfg_attr(all(target_os = "macos", target_arch = "x86"), |
960 | link_name = "mprotect$UNIX2003")] | |
961 | pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) | |
962 | -> ::c_int; | |
963 | pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int; | |
964 | pub fn sysctl(name: *mut ::c_int, | |
965 | namelen: ::c_uint, | |
966 | oldp: *mut ::c_void, | |
967 | oldlenp: *mut ::size_t, | |
968 | newp: *mut ::c_void, | |
969 | newlen: ::size_t) | |
970 | -> ::c_int; | |
971 | pub fn sysctlbyname(name: *const ::c_char, | |
972 | oldp: *mut ::c_void, | |
973 | oldlenp: *mut ::size_t, | |
974 | newp: *mut ::c_void, | |
975 | newlen: ::size_t) | |
976 | -> ::c_int; | |
977 | pub fn mach_absolute_time() -> u64; | |
978 | pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int; | |
979 | pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int; | |
980 | pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void; | |
981 | pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t; | |
982 | pub fn __error() -> *mut ::c_int; | |
983 | pub fn backtrace(buf: *mut *mut ::c_void, | |
984 | sz: ::c_int) -> ::c_int; | |
9cc50fc6 SL |
985 | #[cfg_attr(target_os = "macos", link_name = "statfs$INODE64")] |
986 | pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; | |
987 | #[cfg_attr(target_os = "macos", link_name = "fstatfs$INODE64")] | |
988 | pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; | |
989 | pub fn kevent(kq: ::c_int, | |
990 | changelist: *const ::kevent, | |
991 | nchanges: ::c_int, | |
992 | eventlist: *mut ::kevent, | |
993 | nevents: ::c_int, | |
994 | timeout: *const ::timespec) -> ::c_int; | |
995 | pub fn kevent64(kq: ::c_int, | |
996 | changelist: *const ::kevent64_s, | |
997 | nchanges: ::c_int, | |
998 | eventlist: *mut ::kevent64_s, | |
999 | nevents: ::c_int, | |
1000 | flags: ::c_uint, | |
1001 | timeout: *const ::timespec) -> ::c_int; | |
1002 | pub fn mount(src: *const ::c_char, | |
1003 | target: *const ::c_char, | |
1004 | flags: ::c_int, | |
1005 | data: *mut ::c_void) -> ::c_int; | |
1006 | pub fn ptrace(requeset: ::c_int, | |
1007 | pid: ::pid_t, | |
1008 | addr: *mut ::c_char, | |
1009 | data: ::c_int) -> ::c_int; | |
1010 | pub fn quotactl(special: *const ::c_char, | |
1011 | cmd: ::c_int, | |
1012 | id: ::c_int, | |
1013 | data: *mut ::c_char) -> ::c_int; | |
1014 | pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int; | |
7453a54e SL |
1015 | pub fn sendfile(fd: ::c_int, |
1016 | s: ::c_int, | |
1017 | offset: ::off_t, | |
1018 | len: *mut ::off_t, | |
1019 | hdtr: *mut ::sf_hdtr, | |
1020 | flags: ::c_int) -> ::c_int; | |
54a0048b SL |
1021 | pub fn openpty(amaster: *mut ::c_int, |
1022 | aslave: *mut ::c_int, | |
1023 | name: *mut ::c_char, | |
1024 | termp: *mut termios, | |
1025 | winp: *mut ::winsize) -> ::c_int; | |
1026 | pub fn forkpty(amaster: *mut ::c_int, | |
1027 | name: *mut ::c_char, | |
1028 | termp: *mut termios, | |
1029 | winp: *mut ::winsize) -> ::pid_t; | |
92a42be0 SL |
1030 | } |
1031 | ||
1032 | cfg_if! { | |
1033 | if #[cfg(any(target_arch = "arm", target_arch = "x86"))] { | |
1034 | mod b32; | |
1035 | pub use self::b32::*; | |
1036 | } else if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] { | |
1037 | mod b64; | |
1038 | pub use self::b64::*; | |
1039 | } else { | |
54a0048b | 1040 | // Unknown target_arch |
92a42be0 SL |
1041 | } |
1042 | } |