]> git.proxmox.com Git - rustc.git/blame - src/liblibc/src/unix/bsd/apple/mod.rs
New upstream version 1.22.1+dfsg1
[rustc.git] / src / liblibc / src / unix / bsd / apple / mod.rs
CommitLineData
92a42be0
SL
1//! Apple (ios/darwin)-specific definitions
2//!
3//! This covers *-apple-* triples currently
4
5pub type clock_t = c_ulong;
6pub type time_t = c_long;
7pub type suseconds_t = i32;
8pub type dev_t = i32;
9pub type ino_t = u64;
10pub type mode_t = u16;
11pub type nlink_t = u16;
12pub type blksize_t = i32;
13pub type rlim_t = u64;
14pub type mach_timebase_info_data_t = mach_timebase_info;
15pub type pthread_key_t = c_ulong;
16pub type sigset_t = u32;
9cc50fc6
SL
17pub type fsblkcnt_t = ::c_uint;
18pub type fsfilcnt_t = ::c_uint;
19pub type speed_t = ::c_ulong;
20pub type tcflag_t = ::c_ulong;
a7813a04 21pub type nl_item = ::c_int;
3157f602 22pub type id_t = ::c_uint;
5bcae85e 23pub type sem_t = ::c_int;
8bb4bdeb 24pub type idtype_t = ::c_uint;
92a42be0
SL
25
26pub enum timezone {}
27
28s! {
476ff2be
SL
29 pub struct aiocb {
30 pub aio_fildes: ::c_int,
31 pub aio_offset: ::off_t,
32 pub aio_buf: *mut ::c_void,
33 pub aio_nbytes: ::size_t,
34 pub aio_reqprio: ::c_int,
35 pub aio_sigevent: sigevent,
36 pub aio_lio_opcode: ::c_int
37 }
38
9e0c209e
SL
39 pub struct utmpx {
40 pub ut_user: [::c_char; _UTX_USERSIZE],
41 pub ut_id: [::c_char; _UTX_IDSIZE],
42 pub ut_line: [::c_char; _UTX_LINESIZE],
43 pub ut_pid: ::pid_t,
44 pub ut_type: ::c_short,
45 pub ut_tv: ::timeval,
46 pub ut_host: [::c_char; _UTX_HOSTSIZE],
47 ut_pad: [::uint32_t; 16],
48 }
49
92a42be0
SL
50 pub struct glob_t {
51 pub gl_pathc: ::size_t,
52 __unused1: ::c_int,
53 pub gl_offs: ::size_t,
54 __unused2: ::c_int,
55 pub gl_pathv: *mut *mut ::c_char,
56
57 __unused3: *mut ::c_void,
58
59 __unused4: *mut ::c_void,
60 __unused5: *mut ::c_void,
61 __unused6: *mut ::c_void,
62 __unused7: *mut ::c_void,
63 __unused8: *mut ::c_void,
64 }
65
66 pub struct sockaddr_storage {
67 pub ss_len: u8,
68 pub ss_family: ::sa_family_t,
69 __ss_pad1: [u8; 6],
70 __ss_align: i64,
71 __ss_pad2: [u8; 112],
72 }
73
74 pub struct addrinfo {
75 pub ai_flags: ::c_int,
76 pub ai_family: ::c_int,
77 pub ai_socktype: ::c_int,
78 pub ai_protocol: ::c_int,
79 pub ai_addrlen: ::socklen_t,
80 pub ai_canonname: *mut ::c_char,
81 pub ai_addr: *mut ::sockaddr,
82 pub ai_next: *mut addrinfo,
83 }
84
85 pub struct mach_timebase_info {
86 pub numer: u32,
87 pub denom: u32,
88 }
89
90 pub struct stat {
91 pub st_dev: dev_t,
92 pub st_mode: mode_t,
93 pub st_nlink: nlink_t,
94 pub st_ino: ino_t,
95 pub st_uid: ::uid_t,
96 pub st_gid: ::gid_t,
97 pub st_rdev: dev_t,
98 pub st_atime: time_t,
99 pub st_atime_nsec: c_long,
100 pub st_mtime: time_t,
101 pub st_mtime_nsec: c_long,
102 pub st_ctime: time_t,
103 pub st_ctime_nsec: c_long,
104 pub st_birthtime: time_t,
105 pub st_birthtime_nsec: c_long,
106 pub st_size: ::off_t,
107 pub st_blocks: ::blkcnt_t,
108 pub st_blksize: blksize_t,
109 pub st_flags: ::uint32_t,
110 pub st_gen: ::uint32_t,
111 pub st_lspare: ::int32_t,
112 pub st_qspare: [::int64_t; 2],
113 }
114
115 pub struct dirent {
116 pub d_ino: u64,
117 pub d_seekoff: u64,
118 pub d_reclen: u16,
119 pub d_namlen: u16,
120 pub d_type: u8,
121 pub d_name: [::c_char; 1024],
122 }
123
124 pub struct pthread_mutex_t {
125 __sig: ::c_long,
126 __opaque: [u8; __PTHREAD_MUTEX_SIZE__],
127 }
128
129 pub struct pthread_mutexattr_t {
130 __sig: ::c_long,
131 __opaque: [u8; 8],
132 }
133
134 pub struct pthread_cond_t {
135 __sig: ::c_long,
136 __opaque: [u8; __PTHREAD_COND_SIZE__],
137 }
138
5bcae85e
SL
139 pub struct pthread_condattr_t {
140 __sig: ::c_long,
141 __opaque: [u8; __PTHREAD_CONDATTR_SIZE__],
142 }
143
92a42be0
SL
144 pub struct pthread_rwlock_t {
145 __sig: ::c_long,
146 __opaque: [u8; __PTHREAD_RWLOCK_SIZE__],
147 }
148
3b2f2976
XL
149 pub struct pthread_rwlockattr_t {
150 __sig: ::c_long,
151 __opaque: [u8; __PTHREAD_RWLOCKATTR_SIZE__],
152 }
153
92a42be0
SL
154 pub struct siginfo_t {
155 pub si_signo: ::c_int,
156 pub si_errno: ::c_int,
157 pub si_code: ::c_int,
158 pub si_pid: ::pid_t,
159 pub si_uid: ::uid_t,
160 pub si_status: ::c_int,
161 pub si_addr: *mut ::c_void,
162 _pad: [usize; 9],
163 }
164
165 pub struct sigaction {
166 pub sa_sigaction: ::sighandler_t,
167 pub sa_mask: sigset_t,
168 pub sa_flags: ::c_int,
169 }
170
171 pub struct stack_t {
172 pub ss_sp: *mut ::c_void,
173 pub ss_size: ::size_t,
174 pub ss_flags: ::c_int,
175 }
176
177 pub struct fstore_t {
178 pub fst_flags: ::c_uint,
179 pub fst_posmode: ::c_int,
180 pub fst_offset: ::off_t,
181 pub fst_length: ::off_t,
182 pub fst_bytesalloc: ::off_t,
183 }
184
185 pub struct radvisory {
186 pub ra_offset: ::off_t,
187 pub ra_count: ::c_int,
188 }
189
190 pub struct statvfs {
191 pub f_bsize: ::c_ulong,
192 pub f_frsize: ::c_ulong,
193 pub f_blocks: ::fsblkcnt_t,
194 pub f_bfree: ::fsblkcnt_t,
195 pub f_bavail: ::fsblkcnt_t,
196 pub f_files: ::fsfilcnt_t,
197 pub f_ffree: ::fsfilcnt_t,
198 pub f_favail: ::fsfilcnt_t,
199 pub f_fsid: ::c_ulong,
200 pub f_flag: ::c_ulong,
201 pub f_namemax: ::c_ulong,
202 }
9cc50fc6
SL
203
204 pub struct Dl_info {
205 pub dli_fname: *const ::c_char,
206 pub dli_fbase: *mut ::c_void,
207 pub dli_sname: *const ::c_char,
208 pub dli_saddr: *mut ::c_void,
209 }
210
211 pub struct sockaddr_in {
212 pub sin_len: u8,
213 pub sin_family: ::sa_family_t,
214 pub sin_port: ::in_port_t,
215 pub sin_addr: ::in_addr,
216 pub sin_zero: [::c_char; 8],
217 }
218
219 pub struct statfs {
220 pub f_bsize: ::uint32_t,
221 pub f_iosize: ::int32_t,
222 pub f_blocks: ::uint64_t,
223 pub f_bfree: ::uint64_t,
224 pub f_bavail: ::uint64_t,
225 pub f_files: ::uint64_t,
226 pub f_ffree: ::uint64_t,
227 pub f_fsid: ::fsid_t,
228 pub f_owner: ::uid_t,
229 pub f_type: ::uint32_t,
230 pub f_flags: ::uint32_t,
231 pub f_fssubtype: ::uint32_t,
232 pub f_fstypename: [::c_char; 16],
233 pub f_mntonname: [::c_char; 1024],
234 pub f_mntfromname: [::c_char; 1024],
235 pub f_reserved: [::uint32_t; 8],
236 }
237
238 // FIXME: this should have align 4 but it's got align 8 on 64-bit
239 pub struct kevent {
240 pub ident: ::uintptr_t,
241 pub filter: ::int16_t,
242 pub flags: ::uint16_t,
243 pub fflags: ::uint32_t,
244 pub data: ::intptr_t,
245 pub udata: *mut ::c_void,
246 }
247
248 pub struct kevent64_s {
249 pub ident: ::uint64_t,
250 pub filter: ::int16_t,
251 pub flags: ::uint16_t,
252 pub fflags: ::uint32_t,
253 pub data: ::int64_t,
254 pub udata: ::uint64_t,
255 pub ext: [::uint64_t; 2],
256 }
257
258 pub struct dqblk {
259 pub dqb_bhardlimit: ::uint64_t,
260 pub dqb_bsoftlimit: ::uint64_t,
261 pub dqb_curbytes: ::uint64_t,
262 pub dqb_ihardlimit: ::uint32_t,
263 pub dqb_isoftlimit: ::uint32_t,
264 pub dqb_curinodes: ::uint32_t,
265 pub dqb_btime: ::uint32_t,
266 pub dqb_itime: ::uint32_t,
267 pub dqb_id: ::uint32_t,
268 pub dqb_spare: [::uint32_t; 4],
269 }
270
3b2f2976
XL
271 pub struct if_msghdr {
272 pub ifm_msglen: ::c_ushort,
273 pub ifm_version: ::c_uchar,
274 pub ifm_type: ::c_uchar,
275 pub ifm_addrs: ::c_int,
276 pub ifm_flags: ::c_int,
277 pub ifm_index: ::c_ushort,
278 pub ifm_data: if_data,
279 }
280
9cc50fc6
SL
281 pub struct termios {
282 pub c_iflag: ::tcflag_t,
283 pub c_oflag: ::tcflag_t,
284 pub c_cflag: ::tcflag_t,
285 pub c_lflag: ::tcflag_t,
286 pub c_cc: [::cc_t; ::NCCS],
287 pub c_ispeed: ::speed_t,
288 pub c_ospeed: ::speed_t,
289 }
7453a54e
SL
290
291 pub struct flock {
292 pub l_start: ::off_t,
293 pub l_len: ::off_t,
294 pub l_pid: ::pid_t,
295 pub l_type: ::c_short,
296 pub l_whence: ::c_short,
297 }
298
299 pub struct sf_hdtr {
300 pub headers: *mut ::iovec,
301 pub hdr_cnt: ::c_int,
302 pub trailers: *mut ::iovec,
303 pub trl_cnt: ::c_int,
304 }
54a0048b
SL
305
306 pub struct lconv {
307 pub decimal_point: *mut ::c_char,
308 pub thousands_sep: *mut ::c_char,
309 pub grouping: *mut ::c_char,
310 pub int_curr_symbol: *mut ::c_char,
311 pub currency_symbol: *mut ::c_char,
312 pub mon_decimal_point: *mut ::c_char,
313 pub mon_thousands_sep: *mut ::c_char,
314 pub mon_grouping: *mut ::c_char,
315 pub positive_sign: *mut ::c_char,
316 pub negative_sign: *mut ::c_char,
317 pub int_frac_digits: ::c_char,
318 pub frac_digits: ::c_char,
319 pub p_cs_precedes: ::c_char,
320 pub p_sep_by_space: ::c_char,
321 pub n_cs_precedes: ::c_char,
322 pub n_sep_by_space: ::c_char,
323 pub p_sign_posn: ::c_char,
324 pub n_sign_posn: ::c_char,
325 pub int_p_cs_precedes: ::c_char,
326 pub int_n_cs_precedes: ::c_char,
327 pub int_p_sep_by_space: ::c_char,
328 pub int_n_sep_by_space: ::c_char,
329 pub int_p_sign_posn: ::c_char,
330 pub int_n_sign_posn: ::c_char,
331 }
476ff2be
SL
332
333 pub struct sigevent {
334 pub sigev_notify: ::c_int,
335 pub sigev_signo: ::c_int,
336 pub sigev_value: ::sigval,
337 __unused1: *mut ::c_void, //actually a function pointer
338 pub sigev_notify_attributes: *mut ::pthread_attr_t
339 }
3b2f2976
XL
340
341 pub struct proc_taskinfo {
342 pub pti_virtual_size: u64,
343 pub pti_resident_size: u64,
344 pub pti_total_user: u64,
345 pub pti_total_system: u64,
346 pub pti_threads_user: u64,
347 pub pti_threads_system: u64,
348 pub pti_policy: i32,
349 pub pti_faults: i32,
350 pub pti_pageins: i32,
351 pub pti_cow_faults: i32,
352 pub pti_messages_sent: i32,
353 pub pti_messages_received: i32,
354 pub pti_syscalls_mach: i32,
355 pub pti_syscalls_unix: i32,
356 pub pti_csw: i32,
357 pub pti_threadnum: i32,
358 pub pti_numrunning: i32,
359 pub pti_priority: i32,
360 }
361
362 pub struct proc_bsdinfo {
363 pub pbi_flags: u32,
364 pub pbi_status: u32,
365 pub pbi_xstatus: u32,
366 pub pbi_pid: u32,
367 pub pbi_ppid: u32,
368 pub pbi_uid: ::uid_t,
369 pub pbi_gid: ::gid_t,
370 pub pbi_ruid: ::uid_t,
371 pub pbi_rgid: ::gid_t,
372 pub pbi_svuid: ::uid_t,
373 pub pbi_svgid: ::gid_t,
374 pub rfu_1: u32,
375 pub pbi_comm: [::c_char; MAXCOMLEN],
376 pub pbi_name: [::c_char; 32], // MAXCOMLEN * 2, but macro isn't happy...
377 pub pbi_nfiles: u32,
378 pub pbi_pgid: u32,
379 pub pbi_pjobc: u32,
380 pub e_tdev: u32,
381 pub e_tpgid: u32,
382 pub pbi_nice: i32,
383 pub pbi_start_tvsec: u64,
384 pub pbi_start_tvusec: u64,
385 }
386
387 pub struct proc_taskallinfo {
388 pub pbsd: proc_bsdinfo,
389 pub ptinfo: proc_taskinfo,
390 }
391
392 pub struct proc_threadinfo {
393 pub pth_user_time: u64,
394 pub pth_system_time: u64,
395 pub pth_cpu_usage: i32,
396 pub pth_policy: i32,
397 pub pth_run_state: i32,
398 pub pth_flags: i32,
399 pub pth_sleep_time: i32,
400 pub pth_curpri: i32,
401 pub pth_priority: i32,
402 pub pth_maxpriority: i32,
403 pub pth_name: [::c_char; MAXTHREADNAMESIZE],
404 }
405
406 pub struct xsw_usage {
407 pub xsu_total: u64,
408 pub xsu_avail: u64,
409 pub xsu_used: u64,
410 pub xsu_pagesize: u32,
411 pub xsu_encrypted: ::boolean_t,
412 }
92a42be0
SL
413}
414
9e0c209e
SL
415pub const _UTX_USERSIZE: usize = 256;
416pub const _UTX_LINESIZE: usize = 32;
417pub const _UTX_IDSIZE: usize = 4;
418pub const _UTX_HOSTSIZE: usize = 256;
419
420pub const EMPTY: ::c_short = 0;
421pub const RUN_LVL: ::c_short = 1;
422pub const BOOT_TIME: ::c_short = 2;
423pub const OLD_TIME: ::c_short = 3;
424pub const NEW_TIME: ::c_short = 4;
425pub const INIT_PROCESS: ::c_short = 5;
426pub const LOGIN_PROCESS: ::c_short = 6;
427pub const USER_PROCESS: ::c_short = 7;
428pub const DEAD_PROCESS: ::c_short = 8;
429pub const ACCOUNTING: ::c_short = 9;
430pub const SIGNATURE: ::c_short = 10;
431pub const SHUTDOWN_TIME: ::c_short = 11;
432
a7813a04
XL
433pub const LC_COLLATE_MASK: ::c_int = (1 << 0);
434pub const LC_CTYPE_MASK: ::c_int = (1 << 1);
435pub const LC_MESSAGES_MASK: ::c_int = (1 << 2);
436pub const LC_MONETARY_MASK: ::c_int = (1 << 3);
437pub const LC_NUMERIC_MASK: ::c_int = (1 << 4);
438pub const LC_TIME_MASK: ::c_int = (1 << 5);
439pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
440 | LC_CTYPE_MASK
441 | LC_MESSAGES_MASK
442 | LC_MONETARY_MASK
443 | LC_NUMERIC_MASK
444 | LC_TIME_MASK;
445
446pub const CODESET: ::nl_item = 0;
447pub const D_T_FMT: ::nl_item = 1;
448pub const D_FMT: ::nl_item = 2;
449pub const T_FMT: ::nl_item = 3;
450pub const T_FMT_AMPM: ::nl_item = 4;
451pub const AM_STR: ::nl_item = 5;
452pub const PM_STR: ::nl_item = 6;
453
454pub const DAY_1: ::nl_item = 7;
455pub const DAY_2: ::nl_item = 8;
456pub const DAY_3: ::nl_item = 9;
457pub const DAY_4: ::nl_item = 10;
458pub const DAY_5: ::nl_item = 11;
459pub const DAY_6: ::nl_item = 12;
460pub const DAY_7: ::nl_item = 13;
461
462pub const ABDAY_1: ::nl_item = 14;
463pub const ABDAY_2: ::nl_item = 15;
464pub const ABDAY_3: ::nl_item = 16;
465pub const ABDAY_4: ::nl_item = 17;
466pub const ABDAY_5: ::nl_item = 18;
467pub const ABDAY_6: ::nl_item = 19;
468pub const ABDAY_7: ::nl_item = 20;
469
470pub const MON_1: ::nl_item = 21;
471pub const MON_2: ::nl_item = 22;
472pub const MON_3: ::nl_item = 23;
473pub const MON_4: ::nl_item = 24;
474pub const MON_5: ::nl_item = 25;
475pub const MON_6: ::nl_item = 26;
476pub const MON_7: ::nl_item = 27;
477pub const MON_8: ::nl_item = 28;
478pub const MON_9: ::nl_item = 29;
479pub const MON_10: ::nl_item = 30;
480pub const MON_11: ::nl_item = 31;
481pub const MON_12: ::nl_item = 32;
482
483pub const ABMON_1: ::nl_item = 33;
484pub const ABMON_2: ::nl_item = 34;
485pub const ABMON_3: ::nl_item = 35;
486pub const ABMON_4: ::nl_item = 36;
487pub const ABMON_5: ::nl_item = 37;
488pub const ABMON_6: ::nl_item = 38;
489pub const ABMON_7: ::nl_item = 39;
490pub const ABMON_8: ::nl_item = 40;
491pub const ABMON_9: ::nl_item = 41;
492pub const ABMON_10: ::nl_item = 42;
493pub const ABMON_11: ::nl_item = 43;
494pub const ABMON_12: ::nl_item = 44;
495
496pub const ERA: ::nl_item = 45;
497pub const ERA_D_FMT: ::nl_item = 46;
498pub const ERA_D_T_FMT: ::nl_item = 47;
499pub const ERA_T_FMT: ::nl_item = 48;
500pub const ALT_DIGITS: ::nl_item = 49;
501
502pub const RADIXCHAR: ::nl_item = 50;
503pub const THOUSEP: ::nl_item = 51;
504
505pub const YESEXPR: ::nl_item = 52;
506pub const NOEXPR: ::nl_item = 53;
507
508pub const YESSTR: ::nl_item = 54;
509pub const NOSTR: ::nl_item = 55;
510
511pub const CRNCYSTR: ::nl_item = 56;
512
513pub const D_MD_ORDER: ::nl_item = 57;
514
92a42be0
SL
515pub const EXIT_FAILURE: ::c_int = 1;
516pub const EXIT_SUCCESS: ::c_int = 0;
517pub const RAND_MAX: ::c_int = 2147483647;
518pub const EOF: ::c_int = -1;
519pub const SEEK_SET: ::c_int = 0;
520pub const SEEK_CUR: ::c_int = 1;
521pub const SEEK_END: ::c_int = 2;
522pub const _IOFBF: ::c_int = 0;
523pub const _IONBF: ::c_int = 2;
524pub const _IOLBF: ::c_int = 1;
525pub const BUFSIZ: ::c_uint = 1024;
526pub const FOPEN_MAX: ::c_uint = 20;
527pub const FILENAME_MAX: ::c_uint = 1024;
528pub const L_tmpnam: ::c_uint = 1024;
529pub const TMP_MAX: ::c_uint = 308915776;
5bcae85e
SL
530pub const _PC_LINK_MAX: ::c_int = 1;
531pub const _PC_MAX_CANON: ::c_int = 2;
532pub const _PC_MAX_INPUT: ::c_int = 3;
92a42be0 533pub const _PC_NAME_MAX: ::c_int = 4;
5bcae85e
SL
534pub const _PC_PATH_MAX: ::c_int = 5;
535pub const _PC_PIPE_BUF: ::c_int = 6;
536pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
537pub const _PC_NO_TRUNC: ::c_int = 8;
538pub const _PC_VDISABLE: ::c_int = 9;
3b2f2976
XL
539pub const O_DSYNC: ::c_int = 0x400000;
540pub const O_NOCTTY: ::c_int = 0x20000;
92a42be0 541pub const O_CLOEXEC: ::c_int = 0x1000000;
9cc50fc6 542pub const O_DIRECTORY: ::c_int = 0x100000;
92a42be0
SL
543pub const S_IFIFO: mode_t = 4096;
544pub const S_IFCHR: mode_t = 8192;
545pub const S_IFBLK: mode_t = 24576;
546pub const S_IFDIR: mode_t = 16384;
547pub const S_IFREG: mode_t = 32768;
548pub const S_IFLNK: mode_t = 40960;
549pub const S_IFSOCK: mode_t = 49152;
550pub const S_IFMT: mode_t = 61440;
551pub const S_IEXEC: mode_t = 64;
552pub const S_IWRITE: mode_t = 128;
553pub const S_IREAD: mode_t = 256;
554pub const S_IRWXU: mode_t = 448;
555pub const S_IXUSR: mode_t = 64;
556pub const S_IWUSR: mode_t = 128;
557pub const S_IRUSR: mode_t = 256;
558pub const S_IRWXG: mode_t = 56;
559pub const S_IXGRP: mode_t = 8;
560pub const S_IWGRP: mode_t = 16;
561pub const S_IRGRP: mode_t = 32;
562pub const S_IRWXO: mode_t = 7;
563pub const S_IXOTH: mode_t = 1;
564pub const S_IWOTH: mode_t = 2;
565pub const S_IROTH: mode_t = 4;
566pub const F_OK: ::c_int = 0;
567pub const R_OK: ::c_int = 4;
568pub const W_OK: ::c_int = 2;
569pub const X_OK: ::c_int = 1;
570pub const STDIN_FILENO: ::c_int = 0;
571pub const STDOUT_FILENO: ::c_int = 1;
572pub const STDERR_FILENO: ::c_int = 2;
573pub const F_LOCK: ::c_int = 1;
574pub const F_TEST: ::c_int = 3;
575pub const F_TLOCK: ::c_int = 2;
576pub const F_ULOCK: ::c_int = 0;
7453a54e
SL
577pub const F_GETLK: ::c_int = 7;
578pub const F_SETLK: ::c_int = 8;
579pub const F_SETLKW: ::c_int = 9;
92a42be0
SL
580pub const SIGHUP: ::c_int = 1;
581pub const SIGINT: ::c_int = 2;
582pub const SIGQUIT: ::c_int = 3;
583pub const SIGILL: ::c_int = 4;
584pub const SIGABRT: ::c_int = 6;
a7813a04 585pub const SIGEMT: ::c_int = 7;
92a42be0
SL
586pub const SIGFPE: ::c_int = 8;
587pub const SIGKILL: ::c_int = 9;
588pub const SIGSEGV: ::c_int = 11;
589pub const SIGPIPE: ::c_int = 13;
590pub const SIGALRM: ::c_int = 14;
591pub const SIGTERM: ::c_int = 15;
592
593pub const PROT_NONE: ::c_int = 0;
594pub const PROT_READ: ::c_int = 1;
595pub const PROT_WRITE: ::c_int = 2;
596pub const PROT_EXEC: ::c_int = 4;
597
598pub const MAP_FILE: ::c_int = 0x0000;
599pub const MAP_SHARED: ::c_int = 0x0001;
600pub const MAP_PRIVATE: ::c_int = 0x0002;
601pub const MAP_FIXED: ::c_int = 0x0010;
602pub const MAP_ANON: ::c_int = 0x1000;
603
3b2f2976
XL
604pub const VM_FLAGS_FIXED: ::c_int = 0x0000;
605pub const VM_FLAGS_ANYWHERE: ::c_int = 0x0001;
606pub const VM_FLAGS_PURGABLE: ::c_int = 0x0002;
607pub const VM_FLAGS_RANDOM_ADDR: ::c_int = 0x0008;
608pub const VM_FLAGS_NO_CACHE: ::c_int = 0x0010;
609pub const VM_FLAGS_RESILIENT_CODESIGN: ::c_int = 0x0020;
610pub const VM_FLAGS_RESILIENT_MEDIA: ::c_int = 0x0040;
611pub const VM_FLAGS_OVERWRITE: ::c_int = 0x4000;
612pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000;
613pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000;
614pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000;
615pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000;
616pub const VM_FLAGS_USER_ALLOCATE: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE |
617 VM_FLAGS_PURGABLE |
618 VM_FLAGS_RANDOM_ADDR |
619 VM_FLAGS_NO_CACHE |
620 VM_FLAGS_OVERWRITE |
621 VM_FLAGS_SUPERPAGE_MASK |
622 VM_FLAGS_ALIAS_MASK;
623pub const VM_FLAGS_USER_MAP: ::c_int = VM_FLAGS_USER_ALLOCATE |
624 VM_FLAGS_RETURN_4K_DATA_ADDR |
625 VM_FLAGS_RETURN_DATA_ADDR;
626pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE |
627 VM_FLAGS_RANDOM_ADDR |
628 VM_FLAGS_OVERWRITE |
629 VM_FLAGS_RETURN_DATA_ADDR |
630 VM_FLAGS_RESILIENT_CODESIGN;
631
632pub const VM_FLAGS_SUPERPAGE_SHIFT: ::c_int = 16;
633pub const SUPERPAGE_NONE: ::c_int = 0;
634pub const SUPERPAGE_SIZE_ANY: ::c_int = 1;
635pub const VM_FLAGS_SUPERPAGE_NONE: ::c_int = SUPERPAGE_NONE <<
636 VM_FLAGS_SUPERPAGE_SHIFT;
637pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: ::c_int = SUPERPAGE_SIZE_ANY <<
638 VM_FLAGS_SUPERPAGE_SHIFT;
639pub const SUPERPAGE_SIZE_2MB: ::c_int = 2;
640pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: ::c_int = SUPERPAGE_SIZE_2MB <<
641 VM_FLAGS_SUPERPAGE_SHIFT;
642
643pub const VM_MEMORY_MALLOC: ::c_int = 1;
644pub const VM_MEMORY_MALLOC_SMALL: ::c_int = 2;
645pub const VM_MEMORY_MALLOC_LARGE: ::c_int = 3;
646pub const VM_MEMORY_MALLOC_HUGE: ::c_int = 4;
647pub const VM_MEMORY_SBRK: ::c_int = 5;
648pub const VM_MEMORY_REALLOC: ::c_int = 6;
649pub const VM_MEMORY_MALLOC_TINY: ::c_int = 7;
650pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: ::c_int = 8;
651pub const VM_MEMORY_MALLOC_LARGE_REUSED: ::c_int = 9;
652pub const VM_MEMORY_ANALYSIS_TOOL: ::c_int = 10;
653pub const VM_MEMORY_MALLOC_NANO: ::c_int = 11;
654pub const VM_MEMORY_MACH_MSG: ::c_int = 20;
655pub const VM_MEMORY_IOKIT: ::c_int = 21;
656pub const VM_MEMORY_STACK: ::c_int = 30;
657pub const VM_MEMORY_GUARD: ::c_int = 31;
658pub const VM_MEMORY_SHARED_PMAP: ::c_int = 32;
659pub const VM_MEMORY_DYLIB: ::c_int = 33;
660pub const VM_MEMORY_OBJC_DISPATCHERS: ::c_int = 34;
661pub const VM_MEMORY_UNSHARED_PMAP: ::c_int = 35;
662pub const VM_MEMORY_APPKIT: ::c_int = 40;
663pub const VM_MEMORY_FOUNDATION: ::c_int = 41;
664pub const VM_MEMORY_COREGRAPHICS: ::c_int = 42;
665pub const VM_MEMORY_CORESERVICES: ::c_int = 43;
666pub const VM_MEMORY_CARBON: ::c_int = VM_MEMORY_CORESERVICES;
667pub const VM_MEMORY_JAVA: ::c_int = 44;
668pub const VM_MEMORY_COREDATA: ::c_int = 45;
669pub const VM_MEMORY_COREDATA_OBJECTIDS: ::c_int = 46;
670pub const VM_MEMORY_ATS: ::c_int = 50;
671pub const VM_MEMORY_LAYERKIT: ::c_int = 51;
672pub const VM_MEMORY_CGIMAGE: ::c_int = 52;
673pub const VM_MEMORY_TCMALLOC: ::c_int = 53;
674pub const VM_MEMORY_COREGRAPHICS_DATA: ::c_int = 54;
675pub const VM_MEMORY_COREGRAPHICS_SHARED: ::c_int = 55;
676pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: ::c_int = 56;
677pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: ::c_int = 57;
678pub const VM_MEMORY_COREGRAPHICS_XALLOC: ::c_int = 58;
679pub const VM_MEMORY_COREGRAPHICS_MISC: ::c_int = VM_MEMORY_COREGRAPHICS;
680pub const VM_MEMORY_DYLD: ::c_int = 60;
681pub const VM_MEMORY_DYLD_MALLOC: ::c_int = 61;
682pub const VM_MEMORY_SQLITE: ::c_int = 62;
683pub const VM_MEMORY_JAVASCRIPT_CORE: ::c_int = 63;
684pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: ::c_int = 64;
685pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: ::c_int = 65;
686pub const VM_MEMORY_GLSL: ::c_int = 66;
687pub const VM_MEMORY_OPENCL: ::c_int = 67;
688pub const VM_MEMORY_COREIMAGE: ::c_int = 68;
689pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: ::c_int = 69;
690pub const VM_MEMORY_IMAGEIO: ::c_int = 70;
691pub const VM_MEMORY_COREPROFILE: ::c_int = 71;
692pub const VM_MEMORY_ASSETSD: ::c_int = 72;
693pub const VM_MEMORY_OS_ALLOC_ONCE: ::c_int = 73;
694pub const VM_MEMORY_LIBDISPATCH: ::c_int = 74;
695pub const VM_MEMORY_ACCELERATE: ::c_int = 75;
696pub const VM_MEMORY_COREUI: ::c_int = 76;
697pub const VM_MEMORY_COREUIFILE: ::c_int = 77;
698pub const VM_MEMORY_GENEALOGY: ::c_int = 78;
699pub const VM_MEMORY_RAWCAMERA: ::c_int = 79;
700pub const VM_MEMORY_CORPSEINFO: ::c_int = 80;
701pub const VM_MEMORY_ASL: ::c_int = 81;
702pub const VM_MEMORY_SWIFT_RUNTIME: ::c_int = 82;
703pub const VM_MEMORY_SWIFT_METADATA: ::c_int = 83;
704pub const VM_MEMORY_DHMM: ::c_int = 84;
705pub const VM_MEMORY_SCENEKIT: ::c_int = 86;
706pub const VM_MEMORY_SKYWALK: ::c_int = 87;
707pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::c_int = 240;
708pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::c_int = 255;
709
92a42be0
SL
710pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
711
712pub const MCL_CURRENT: ::c_int = 0x0001;
713pub const MCL_FUTURE: ::c_int = 0x0002;
714
715pub const MS_ASYNC: ::c_int = 0x0001;
716pub const MS_INVALIDATE: ::c_int = 0x0002;
717pub const MS_SYNC: ::c_int = 0x0010;
718
719pub const MS_KILLPAGES: ::c_int = 0x0004;
720pub const MS_DEACTIVATE: ::c_int = 0x0008;
721
722pub const EPERM: ::c_int = 1;
723pub const ENOENT: ::c_int = 2;
724pub const ESRCH: ::c_int = 3;
725pub const EINTR: ::c_int = 4;
726pub const EIO: ::c_int = 5;
727pub const ENXIO: ::c_int = 6;
728pub const E2BIG: ::c_int = 7;
729pub const ENOEXEC: ::c_int = 8;
730pub const EBADF: ::c_int = 9;
731pub const ECHILD: ::c_int = 10;
732pub const EDEADLK: ::c_int = 11;
733pub const ENOMEM: ::c_int = 12;
734pub const EACCES: ::c_int = 13;
735pub const EFAULT: ::c_int = 14;
736pub const ENOTBLK: ::c_int = 15;
737pub const EBUSY: ::c_int = 16;
738pub const EEXIST: ::c_int = 17;
739pub const EXDEV: ::c_int = 18;
740pub const ENODEV: ::c_int = 19;
741pub const ENOTDIR: ::c_int = 20;
742pub const EISDIR: ::c_int = 21;
743pub const EINVAL: ::c_int = 22;
744pub const ENFILE: ::c_int = 23;
745pub const EMFILE: ::c_int = 24;
746pub const ENOTTY: ::c_int = 25;
747pub const ETXTBSY: ::c_int = 26;
748pub const EFBIG: ::c_int = 27;
749pub const ENOSPC: ::c_int = 28;
750pub const ESPIPE: ::c_int = 29;
751pub const EROFS: ::c_int = 30;
752pub const EMLINK: ::c_int = 31;
753pub const EPIPE: ::c_int = 32;
754pub const EDOM: ::c_int = 33;
755pub const ERANGE: ::c_int = 34;
756pub const EAGAIN: ::c_int = 35;
757pub const EWOULDBLOCK: ::c_int = EAGAIN;
758pub const EINPROGRESS: ::c_int = 36;
759pub const EALREADY: ::c_int = 37;
760pub const ENOTSOCK: ::c_int = 38;
761pub const EDESTADDRREQ: ::c_int = 39;
762pub const EMSGSIZE: ::c_int = 40;
763pub const EPROTOTYPE: ::c_int = 41;
764pub const ENOPROTOOPT: ::c_int = 42;
765pub const EPROTONOSUPPORT: ::c_int = 43;
766pub const ESOCKTNOSUPPORT: ::c_int = 44;
767pub const ENOTSUP: ::c_int = 45;
768pub const EPFNOSUPPORT: ::c_int = 46;
769pub const EAFNOSUPPORT: ::c_int = 47;
770pub const EADDRINUSE: ::c_int = 48;
771pub const EADDRNOTAVAIL: ::c_int = 49;
772pub const ENETDOWN: ::c_int = 50;
773pub const ENETUNREACH: ::c_int = 51;
774pub const ENETRESET: ::c_int = 52;
775pub const ECONNABORTED: ::c_int = 53;
776pub const ECONNRESET: ::c_int = 54;
777pub const ENOBUFS: ::c_int = 55;
778pub const EISCONN: ::c_int = 56;
779pub const ENOTCONN: ::c_int = 57;
780pub const ESHUTDOWN: ::c_int = 58;
781pub const ETOOMANYREFS: ::c_int = 59;
782pub const ETIMEDOUT: ::c_int = 60;
783pub const ECONNREFUSED: ::c_int = 61;
784pub const ELOOP: ::c_int = 62;
785pub const ENAMETOOLONG: ::c_int = 63;
786pub const EHOSTDOWN: ::c_int = 64;
787pub const EHOSTUNREACH: ::c_int = 65;
788pub const ENOTEMPTY: ::c_int = 66;
789pub const EPROCLIM: ::c_int = 67;
790pub const EUSERS: ::c_int = 68;
791pub const EDQUOT: ::c_int = 69;
792pub const ESTALE: ::c_int = 70;
793pub const EREMOTE: ::c_int = 71;
794pub const EBADRPC: ::c_int = 72;
795pub const ERPCMISMATCH: ::c_int = 73;
796pub const EPROGUNAVAIL: ::c_int = 74;
797pub const EPROGMISMATCH: ::c_int = 75;
798pub const EPROCUNAVAIL: ::c_int = 76;
799pub const ENOLCK: ::c_int = 77;
800pub const ENOSYS: ::c_int = 78;
801pub const EFTYPE: ::c_int = 79;
802pub const EAUTH: ::c_int = 80;
803pub const ENEEDAUTH: ::c_int = 81;
804pub const EPWROFF: ::c_int = 82;
805pub const EDEVERR: ::c_int = 83;
806pub const EOVERFLOW: ::c_int = 84;
807pub const EBADEXEC: ::c_int = 85;
808pub const EBADARCH: ::c_int = 86;
809pub const ESHLIBVERS: ::c_int = 87;
810pub const EBADMACHO: ::c_int = 88;
811pub const ECANCELED: ::c_int = 89;
812pub const EIDRM: ::c_int = 90;
813pub const ENOMSG: ::c_int = 91;
814pub const EILSEQ: ::c_int = 92;
815pub const ENOATTR: ::c_int = 93;
816pub const EBADMSG: ::c_int = 94;
817pub const EMULTIHOP: ::c_int = 95;
818pub const ENODATA: ::c_int = 96;
819pub const ENOLINK: ::c_int = 97;
820pub const ENOSR: ::c_int = 98;
821pub const ENOSTR: ::c_int = 99;
822pub const EPROTO: ::c_int = 100;
823pub const ETIME: ::c_int = 101;
824pub const EOPNOTSUPP: ::c_int = 102;
825pub const ENOPOLICY: ::c_int = 103;
826pub const ENOTRECOVERABLE: ::c_int = 104;
827pub const EOWNERDEAD: ::c_int = 105;
828pub const EQFULL: ::c_int = 106;
829pub const ELAST: ::c_int = 106;
830
9e0c209e
SL
831pub const EAI_SYSTEM: ::c_int = 11;
832
92a42be0
SL
833pub const F_DUPFD: ::c_int = 0;
834pub const F_DUPFD_CLOEXEC: ::c_int = 67;
835pub const F_GETFD: ::c_int = 1;
836pub const F_SETFD: ::c_int = 2;
837pub const F_GETFL: ::c_int = 3;
838pub const F_SETFL: ::c_int = 4;
839pub const F_PREALLOCATE: ::c_int = 42;
840pub const F_RDADVISE: ::c_int = 44;
841pub const F_RDAHEAD: ::c_int = 45;
842pub const F_NOCACHE: ::c_int = 48;
843pub const F_GETPATH: ::c_int = 50;
844pub const F_FULLFSYNC: ::c_int = 51;
845pub const F_FREEZE_FS: ::c_int = 53;
846pub const F_THAW_FS: ::c_int = 54;
847pub const F_GLOBAL_NOCACHE: ::c_int = 55;
848pub const F_NODIRECT: ::c_int = 62;
849
850pub const F_ALLOCATECONTIG: ::c_uint = 0x02;
851pub const F_ALLOCATEALL: ::c_uint = 0x04;
852
853pub const F_PEOFPOSMODE: ::c_int = 3;
854pub const F_VOLPOSMODE: ::c_int = 4;
855
cc61c64b
XL
856pub const AT_FDCWD: ::c_int = -2;
857pub const AT_EACCESS: ::c_int = 0x0010;
858pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0020;
859pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0040;
860pub const AT_REMOVEDIR: ::c_int = 0x0080;
861
54a0048b
SL
862pub const TIOCMODG: ::c_ulong = 0x40047403;
863pub const TIOCMODS: ::c_ulong = 0x80047404;
864pub const TIOCM_LE: ::c_int = 0x1;
865pub const TIOCM_DTR: ::c_int = 0x2;
866pub const TIOCM_RTS: ::c_int = 0x4;
867pub const TIOCM_ST: ::c_int = 0x8;
868pub const TIOCM_SR: ::c_int = 0x10;
869pub const TIOCM_CTS: ::c_int = 0x20;
870pub const TIOCM_CAR: ::c_int = 0x40;
871pub const TIOCM_CD: ::c_int = 0x40;
872pub const TIOCM_RNG: ::c_int = 0x80;
873pub const TIOCM_RI: ::c_int = 0x80;
874pub const TIOCM_DSR: ::c_int = 0x100;
875pub const TIOCEXCL: ::c_int = 0x2000740d;
876pub const TIOCNXCL: ::c_int = 0x2000740e;
877pub const TIOCFLUSH: ::c_ulong = 0x80047410;
878pub const TIOCGETD: ::c_ulong = 0x4004741a;
879pub const TIOCSETD: ::c_ulong = 0x8004741b;
880pub const TIOCIXON: ::c_uint = 0x20007481;
881pub const TIOCIXOFF: ::c_uint = 0x20007480;
882pub const TIOCSBRK: ::c_uint = 0x2000747b;
883pub const TIOCCBRK: ::c_uint = 0x2000747a;
884pub const TIOCSDTR: ::c_uint = 0x20007479;
885pub const TIOCCDTR: ::c_uint = 0x20007478;
886pub const TIOCGPGRP: ::c_ulong = 0x40047477;
887pub const TIOCSPGRP: ::c_ulong = 0x80047476;
888pub const TIOCOUTQ: ::c_ulong = 0x40047473;
889pub const TIOCSTI: ::c_ulong = 0x80017472;
890pub const TIOCNOTTY: ::c_uint = 0x20007471;
891pub const TIOCPKT: ::c_ulong = 0x80047470;
892pub const TIOCPKT_DATA: ::c_int = 0x0;
893pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1;
894pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2;
895pub const TIOCPKT_STOP: ::c_int = 0x4;
896pub const TIOCPKT_START: ::c_int = 0x8;
897pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
898pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
899pub const TIOCPKT_IOCTL: ::c_int = 0x40;
900pub const TIOCSTOP: ::c_uint = 0x2000746f;
901pub const TIOCSTART: ::c_uint = 0x2000746e;
902pub const TIOCMSET: ::c_ulong = 0x8004746d;
903pub const TIOCMBIS: ::c_ulong = 0x8004746c;
904pub const TIOCMBIC: ::c_ulong = 0x8004746b;
905pub const TIOCMGET: ::c_ulong = 0x4004746a;
906pub const TIOCREMOTE: ::c_ulong = 0x80047469;
907pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
908pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
909pub const TIOCUCNTL: ::c_ulong = 0x80047466;
910pub const TIOCSTAT: ::c_uint = 0x20007465;
911pub const TIOCSCONS: ::c_uint = 0x20007463;
912pub const TIOCCONS: ::c_ulong = 0x80047462;
913pub const TIOCSCTTY: ::c_uint = 0x20007461;
914pub const TIOCEXT: ::c_ulong = 0x80047460;
915pub const TIOCSIG: ::c_uint = 0x2000745f;
916pub const TIOCDRAIN: ::c_uint = 0x2000745e;
917pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
918pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a;
919pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
920pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456;
921pub const TIOCDSIMICROCODE: ::c_uint = 0x20007455;
922pub const TIOCPTYGRANT: ::c_uint = 0x20007454;
923pub const TIOCPTYGNAME: ::c_uint = 0x40807453;
924pub const TIOCPTYUNLK: ::c_uint = 0x20007452;
925
cc61c64b
XL
926pub const B0: speed_t = 0;
927pub const B50: speed_t = 50;
928pub const B75: speed_t = 75;
929pub const B110: speed_t = 110;
930pub const B134: speed_t = 134;
931pub const B150: speed_t = 150;
932pub const B200: speed_t = 200;
933pub const B300: speed_t = 300;
934pub const B600: speed_t = 600;
935pub const B1200: speed_t = 1200;
936pub const B1800: speed_t = 1800;
937pub const B2400: speed_t = 2400;
938pub const B4800: speed_t = 4800;
939pub const B9600: speed_t = 9600;
940pub const B19200: speed_t = 19200;
941pub const B38400: speed_t = 38400;
942pub const B7200: speed_t = 7200;
943pub const B14400: speed_t = 14400;
944pub const B28800: speed_t = 28800;
945pub const B57600: speed_t = 57600;
946pub const B76800: speed_t = 76800;
947pub const B115200: speed_t = 115200;
948pub const B230400: speed_t = 230400;
949pub const EXTA: speed_t = 19200;
950pub const EXTB: speed_t = 38400;
951
92a42be0
SL
952pub const SIGTRAP: ::c_int = 5;
953
954pub const GLOB_APPEND : ::c_int = 0x0001;
955pub const GLOB_DOOFFS : ::c_int = 0x0002;
956pub const GLOB_ERR : ::c_int = 0x0004;
957pub const GLOB_MARK : ::c_int = 0x0008;
958pub const GLOB_NOCHECK : ::c_int = 0x0010;
959pub const GLOB_NOSORT : ::c_int = 0x0020;
960pub const GLOB_NOESCAPE: ::c_int = 0x2000;
961
962pub const GLOB_NOSPACE : ::c_int = -1;
963pub const GLOB_ABORTED : ::c_int = -2;
964pub const GLOB_NOMATCH : ::c_int = -3;
965
966pub const POSIX_MADV_NORMAL: ::c_int = 0;
967pub const POSIX_MADV_RANDOM: ::c_int = 1;
968pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
969pub const POSIX_MADV_WILLNEED: ::c_int = 3;
970pub const POSIX_MADV_DONTNEED: ::c_int = 4;
971
972pub const _SC_IOV_MAX: ::c_int = 56;
973pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70;
974pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71;
975pub const _SC_LOGIN_NAME_MAX: ::c_int = 73;
976pub const _SC_MQ_PRIO_MAX: ::c_int = 75;
977pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82;
978pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83;
979pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85;
980pub const _SC_THREAD_KEYS_MAX: ::c_int = 86;
981pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87;
982pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88;
983pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89;
984pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90;
985pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91;
986pub const _SC_THREAD_STACK_MIN: ::c_int = 93;
987pub const _SC_THREAD_THREADS_MAX: ::c_int = 94;
988pub const _SC_THREADS: ::c_int = 96;
989pub const _SC_TTY_NAME_MAX: ::c_int = 101;
990pub const _SC_ATEXIT_MAX: ::c_int = 107;
991pub const _SC_XOPEN_CRYPT: ::c_int = 108;
992pub const _SC_XOPEN_ENH_I18N: ::c_int = 109;
993pub const _SC_XOPEN_LEGACY: ::c_int = 110;
994pub const _SC_XOPEN_REALTIME: ::c_int = 111;
995pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112;
996pub const _SC_XOPEN_SHM: ::c_int = 113;
997pub const _SC_XOPEN_UNIX: ::c_int = 115;
998pub const _SC_XOPEN_VERSION: ::c_int = 116;
999pub const _SC_XOPEN_XCU_VERSION: ::c_int = 121;
1000
3b2f2976
XL
1001pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 2;
1002pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
92a42be0
SL
1003pub const PTHREAD_CREATE_JOINABLE: ::c_int = 1;
1004pub const PTHREAD_CREATE_DETACHED: ::c_int = 2;
1005pub const PTHREAD_STACK_MIN: ::size_t = 8192;
1006
1007pub const RLIMIT_CPU: ::c_int = 0;
1008pub const RLIMIT_FSIZE: ::c_int = 1;
1009pub const RLIMIT_DATA: ::c_int = 2;
1010pub const RLIMIT_STACK: ::c_int = 3;
1011pub const RLIMIT_CORE: ::c_int = 4;
1012pub const RLIMIT_AS: ::c_int = 5;
a7813a04 1013pub const RLIMIT_RSS: ::c_int = RLIMIT_AS;
92a42be0
SL
1014pub const RLIMIT_MEMLOCK: ::c_int = 6;
1015pub const RLIMIT_NPROC: ::c_int = 7;
1016pub const RLIMIT_NOFILE: ::c_int = 8;
1017pub const RLIM_NLIMITS: ::c_int = 9;
1018pub const _RLIMIT_POSIX_FLAG: ::c_int = 0x1000;
1019
1020pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
1021
1022pub const RUSAGE_SELF: ::c_int = 0;
1023pub const RUSAGE_CHILDREN: ::c_int = -1;
1024
1025pub const MADV_NORMAL: ::c_int = 0;
1026pub const MADV_RANDOM: ::c_int = 1;
1027pub const MADV_SEQUENTIAL: ::c_int = 2;
1028pub const MADV_WILLNEED: ::c_int = 3;
1029pub const MADV_DONTNEED: ::c_int = 4;
1030pub const MADV_FREE: ::c_int = 5;
1031pub const MADV_ZERO_WIRED_PAGES: ::c_int = 6;
1032pub const MADV_FREE_REUSABLE: ::c_int = 7;
1033pub const MADV_FREE_REUSE: ::c_int = 8;
1034pub const MADV_CAN_REUSE: ::c_int = 9;
1035
1036pub const MINCORE_INCORE: ::c_int = 0x1;
1037pub const MINCORE_REFERENCED: ::c_int = 0x2;
1038pub const MINCORE_MODIFIED: ::c_int = 0x4;
1039pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
1040pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
1041
3b2f2976
XL
1042//
1043// sys/netinet/in.h
1044// Protocols (RFC 1700)
1045// NOTE: These are in addition to the constants defined in src/unix/mod.rs
1046
1047// IPPROTO_IP defined in src/unix/mod.rs
1048/// IP6 hop-by-hop options
1049pub const IPPROTO_HOPOPTS: ::c_int = 0;
1050// IPPROTO_ICMP defined in src/unix/mod.rs
1051/// group mgmt protocol
1052pub const IPPROTO_IGMP: ::c_int = 2;
1053/// gateway^2 (deprecated)
1054pub const IPPROTO_GGP: ::c_int = 3;
1055/// for compatibility
1056pub const IPPROTO_IPIP: ::c_int = 4;
1057// IPPROTO_TCP defined in src/unix/mod.rs
1058/// Stream protocol II.
1059pub const IPPROTO_ST: ::c_int = 7;
1060/// exterior gateway protocol
1061pub const IPPROTO_EGP: ::c_int = 8;
1062/// private interior gateway
1063pub const IPPROTO_PIGP: ::c_int = 9;
1064/// BBN RCC Monitoring
1065pub const IPPROTO_RCCMON: ::c_int = 10;
1066/// network voice protocol
1067pub const IPPROTO_NVPII: ::c_int = 11;
1068/// pup
1069pub const IPPROTO_PUP: ::c_int = 12;
1070/// Argus
1071pub const IPPROTO_ARGUS: ::c_int = 13;
1072/// EMCON
1073pub const IPPROTO_EMCON: ::c_int = 14;
1074/// Cross Net Debugger
1075pub const IPPROTO_XNET: ::c_int = 15;
1076/// Chaos
1077pub const IPPROTO_CHAOS: ::c_int = 16;
1078// IPPROTO_UDP defined in src/unix/mod.rs
1079/// Multiplexing
1080pub const IPPROTO_MUX: ::c_int = 18;
1081/// DCN Measurement Subsystems
1082pub const IPPROTO_MEAS: ::c_int = 19;
1083/// Host Monitoring
1084pub const IPPROTO_HMP: ::c_int = 20;
1085/// Packet Radio Measurement
1086pub const IPPROTO_PRM: ::c_int = 21;
1087/// xns idp
1088pub const IPPROTO_IDP: ::c_int = 22;
1089/// Trunk-1
1090pub const IPPROTO_TRUNK1: ::c_int = 23;
1091/// Trunk-2
1092pub const IPPROTO_TRUNK2: ::c_int = 24;
1093/// Leaf-1
1094pub const IPPROTO_LEAF1: ::c_int = 25;
1095/// Leaf-2
1096pub const IPPROTO_LEAF2: ::c_int = 26;
1097/// Reliable Data
1098pub const IPPROTO_RDP: ::c_int = 27;
1099/// Reliable Transaction
1100pub const IPPROTO_IRTP: ::c_int = 28;
1101/// tp-4 w/ class negotiation
1102pub const IPPROTO_TP: ::c_int = 29;
1103/// Bulk Data Transfer
1104pub const IPPROTO_BLT: ::c_int = 30;
1105/// Network Services
1106pub const IPPROTO_NSP: ::c_int = 31;
1107/// Merit Internodal
1108pub const IPPROTO_INP: ::c_int = 32;
1109/// Sequential Exchange
1110pub const IPPROTO_SEP: ::c_int = 33;
1111/// Third Party Connect
1112pub const IPPROTO_3PC: ::c_int = 34;
1113/// InterDomain Policy Routing
1114pub const IPPROTO_IDPR: ::c_int = 35;
1115/// XTP
1116pub const IPPROTO_XTP: ::c_int = 36;
1117/// Datagram Delivery
1118pub const IPPROTO_DDP: ::c_int = 37;
1119/// Control Message Transport
1120pub const IPPROTO_CMTP: ::c_int = 38;
1121/// TP++ Transport
1122pub const IPPROTO_TPXX: ::c_int = 39;
1123/// IL transport protocol
1124pub const IPPROTO_IL: ::c_int = 40;
1125// IPPROTO_IPV6 defined in src/unix/mod.rs
1126/// Source Demand Routing
1127pub const IPPROTO_SDRP: ::c_int = 42;
1128/// IP6 routing header
1129pub const IPPROTO_ROUTING: ::c_int = 43;
1130/// IP6 fragmentation header
1131pub const IPPROTO_FRAGMENT: ::c_int = 44;
1132/// InterDomain Routing
1133pub const IPPROTO_IDRP: ::c_int = 45;
1134/// resource reservation
1135pub const IPPROTO_RSVP: ::c_int = 46;
1136/// General Routing Encap.
1137pub const IPPROTO_GRE: ::c_int = 47;
1138/// Mobile Host Routing
1139pub const IPPROTO_MHRP: ::c_int = 48;
1140/// BHA
1141pub const IPPROTO_BHA: ::c_int = 49;
1142/// IP6 Encap Sec. Payload
1143pub const IPPROTO_ESP: ::c_int = 50;
1144/// IP6 Auth Header
1145pub const IPPROTO_AH: ::c_int = 51;
1146/// Integ. Net Layer Security
1147pub const IPPROTO_INLSP: ::c_int = 52;
1148/// IP with encryption
1149pub const IPPROTO_SWIPE: ::c_int = 53;
1150/// Next Hop Resolution
1151pub const IPPROTO_NHRP: ::c_int = 54;
1152/* 55-57: Unassigned */
1153// IPPROTO_ICMPV6 defined in src/unix/mod.rs
1154/// IP6 no next header
1155pub const IPPROTO_NONE: ::c_int = 59;
1156/// IP6 destination option
1157pub const IPPROTO_DSTOPTS: ::c_int = 60;
1158/// any host internal protocol
1159pub const IPPROTO_AHIP: ::c_int = 61;
1160/// CFTP
1161pub const IPPROTO_CFTP: ::c_int = 62;
1162/// "hello" routing protocol
1163pub const IPPROTO_HELLO: ::c_int = 63;
1164/// SATNET/Backroom EXPAK
1165pub const IPPROTO_SATEXPAK: ::c_int = 64;
1166/// Kryptolan
1167pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
1168/// Remote Virtual Disk
1169pub const IPPROTO_RVD: ::c_int = 66;
1170/// Pluribus Packet Core
1171pub const IPPROTO_IPPC: ::c_int = 67;
1172/// Any distributed FS
1173pub const IPPROTO_ADFS: ::c_int = 68;
1174/// Satnet Monitoring
1175pub const IPPROTO_SATMON: ::c_int = 69;
1176/// VISA Protocol
1177pub const IPPROTO_VISA: ::c_int = 70;
1178/// Packet Core Utility
1179pub const IPPROTO_IPCV: ::c_int = 71;
1180/// Comp. Prot. Net. Executive
1181pub const IPPROTO_CPNX: ::c_int = 72;
1182/// Comp. Prot. HeartBeat
1183pub const IPPROTO_CPHB: ::c_int = 73;
1184/// Wang Span Network
1185pub const IPPROTO_WSN: ::c_int = 74;
1186/// Packet Video Protocol
1187pub const IPPROTO_PVP: ::c_int = 75;
1188/// BackRoom SATNET Monitoring
1189pub const IPPROTO_BRSATMON: ::c_int = 76;
1190/// Sun net disk proto (temp.)
1191pub const IPPROTO_ND: ::c_int = 77;
1192/// WIDEBAND Monitoring
1193pub const IPPROTO_WBMON: ::c_int = 78;
1194/// WIDEBAND EXPAK
1195pub const IPPROTO_WBEXPAK: ::c_int = 79;
1196/// ISO cnlp
1197pub const IPPROTO_EON: ::c_int = 80;
1198/// VMTP
1199pub const IPPROTO_VMTP: ::c_int = 81;
1200/// Secure VMTP
1201pub const IPPROTO_SVMTP: ::c_int = 82;
1202/// Banyon VINES
1203pub const IPPROTO_VINES: ::c_int = 83;
1204/// TTP
1205pub const IPPROTO_TTP: ::c_int = 84;
1206/// NSFNET-IGP
1207pub const IPPROTO_IGP: ::c_int = 85;
1208/// dissimilar gateway prot.
1209pub const IPPROTO_DGP: ::c_int = 86;
1210/// TCF
1211pub const IPPROTO_TCF: ::c_int = 87;
1212/// Cisco/GXS IGRP
1213pub const IPPROTO_IGRP: ::c_int = 88;
1214/// OSPFIGP
1215pub const IPPROTO_OSPFIGP: ::c_int = 89;
1216/// Strite RPC protocol
1217pub const IPPROTO_SRPC: ::c_int = 90;
1218/// Locus Address Resoloution
1219pub const IPPROTO_LARP: ::c_int = 91;
1220/// Multicast Transport
1221pub const IPPROTO_MTP: ::c_int = 92;
1222/// AX.25 Frames
1223pub const IPPROTO_AX25: ::c_int = 93;
1224/// IP encapsulated in IP
1225pub const IPPROTO_IPEIP: ::c_int = 94;
1226/// Mobile Int.ing control
1227pub const IPPROTO_MICP: ::c_int = 95;
1228/// Semaphore Comm. security
1229pub const IPPROTO_SCCSP: ::c_int = 96;
1230/// Ethernet IP encapsulation
1231pub const IPPROTO_ETHERIP: ::c_int = 97;
1232/// encapsulation header
1233pub const IPPROTO_ENCAP: ::c_int = 98;
1234/// any private encr. scheme
1235pub const IPPROTO_APES: ::c_int = 99;
1236/// GMTP
1237pub const IPPROTO_GMTP: ::c_int = 100;
1238
1239/* 101-254: Partly Unassigned */
1240/// Protocol Independent Mcast
1241pub const IPPROTO_PIM: ::c_int = 103;
1242/// payload compression (IPComp)
1243pub const IPPROTO_IPCOMP: ::c_int = 108;
1244/// PGM
1245pub const IPPROTO_PGM: ::c_int = 113;
1246/// SCTP
1247pub const IPPROTO_SCTP: ::c_int = 132;
1248
1249/* 255: Reserved */
1250/* BSD Private, local use, namespace incursion */
1251/// divert pseudo-protocol
1252pub const IPPROTO_DIVERT: ::c_int = 254;
1253/// raw IP packet
1254pub const IPPROTO_RAW: ::c_int = 255;
1255pub const IPPROTO_MAX: ::c_int = 256;
1256/// last return value of *_input(), meaning "all job for this pkt is done".
1257pub const IPPROTO_DONE: ::c_int = 257;
1258
8bb4bdeb 1259pub const AF_UNSPEC: ::c_int = 0;
cc61c64b
XL
1260pub const AF_LOCAL: ::c_int = 1;
1261pub const AF_UNIX: ::c_int = AF_LOCAL;
92a42be0 1262pub const AF_INET: ::c_int = 2;
cc61c64b
XL
1263pub const AF_IMPLINK: ::c_int = 3;
1264pub const AF_PUP: ::c_int = 4;
1265pub const AF_CHAOS: ::c_int = 5;
1266pub const AF_NS: ::c_int = 6;
1267pub const AF_ISO: ::c_int = 7;
1268pub const AF_OSI: ::c_int = AF_ISO;
1269pub const AF_ECMA: ::c_int = 8;
1270pub const AF_DATAKIT: ::c_int = 9;
1271pub const AF_CCITT: ::c_int = 10;
1272pub const AF_SNA: ::c_int = 11;
1273pub const AF_DECnet: ::c_int = 12;
1274pub const AF_DLI: ::c_int = 13;
1275pub const AF_LAT: ::c_int = 14;
1276pub const AF_HYLINK: ::c_int = 15;
1277pub const AF_APPLETALK: ::c_int = 16;
1278pub const AF_ROUTE: ::c_int = 17;
1279pub const AF_LINK: ::c_int = 18;
1280pub const pseudo_AF_XTP: ::c_int = 19;
1281pub const AF_COIP: ::c_int = 20;
1282pub const AF_CNT: ::c_int = 21;
1283pub const pseudo_AF_RTIP: ::c_int = 22;
1284pub const AF_IPX: ::c_int = 23;
1285pub const AF_SIP: ::c_int = 24;
1286pub const pseudo_AF_PIP: ::c_int = 25;
1287pub const AF_ISDN: ::c_int = 28;
1288pub const AF_E164: ::c_int = AF_ISDN;
1289pub const pseudo_AF_KEY: ::c_int = 29;
92a42be0 1290pub const AF_INET6: ::c_int = 30;
cc61c64b
XL
1291pub const AF_NATM: ::c_int = 31;
1292pub const AF_SYSTEM: ::c_int = 32;
1293pub const AF_NETBIOS: ::c_int = 33;
1294pub const AF_PPP: ::c_int = 34;
1295pub const pseudo_AF_HDRCMPLT: ::c_int = 35;
1296#[doc(hidden)]
1297pub const AF_MAX: ::c_int = 40;
3b2f2976
XL
1298pub const AF_SYS_CONTROL: ::c_int = 2;
1299
1300pub const SYSPROTO_EVENT: ::c_int = 1;
1301pub const SYSPROTO_CONTROL: ::c_int = 2;
cc61c64b
XL
1302
1303pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
1304pub const PF_LOCAL: ::c_int = AF_LOCAL;
1305pub const PF_UNIX: ::c_int = PF_LOCAL;
1306pub const PF_INET: ::c_int = AF_INET;
1307pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
1308pub const PF_PUP: ::c_int = AF_PUP;
1309pub const PF_CHAOS: ::c_int = AF_CHAOS;
1310pub const PF_NS: ::c_int = AF_NS;
1311pub const PF_ISO: ::c_int = AF_ISO;
1312pub const PF_OSI: ::c_int = AF_ISO;
1313pub const PF_ECMA: ::c_int = AF_ECMA;
1314pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
1315pub const PF_CCITT: ::c_int = AF_CCITT;
1316pub const PF_SNA: ::c_int = AF_SNA;
1317pub const PF_DECnet: ::c_int = AF_DECnet;
1318pub const PF_DLI: ::c_int = AF_DLI;
1319pub const PF_LAT: ::c_int = AF_LAT;
1320pub const PF_HYLINK: ::c_int = AF_HYLINK;
1321pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
1322pub const PF_ROUTE: ::c_int = AF_ROUTE;
1323pub const PF_LINK: ::c_int = AF_LINK;
1324pub const PF_XTP: ::c_int = pseudo_AF_XTP;
1325pub const PF_COIP: ::c_int = AF_COIP;
1326pub const PF_CNT: ::c_int = AF_CNT;
1327pub const PF_SIP: ::c_int = AF_SIP;
1328pub const PF_IPX: ::c_int = AF_IPX;
1329pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
1330pub const PF_PIP: ::c_int = pseudo_AF_PIP;
1331pub const PF_ISDN: ::c_int = AF_ISDN;
1332pub const PF_KEY: ::c_int = pseudo_AF_KEY;
1333pub const PF_INET6: ::c_int = AF_INET6;
1334pub const PF_NATM: ::c_int = AF_NATM;
1335pub const PF_SYSTEM: ::c_int = AF_SYSTEM;
1336pub const PF_NETBIOS: ::c_int = AF_NETBIOS;
1337pub const PF_PPP: ::c_int = AF_PPP;
1338#[doc(hidden)]
1339pub const PF_MAX: ::c_int = AF_MAX;
1340
1341#[doc(hidden)]
1342pub const NET_MAXID: ::c_int = AF_MAX;
1343
1344pub const NET_RT_DUMP: ::c_int = 1;
1345pub const NET_RT_FLAGS: ::c_int = 2;
1346pub const NET_RT_IFLIST: ::c_int = 3;
1347#[doc(hidden)]
1348pub const NET_RT_MAXID: ::c_int = 10;
1349
1350pub const SOMAXCONN: ::c_int = 128;
1351
1352pub const SOCK_MAXADDRLEN: ::c_int = 255;
1353
92a42be0
SL
1354pub const SOCK_STREAM: ::c_int = 1;
1355pub const SOCK_DGRAM: ::c_int = 2;
1356pub const SOCK_RAW: ::c_int = 3;
cc61c64b 1357pub const SOCK_RDM: ::c_int = 4;
3157f602 1358pub const SOCK_SEQPACKET: ::c_int = 5;
92a42be0
SL
1359pub const IP_TTL: ::c_int = 4;
1360pub const IP_HDRINCL: ::c_int = 2;
1361pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
1362pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
1363pub const IPV6_JOIN_GROUP: ::c_int = 12;
1364pub const IPV6_LEAVE_GROUP: ::c_int = 13;
1365
1366pub const TCP_NODELAY: ::c_int = 0x01;
1367pub const TCP_KEEPALIVE: ::c_int = 0x10;
1368pub const SOL_SOCKET: ::c_int = 0xffff;
1369
1370pub const SO_DEBUG: ::c_int = 0x01;
1371pub const SO_ACCEPTCONN: ::c_int = 0x0002;
1372pub const SO_REUSEADDR: ::c_int = 0x0004;
1373pub const SO_KEEPALIVE: ::c_int = 0x0008;
1374pub const SO_DONTROUTE: ::c_int = 0x0010;
1375pub const SO_BROADCAST: ::c_int = 0x0020;
1376pub const SO_USELOOPBACK: ::c_int = 0x0040;
1377pub const SO_LINGER: ::c_int = 0x0080;
1378pub const SO_OOBINLINE: ::c_int = 0x0100;
1379pub const SO_REUSEPORT: ::c_int = 0x0200;
cc61c64b 1380pub const SO_TIMESTAMP: ::c_int = 0x0400;
3b2f2976 1381pub const SO_TIMESTAMP_MONOTONIC: ::c_int = 0x0800;
cc61c64b
XL
1382pub const SO_DONTTRUNC: ::c_int = 0x2000;
1383pub const SO_WANTMORE: ::c_int = 0x4000;
1384pub const SO_WANTOOBFLAG: ::c_int = 0x8000;
92a42be0
SL
1385pub const SO_SNDBUF: ::c_int = 0x1001;
1386pub const SO_RCVBUF: ::c_int = 0x1002;
1387pub const SO_SNDLOWAT: ::c_int = 0x1003;
1388pub const SO_RCVLOWAT: ::c_int = 0x1004;
1389pub const SO_SNDTIMEO: ::c_int = 0x1005;
1390pub const SO_RCVTIMEO: ::c_int = 0x1006;
1391pub const SO_ERROR: ::c_int = 0x1007;
1392pub const SO_TYPE: ::c_int = 0x1008;
3b2f2976
XL
1393pub const SO_LABEL: ::c_int = 0x1010;
1394pub const SO_PEERLABEL: ::c_int = 0x1011;
cc61c64b
XL
1395pub const SO_NREAD: ::c_int = 0x1020;
1396pub const SO_NKE: ::c_int = 0x1021;
1397pub const SO_NOSIGPIPE: ::c_int = 0x1022;
1398pub const SO_NOADDRERR: ::c_int = 0x1023;
1399pub const SO_NWRITE: ::c_int = 0x1024;
3b2f2976
XL
1400pub const SO_REUSESHAREUID: ::c_int = 0x1025;
1401pub const SO_NOTIFYCONFLICT: ::c_int = 0x1026;
1402pub const SO_RANDOMPORT: ::c_int = 0x1082;
1403pub const SO_NP_EXTENSIONS: ::c_int = 0x1083;
92a42be0 1404
cc61c64b 1405pub const MSG_OOB: ::c_int = 0x1;
8bb4bdeb 1406pub const MSG_PEEK: ::c_int = 0x2;
cc61c64b
XL
1407pub const MSG_DONTROUTE: ::c_int = 0x4;
1408pub const MSG_EOR: ::c_int = 0x8;
1409pub const MSG_TRUNC: ::c_int = 0x10;
1410pub const MSG_CTRUNC: ::c_int = 0x20;
1411pub const MSG_WAITALL: ::c_int = 0x40;
1412pub const MSG_DONTWAIT: ::c_int = 0x80;
1413pub const MSG_EOF: ::c_int = 0x100;
1414pub const MSG_FLUSH: ::c_int = 0x400;
1415pub const MSG_HOLD: ::c_int = 0x800;
1416pub const MSG_SEND: ::c_int = 0x1000;
1417pub const MSG_HAVEMORE: ::c_int = 0x2000;
1418pub const MSG_RCVMORE: ::c_int = 0x4000;
1419// pub const MSG_COMPAT: ::c_int = 0x8000;
1420
cc61c64b
XL
1421pub const SCM_TIMESTAMP: ::c_int = 0x02;
1422pub const SCM_CREDS: ::c_int = 0x03;
8bb4bdeb 1423
92a42be0
SL
1424pub const IFF_LOOPBACK: ::c_int = 0x8;
1425
1426pub const SHUT_RD: ::c_int = 0;
1427pub const SHUT_WR: ::c_int = 1;
1428pub const SHUT_RDWR: ::c_int = 2;
1429
1430pub const LOCK_SH: ::c_int = 1;
1431pub const LOCK_EX: ::c_int = 2;
1432pub const LOCK_NB: ::c_int = 4;
1433pub const LOCK_UN: ::c_int = 8;
1434
92a42be0
SL
1435pub const MAP_COPY: ::c_int = 0x0002;
1436pub const MAP_RENAME: ::c_int = 0x0020;
1437pub const MAP_NORESERVE: ::c_int = 0x0040;
1438pub const MAP_NOEXTEND: ::c_int = 0x0100;
1439pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
1440pub const MAP_NOCACHE: ::c_int = 0x0400;
1441pub const MAP_JIT: ::c_int = 0x0800;
1442
92a42be0
SL
1443pub const _SC_ARG_MAX: ::c_int = 1;
1444pub const _SC_CHILD_MAX: ::c_int = 2;
1445pub const _SC_CLK_TCK: ::c_int = 3;
1446pub const _SC_NGROUPS_MAX: ::c_int = 4;
1447pub const _SC_OPEN_MAX: ::c_int = 5;
1448pub const _SC_JOB_CONTROL: ::c_int = 6;
1449pub const _SC_SAVED_IDS: ::c_int = 7;
1450pub const _SC_VERSION: ::c_int = 8;
1451pub const _SC_BC_BASE_MAX: ::c_int = 9;
1452pub const _SC_BC_DIM_MAX: ::c_int = 10;
1453pub const _SC_BC_SCALE_MAX: ::c_int = 11;
1454pub const _SC_BC_STRING_MAX: ::c_int = 12;
1455pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
1456pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
1457pub const _SC_LINE_MAX: ::c_int = 15;
1458pub const _SC_RE_DUP_MAX: ::c_int = 16;
1459pub const _SC_2_VERSION: ::c_int = 17;
1460pub const _SC_2_C_BIND: ::c_int = 18;
1461pub const _SC_2_C_DEV: ::c_int = 19;
1462pub const _SC_2_CHAR_TERM: ::c_int = 20;
1463pub const _SC_2_FORT_DEV: ::c_int = 21;
1464pub const _SC_2_FORT_RUN: ::c_int = 22;
1465pub const _SC_2_LOCALEDEF: ::c_int = 23;
1466pub const _SC_2_SW_DEV: ::c_int = 24;
1467pub const _SC_2_UPE: ::c_int = 25;
1468pub const _SC_STREAM_MAX: ::c_int = 26;
1469pub const _SC_TZNAME_MAX: ::c_int = 27;
1470pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28;
1471pub const _SC_PAGESIZE: ::c_int = 29;
1472pub const _SC_MEMLOCK: ::c_int = 30;
1473pub const _SC_MEMLOCK_RANGE: ::c_int = 31;
1474pub const _SC_MEMORY_PROTECTION: ::c_int = 32;
1475pub const _SC_MESSAGE_PASSING: ::c_int = 33;
1476pub const _SC_PRIORITIZED_IO: ::c_int = 34;
1477pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35;
1478pub const _SC_REALTIME_SIGNALS: ::c_int = 36;
1479pub const _SC_SEMAPHORES: ::c_int = 37;
1480pub const _SC_FSYNC: ::c_int = 38;
1481pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39;
1482pub const _SC_SYNCHRONIZED_IO: ::c_int = 40;
1483pub const _SC_TIMERS: ::c_int = 41;
1484pub const _SC_AIO_LISTIO_MAX: ::c_int = 42;
1485pub const _SC_AIO_MAX: ::c_int = 43;
1486pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
1487pub const _SC_DELAYTIMER_MAX: ::c_int = 45;
1488pub const _SC_MQ_OPEN_MAX: ::c_int = 46;
1489pub const _SC_MAPPED_FILES: ::c_int = 47;
1490pub const _SC_RTSIG_MAX: ::c_int = 48;
1491pub const _SC_SEM_NSEMS_MAX: ::c_int = 49;
1492pub const _SC_SEM_VALUE_MAX: ::c_int = 50;
1493pub const _SC_SIGQUEUE_MAX: ::c_int = 51;
1494pub const _SC_TIMER_MAX: ::c_int = 52;
1495pub const _SC_NPROCESSORS_CONF: ::c_int = 57;
1496pub const _SC_NPROCESSORS_ONLN: ::c_int = 58;
1497pub const _SC_2_PBS: ::c_int = 59;
1498pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60;
1499pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61;
1500pub const _SC_2_PBS_LOCATE: ::c_int = 62;
1501pub const _SC_2_PBS_MESSAGE: ::c_int = 63;
1502pub const _SC_2_PBS_TRACK: ::c_int = 64;
1503pub const _SC_ADVISORY_INFO: ::c_int = 65;
1504pub const _SC_BARRIERS: ::c_int = 66;
1505pub const _SC_CLOCK_SELECTION: ::c_int = 67;
1506pub const _SC_CPUTIME: ::c_int = 68;
1507pub const _SC_FILE_LOCKING: ::c_int = 69;
1508pub const _SC_HOST_NAME_MAX: ::c_int = 72;
1509pub const _SC_MONOTONIC_CLOCK: ::c_int = 74;
1510pub const _SC_READER_WRITER_LOCKS: ::c_int = 76;
1511pub const _SC_REGEXP: ::c_int = 77;
1512pub const _SC_SHELL: ::c_int = 78;
1513pub const _SC_SPAWN: ::c_int = 79;
1514pub const _SC_SPIN_LOCKS: ::c_int = 80;
1515pub const _SC_SPORADIC_SERVER: ::c_int = 81;
1516pub const _SC_THREAD_CPUTIME: ::c_int = 84;
1517pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92;
1518pub const _SC_TIMEOUTS: ::c_int = 95;
1519pub const _SC_TRACE: ::c_int = 97;
1520pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98;
1521pub const _SC_TRACE_INHERIT: ::c_int = 99;
1522pub const _SC_TRACE_LOG: ::c_int = 100;
1523pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102;
1524pub const _SC_V6_ILP32_OFF32: ::c_int = 103;
1525pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104;
1526pub const _SC_V6_LP64_OFF64: ::c_int = 105;
1527pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106;
1528pub const _SC_IPV6: ::c_int = 118;
1529pub const _SC_RAW_SOCKETS: ::c_int = 119;
1530pub const _SC_SYMLOOP_MAX: ::c_int = 120;
1531pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
1532pub const _SC_XOPEN_STREAMS: ::c_int = 114;
1533pub const _SC_XBS5_ILP32_OFF32: ::c_int = 122;
1534pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 123;
1535pub const _SC_XBS5_LP64_OFF64: ::c_int = 124;
1536pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 125;
1537pub const _SC_SS_REPL_MAX: ::c_int = 126;
1538pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 127;
1539pub const _SC_TRACE_NAME_MAX: ::c_int = 128;
1540pub const _SC_TRACE_SYS_MAX: ::c_int = 129;
1541pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 130;
1542pub const _SC_PASS_MAX: ::c_int = 131;
1543
3157f602
XL
1544pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
1545pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
92a42be0 1546pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
3157f602 1547pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
92a42be0
SL
1548pub const _PTHREAD_MUTEX_SIG_init: ::c_long = 0x32AAABA7;
1549pub const _PTHREAD_COND_SIG_init: ::c_long = 0x3CB0B1BB;
1550pub const _PTHREAD_RWLOCK_SIG_init: ::c_long = 0x2DA8B3B4;
1551pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
1552 __sig: _PTHREAD_MUTEX_SIG_init,
1553 __opaque: [0; __PTHREAD_MUTEX_SIZE__],
1554};
1555pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
1556 __sig: _PTHREAD_COND_SIG_init,
1557 __opaque: [0; __PTHREAD_COND_SIZE__],
1558};
1559pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
1560 __sig: _PTHREAD_RWLOCK_SIG_init,
1561 __opaque: [0; __PTHREAD_RWLOCK_SIZE__],
1562};
1563
1564pub const SIGSTKSZ: ::size_t = 131072;
1565
9cc50fc6
SL
1566pub const FD_SETSIZE: usize = 1024;
1567
1568pub const ST_NOSUID: ::c_ulong = 2;
1569
9e0c209e
SL
1570pub const EVFILT_READ: ::int16_t = -1;
1571pub const EVFILT_WRITE: ::int16_t = -2;
1572pub const EVFILT_AIO: ::int16_t = -3;
1573pub const EVFILT_VNODE: ::int16_t = -4;
1574pub const EVFILT_PROC: ::int16_t = -5;
1575pub const EVFILT_SIGNAL: ::int16_t = -6;
1576pub const EVFILT_TIMER: ::int16_t = -7;
1577pub const EVFILT_MACHPORT: ::int16_t = -8;
1578pub const EVFILT_FS: ::int16_t = -9;
1579pub const EVFILT_USER: ::int16_t = -10;
1580pub const EVFILT_VM: ::int16_t = -12;
1581
1582pub const EV_ADD: ::uint16_t = 0x1;
1583pub const EV_DELETE: ::uint16_t = 0x2;
1584pub const EV_ENABLE: ::uint16_t = 0x4;
1585pub const EV_DISABLE: ::uint16_t = 0x8;
1586pub const EV_ONESHOT: ::uint16_t = 0x10;
1587pub const EV_CLEAR: ::uint16_t = 0x20;
1588pub const EV_RECEIPT: ::uint16_t = 0x40;
9cc50fc6
SL
1589pub const EV_DISPATCH: ::uint16_t = 0x80;
1590pub const EV_FLAG0: ::uint16_t = 0x1000;
9cc50fc6 1591pub const EV_POLL: ::uint16_t = 0x1000;
9e0c209e
SL
1592pub const EV_FLAG1: ::uint16_t = 0x2000;
1593pub const EV_OOBAND: ::uint16_t = 0x2000;
1594pub const EV_ERROR: ::uint16_t = 0x4000;
1595pub const EV_EOF: ::uint16_t = 0x8000;
1596pub const EV_SYSFLAGS: ::uint16_t = 0xf000;
9cc50fc6 1597
9e0c209e
SL
1598pub const NOTE_TRIGGER: ::uint32_t = 0x01000000;
1599pub const NOTE_FFNOP: ::uint32_t = 0x00000000;
9cc50fc6 1600pub const NOTE_FFAND: ::uint32_t = 0x40000000;
9e0c209e 1601pub const NOTE_FFOR: ::uint32_t = 0x80000000;
9cc50fc6
SL
1602pub const NOTE_FFCOPY: ::uint32_t = 0xc0000000;
1603pub const NOTE_FFCTRLMASK: ::uint32_t = 0xc0000000;
1604pub const NOTE_FFLAGSMASK: ::uint32_t = 0x00ffffff;
9e0c209e
SL
1605pub const NOTE_LOWAT: ::uint32_t = 0x00000001;
1606pub const NOTE_DELETE: ::uint32_t = 0x00000001;
1607pub const NOTE_WRITE: ::uint32_t = 0x00000002;
1608pub const NOTE_EXTEND: ::uint32_t = 0x00000004;
1609pub const NOTE_ATTRIB: ::uint32_t = 0x00000008;
1610pub const NOTE_LINK: ::uint32_t = 0x00000010;
1611pub const NOTE_RENAME: ::uint32_t = 0x00000020;
1612pub const NOTE_REVOKE: ::uint32_t = 0x00000040;
1613pub const NOTE_NONE: ::uint32_t = 0x00000080;
1614pub const NOTE_EXIT: ::uint32_t = 0x80000000;
1615pub const NOTE_FORK: ::uint32_t = 0x40000000;
1616pub const NOTE_EXEC: ::uint32_t = 0x20000000;
9cc50fc6 1617pub const NOTE_REAP: ::uint32_t = 0x10000000;
9e0c209e
SL
1618pub const NOTE_SIGNAL: ::uint32_t = 0x08000000;
1619pub const NOTE_EXITSTATUS: ::uint32_t = 0x04000000;
1620pub const NOTE_EXIT_DETAIL: ::uint32_t = 0x02000000;
1621pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff;
1622pub const NOTE_PCTRLMASK: ::uint32_t = 0xfff00000;
1623pub const NOTE_EXIT_REPARENTED: ::uint32_t = 0x00080000;
1624pub const NOTE_EXIT_DETAIL_MASK: ::uint32_t = 0x00070000;
1625pub const NOTE_EXIT_DECRYPTFAIL: ::uint32_t = 0x00010000;
1626pub const NOTE_EXIT_MEMORY: ::uint32_t = 0x00020000;
1627pub const NOTE_EXIT_CSERROR: ::uint32_t = 0x00040000;
9cc50fc6 1628pub const NOTE_VM_PRESSURE: ::uint32_t = 0x80000000;
9cc50fc6 1629pub const NOTE_VM_PRESSURE_TERMINATE: ::uint32_t = 0x40000000;
9e0c209e
SL
1630pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: ::uint32_t = 0x20000000;
1631pub const NOTE_VM_ERROR: ::uint32_t = 0x10000000;
1632pub const NOTE_SECONDS: ::uint32_t = 0x00000001;
1633pub const NOTE_USECONDS: ::uint32_t = 0x00000002;
1634pub const NOTE_NSECONDS: ::uint32_t = 0x00000004;
1635pub const NOTE_ABSOLUTE: ::uint32_t = 0x00000008;
1636pub const NOTE_LEEWAY: ::uint32_t = 0x00000010;
1637pub const NOTE_CRITICAL: ::uint32_t = 0x00000020;
1638pub const NOTE_BACKGROUND: ::uint32_t = 0x00000040;
1639pub const NOTE_TRACK: ::uint32_t = 0x00000001;
1640pub const NOTE_TRACKERR: ::uint32_t = 0x00000002;
1641pub const NOTE_CHILD: ::uint32_t = 0x00000004;
9cc50fc6 1642
3b2f2976
XL
1643pub const OCRNL: ::c_int = 0x00000010;
1644pub const ONOCR: ::c_int = 0x00000020;
1645pub const ONLRET: ::c_int = 0x00000040;
1646pub const OFILL: ::c_int = 0x00000080;
1647pub const NLDLY: ::c_int = 0x00000300;
1648pub const TABDLY: ::c_int = 0x00000c04;
1649pub const CRDLY: ::c_int = 0x00003000;
1650pub const FFDLY: ::c_int = 0x00004000;
1651pub const BSDLY: ::c_int = 0x00008000;
1652pub const VTDLY: ::c_int = 0x00010000;
1653pub const OFDEL: ::c_int = 0x00020000;
1654
7453a54e
SL
1655pub const NL0: ::c_int = 0x00000000;
1656pub const NL1: ::c_int = 0x00000100;
1657pub const TAB0: ::c_int = 0x00000000;
1658pub const TAB1: ::c_int = 0x00000400;
1659pub const TAB2: ::c_int = 0x00000800;
1660pub const CR0: ::c_int = 0x00000000;
1661pub const CR1: ::c_int = 0x00001000;
1662pub const CR2: ::c_int = 0x00002000;
1663pub const CR3: ::c_int = 0x00003000;
1664pub const FF0: ::c_int = 0x00000000;
1665pub const FF1: ::c_int = 0x00004000;
1666pub const BS0: ::c_int = 0x00000000;
1667pub const BS1: ::c_int = 0x00008000;
9cc50fc6
SL
1668pub const TAB3: ::c_int = 0x00000004;
1669pub const VT0: ::c_int = 0x00000000;
1670pub const VT1: ::c_int = 0x00010000;
1671pub const IUTF8: ::tcflag_t = 0x00004000;
1672pub const CRTSCTS: ::tcflag_t = 0x00030000;
1673
1674pub const NI_MAXHOST: ::socklen_t = 1025;
1675
7453a54e
SL
1676pub const Q_GETQUOTA: ::c_int = 0x300;
1677pub const Q_SETQUOTA: ::c_int = 0x400;
1678
1679pub const RTLD_LOCAL: ::c_int = 0x4;
1680pub const RTLD_FIRST: ::c_int = 0x100;
1681pub const RTLD_NODELETE: ::c_int = 0x80;
1682pub const RTLD_NOLOAD: ::c_int = 0x10;
1683pub const RTLD_GLOBAL: ::c_int = 0x8;
1684
a7813a04
XL
1685pub const _WSTOPPED: ::c_int = 0o177;
1686
1687pub const LOG_NETINFO: ::c_int = 12 << 3;
1688pub const LOG_REMOTEAUTH: ::c_int = 13 << 3;
1689pub const LOG_INSTALL: ::c_int = 14 << 3;
1690pub const LOG_RAS: ::c_int = 15 << 3;
1691pub const LOG_LAUNCHD: ::c_int = 24 << 3;
1692pub const LOG_NFACILITIES: ::c_int = 25;
1693
1694pub const CTLTYPE: ::c_int = 0xf;
1695pub const CTLTYPE_NODE: ::c_int = 1;
1696pub const CTLTYPE_INT: ::c_int = 2;
1697pub const CTLTYPE_STRING: ::c_int = 3;
1698pub const CTLTYPE_QUAD: ::c_int = 4;
1699pub const CTLTYPE_OPAQUE: ::c_int = 5;
1700pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE;
1701pub const CTLFLAG_RD: ::c_int = 0x80000000;
1702pub const CTLFLAG_WR: ::c_int = 0x40000000;
1703pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR;
1704pub const CTLFLAG_NOLOCK: ::c_int = 0x20000000;
1705pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000;
1706pub const CTLFLAG_SECURE: ::c_int = 0x08000000;
1707pub const CTLFLAG_MASKED: ::c_int = 0x04000000;
1708pub const CTLFLAG_NOAUTO: ::c_int = 0x02000000;
1709pub const CTLFLAG_KERN: ::c_int = 0x01000000;
1710pub const CTLFLAG_LOCKED: ::c_int = 0x00800000;
1711pub const CTLFLAG_OID2: ::c_int = 0x00400000;
1712pub const CTL_UNSPEC: ::c_int = 0;
1713pub const CTL_KERN: ::c_int = 1;
1714pub const CTL_VM: ::c_int = 2;
1715pub const CTL_VFS: ::c_int = 3;
1716pub const CTL_NET: ::c_int = 4;
1717pub const CTL_DEBUG: ::c_int = 5;
1718pub const CTL_HW: ::c_int = 6;
1719pub const CTL_MACHDEP: ::c_int = 7;
1720pub const CTL_USER: ::c_int = 8;
1721pub const CTL_MAXID: ::c_int = 9;
1722pub const KERN_OSTYPE: ::c_int = 1;
1723pub const KERN_OSRELEASE: ::c_int = 2;
1724pub const KERN_OSREV: ::c_int = 3;
1725pub const KERN_VERSION: ::c_int = 4;
1726pub const KERN_MAXVNODES: ::c_int = 5;
1727pub const KERN_MAXPROC: ::c_int = 6;
1728pub const KERN_MAXFILES: ::c_int = 7;
1729pub const KERN_ARGMAX: ::c_int = 8;
1730pub const KERN_SECURELVL: ::c_int = 9;
1731pub const KERN_HOSTNAME: ::c_int = 10;
1732pub const KERN_HOSTID: ::c_int = 11;
1733pub const KERN_CLOCKRATE: ::c_int = 12;
1734pub const KERN_VNODE: ::c_int = 13;
1735pub const KERN_PROC: ::c_int = 14;
1736pub const KERN_FILE: ::c_int = 15;
1737pub const KERN_PROF: ::c_int = 16;
1738pub const KERN_POSIX1: ::c_int = 17;
1739pub const KERN_NGROUPS: ::c_int = 18;
1740pub const KERN_JOB_CONTROL: ::c_int = 19;
1741pub const KERN_SAVED_IDS: ::c_int = 20;
1742pub const KERN_BOOTTIME: ::c_int = 21;
1743pub const KERN_NISDOMAINNAME: ::c_int = 22;
1744pub const KERN_DOMAINNAME: ::c_int = KERN_NISDOMAINNAME;
1745pub const KERN_MAXPARTITIONS: ::c_int = 23;
1746pub const KERN_KDEBUG: ::c_int = 24;
1747pub const KERN_UPDATEINTERVAL: ::c_int = 25;
1748pub const KERN_OSRELDATE: ::c_int = 26;
1749pub const KERN_NTP_PLL: ::c_int = 27;
1750pub const KERN_BOOTFILE: ::c_int = 28;
1751pub const KERN_MAXFILESPERPROC: ::c_int = 29;
1752pub const KERN_MAXPROCPERUID: ::c_int = 30;
1753pub const KERN_DUMPDEV: ::c_int = 31;
1754pub const KERN_IPC: ::c_int = 32;
1755pub const KERN_DUMMY: ::c_int = 33;
1756pub const KERN_PS_STRINGS: ::c_int = 34;
1757pub const KERN_USRSTACK32: ::c_int = 35;
1758pub const KERN_LOGSIGEXIT: ::c_int = 36;
1759pub const KERN_SYMFILE: ::c_int = 37;
1760pub const KERN_PROCARGS: ::c_int = 38;
1761pub const KERN_NETBOOT: ::c_int = 40;
1762pub const KERN_SYSV: ::c_int = 42;
1763pub const KERN_AFFINITY: ::c_int = 43;
1764pub const KERN_TRANSLATE: ::c_int = 44;
1765pub const KERN_CLASSIC: ::c_int = KERN_TRANSLATE;
1766pub const KERN_EXEC: ::c_int = 45;
1767pub const KERN_CLASSICHANDLER: ::c_int = KERN_EXEC;
1768pub const KERN_AIOMAX: ::c_int = 46;
1769pub const KERN_AIOPROCMAX: ::c_int = 47;
1770pub const KERN_AIOTHREADS: ::c_int = 48;
1771pub const KERN_COREFILE: ::c_int = 50;
1772pub const KERN_COREDUMP: ::c_int = 51;
1773pub const KERN_SUGID_COREDUMP: ::c_int = 52;
1774pub const KERN_PROCDELAYTERM: ::c_int = 53;
1775pub const KERN_SHREG_PRIVATIZABLE: ::c_int = 54;
1776pub const KERN_LOW_PRI_WINDOW: ::c_int = 56;
1777pub const KERN_LOW_PRI_DELAY: ::c_int = 57;
1778pub const KERN_POSIX: ::c_int = 58;
1779pub const KERN_USRSTACK64: ::c_int = 59;
1780pub const KERN_NX_PROTECTION: ::c_int = 60;
1781pub const KERN_TFP: ::c_int = 61;
1782pub const KERN_PROCNAME: ::c_int = 62;
1783pub const KERN_THALTSTACK: ::c_int = 63;
1784pub const KERN_SPECULATIVE_READS: ::c_int = 64;
1785pub const KERN_OSVERSION: ::c_int = 65;
1786pub const KERN_SAFEBOOT: ::c_int = 66;
1787pub const KERN_RAGEVNODE: ::c_int = 68;
1788pub const KERN_TTY: ::c_int = 69;
1789pub const KERN_CHECKOPENEVT: ::c_int = 70;
1790pub const KERN_THREADNAME: ::c_int = 71;
1791pub const KERN_MAXID: ::c_int = 72;
1792pub const KERN_RAGE_PROC: ::c_int = 1;
1793pub const KERN_RAGE_THREAD: ::c_int = 2;
1794pub const KERN_UNRAGE_PROC: ::c_int = 3;
1795pub const KERN_UNRAGE_THREAD: ::c_int = 4;
1796pub const KERN_OPENEVT_PROC: ::c_int = 1;
1797pub const KERN_UNOPENEVT_PROC: ::c_int = 2;
1798pub const KERN_TFP_POLICY: ::c_int = 1;
1799pub const KERN_TFP_POLICY_DENY: ::c_int = 0;
1800pub const KERN_TFP_POLICY_DEFAULT: ::c_int = 2;
1801pub const KERN_KDEFLAGS: ::c_int = 1;
1802pub const KERN_KDDFLAGS: ::c_int = 2;
1803pub const KERN_KDENABLE: ::c_int = 3;
1804pub const KERN_KDSETBUF: ::c_int = 4;
1805pub const KERN_KDGETBUF: ::c_int = 5;
1806pub const KERN_KDSETUP: ::c_int = 6;
1807pub const KERN_KDREMOVE: ::c_int = 7;
1808pub const KERN_KDSETREG: ::c_int = 8;
1809pub const KERN_KDGETREG: ::c_int = 9;
1810pub const KERN_KDREADTR: ::c_int = 10;
1811pub const KERN_KDPIDTR: ::c_int = 11;
1812pub const KERN_KDTHRMAP: ::c_int = 12;
1813pub const KERN_KDPIDEX: ::c_int = 14;
1814pub const KERN_KDSETRTCDEC: ::c_int = 15;
1815pub const KERN_KDGETENTROPY: ::c_int = 16;
1816pub const KERN_KDWRITETR: ::c_int = 17;
1817pub const KERN_KDWRITEMAP: ::c_int = 18;
1818pub const KERN_KDENABLE_BG_TRACE: ::c_int = 19;
1819pub const KERN_KDDISABLE_BG_TRACE: ::c_int = 20;
1820pub const KERN_KDREADCURTHRMAP: ::c_int = 21;
1821pub const KERN_KDSET_TYPEFILTER: ::c_int = 22;
1822pub const KERN_KDBUFWAIT: ::c_int = 23;
1823pub const KERN_KDCPUMAP: ::c_int = 24;
1824pub const KERN_PROC_ALL: ::c_int = 0;
1825pub const KERN_PROC_PID: ::c_int = 1;
1826pub const KERN_PROC_PGRP: ::c_int = 2;
1827pub const KERN_PROC_SESSION: ::c_int = 3;
1828pub const KERN_PROC_TTY: ::c_int = 4;
1829pub const KERN_PROC_UID: ::c_int = 5;
1830pub const KERN_PROC_RUID: ::c_int = 6;
1831pub const KERN_PROC_LCID: ::c_int = 7;
1832pub const KIPC_MAXSOCKBUF: ::c_int = 1;
1833pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
1834pub const KIPC_SOMAXCONN: ::c_int = 3;
1835pub const KIPC_MAX_LINKHDR: ::c_int = 4;
1836pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
1837pub const KIPC_MAX_HDR: ::c_int = 6;
1838pub const KIPC_MAX_DATALEN: ::c_int = 7;
1839pub const KIPC_MBSTAT: ::c_int = 8;
1840pub const KIPC_NMBCLUSTERS: ::c_int = 9;
1841pub const KIPC_SOQLIMITCOMPAT: ::c_int = 10;
1842pub const VM_METER: ::c_int = 1;
1843pub const VM_LOADAVG: ::c_int = 2;
1844pub const VM_MACHFACTOR: ::c_int = 4;
1845pub const VM_SWAPUSAGE: ::c_int = 5;
1846pub const VM_MAXID: ::c_int = 6;
1847pub const HW_MACHINE: ::c_int = 1;
1848pub const HW_MODEL: ::c_int = 2;
1849pub const HW_NCPU: ::c_int = 3;
1850pub const HW_BYTEORDER: ::c_int = 4;
1851pub const HW_PHYSMEM: ::c_int = 5;
1852pub const HW_USERMEM: ::c_int = 6;
1853pub const HW_PAGESIZE: ::c_int = 7;
1854pub const HW_DISKNAMES: ::c_int = 8;
1855pub const HW_DISKSTATS: ::c_int = 9;
1856pub const HW_EPOCH: ::c_int = 10;
1857pub const HW_FLOATINGPT: ::c_int = 11;
1858pub const HW_MACHINE_ARCH: ::c_int = 12;
1859pub const HW_VECTORUNIT: ::c_int = 13;
1860pub const HW_BUS_FREQ: ::c_int = 14;
1861pub const HW_CPU_FREQ: ::c_int = 15;
1862pub const HW_CACHELINE: ::c_int = 16;
1863pub const HW_L1ICACHESIZE: ::c_int = 17;
1864pub const HW_L1DCACHESIZE: ::c_int = 18;
1865pub const HW_L2SETTINGS: ::c_int = 19;
1866pub const HW_L2CACHESIZE: ::c_int = 20;
1867pub const HW_L3SETTINGS: ::c_int = 21;
1868pub const HW_L3CACHESIZE: ::c_int = 22;
1869pub const HW_TB_FREQ: ::c_int = 23;
1870pub const HW_MEMSIZE: ::c_int = 24;
1871pub const HW_AVAILCPU: ::c_int = 25;
1872pub const HW_MAXID: ::c_int = 26;
1873pub const USER_CS_PATH: ::c_int = 1;
1874pub const USER_BC_BASE_MAX: ::c_int = 2;
1875pub const USER_BC_DIM_MAX: ::c_int = 3;
1876pub const USER_BC_SCALE_MAX: ::c_int = 4;
1877pub const USER_BC_STRING_MAX: ::c_int = 5;
1878pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
1879pub const USER_EXPR_NEST_MAX: ::c_int = 7;
1880pub const USER_LINE_MAX: ::c_int = 8;
1881pub const USER_RE_DUP_MAX: ::c_int = 9;
1882pub const USER_POSIX2_VERSION: ::c_int = 10;
1883pub const USER_POSIX2_C_BIND: ::c_int = 11;
1884pub const USER_POSIX2_C_DEV: ::c_int = 12;
1885pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
1886pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
1887pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
1888pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
1889pub const USER_POSIX2_SW_DEV: ::c_int = 17;
1890pub const USER_POSIX2_UPE: ::c_int = 18;
1891pub const USER_STREAM_MAX: ::c_int = 19;
1892pub const USER_TZNAME_MAX: ::c_int = 20;
1893pub const USER_MAXID: ::c_int = 21;
1894pub const CTL_DEBUG_NAME: ::c_int = 0;
1895pub const CTL_DEBUG_VALUE: ::c_int = 1;
1896pub const CTL_DEBUG_MAXID: ::c_int = 20;
1897
3157f602
XL
1898pub const PRIO_DARWIN_THREAD: ::c_int = 3;
1899pub const PRIO_DARWIN_PROCESS: ::c_int = 4;
1900pub const PRIO_DARWIN_BG: ::c_int = 0x1000;
1901pub const PRIO_DARWIN_NONUI: ::c_int = 0x1001;
1902
5bcae85e
SL
1903pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t;
1904
476ff2be
SL
1905pub const SIGEV_NONE: ::c_int = 0;
1906pub const SIGEV_SIGNAL: ::c_int = 1;
1907pub const SIGEV_THREAD: ::c_int = 3;
1908
1909pub const AIO_CANCELED: ::c_int = 2;
1910pub const AIO_NOTCANCELED: ::c_int = 4;
1911pub const AIO_ALLDONE: ::c_int = 1;
1912pub const AIO_LISTIO_MAX: ::c_int = 16;
1913pub const LIO_NOP: ::c_int = 0;
1914pub const LIO_WRITE: ::c_int = 2;
1915pub const LIO_READ: ::c_int = 1;
1916pub const LIO_WAIT: ::c_int = 2;
1917pub const LIO_NOWAIT: ::c_int = 1;
1918
8bb4bdeb
XL
1919pub const WEXITED: ::c_int = 0x00000004;
1920pub const WSTOPPED: ::c_int = 0x00000008;
1921pub const WCONTINUED: ::c_int = 0x00000010;
1922pub const WNOWAIT: ::c_int = 0x00000020;
1923
1924pub const P_ALL: idtype_t = 0;
1925pub const P_PID: idtype_t = 1;
1926pub const P_PGID: idtype_t = 2;
1927
041b39d2
XL
1928pub const XATTR_NOFOLLOW: ::c_int = 0x0001;
1929pub const XATTR_CREATE: ::c_int = 0x0002;
1930pub const XATTR_REPLACE: ::c_int = 0x0004;
1931pub const XATTR_NOSECURITY: ::c_int = 0x0008;
1932pub const XATTR_NODEFAULT: ::c_int = 0x0010;
1933pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020;
1934
3b2f2976
XL
1935pub const NET_RT_IFLIST2: ::c_int = 0x0006;
1936pub const RTM_IFINFO2: ::c_int = 0x0012;
1937
1938pub const KERN_PROCARGS2: ::c_int = 49;
1939
1940pub const PROC_PIDTASKALLINFO: ::c_int = 2;
1941pub const PROC_PIDTASKINFO: ::c_int = 4;
1942pub const PROC_PIDTHREADINFO: ::c_int = 5;
1943pub const MAXCOMLEN: usize = 16;
1944pub const MAXTHREADNAMESIZE: usize = 64;
1945
a7813a04
XL
1946f! {
1947 pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
1948 status >> 8
1949 }
1950
1951 pub fn _WSTATUS(status: ::c_int) -> ::c_int {
1952 status & 0x7f
1953 }
1954
1955 pub fn WIFCONTINUED(status: ::c_int) -> bool {
1956 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) == 0x13
1957 }
1958
1959 pub fn WIFSIGNALED(status: ::c_int) -> bool {
1960 _WSTATUS(status) != _WSTOPPED && _WSTATUS(status) != 0
1961 }
1962
1963 pub fn WIFSTOPPED(status: ::c_int) -> bool {
1964 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) != 0x13
1965 }
1966}
1967
92a42be0 1968extern {
476ff2be
SL
1969 pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
1970 pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
1971 pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
1972 pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
1973 pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
1974 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1975 link_name = "aio_suspend$UNIX2003")]
1976 pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int,
1977 timeout: *const ::timespec) -> ::c_int;
1978 pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
1979 pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
1980 nitems: ::c_int, sevp: *mut sigevent) -> ::c_int;
1981
041b39d2
XL
1982 pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
1983
9e0c209e
SL
1984 pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
1985
1986 pub fn getutxent() -> *mut utmpx;
1987 pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
1988 pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
1989 pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
1990 pub fn setutxent();
1991 pub fn endutxent();
1992 pub fn utmpxname(file: *const ::c_char) -> ::c_int;
1993
9cc50fc6
SL
1994 pub fn getnameinfo(sa: *const ::sockaddr,
1995 salen: ::socklen_t,
1996 host: *mut ::c_char,
1997 hostlen: ::socklen_t,
1998 serv: *mut ::c_char,
1999 sevlen: ::socklen_t,
2000 flags: ::c_int) -> ::c_int;
2001 pub fn mincore(addr: *const ::c_void, len: ::size_t,
2002 vec: *mut ::c_char) -> ::c_int;
2003 pub fn sysctlnametomib(name: *const ::c_char,
2004 mibp: *mut ::c_int,
2005 sizep: *mut ::size_t)
2006 -> ::c_int;
92a42be0
SL
2007 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2008 link_name = "mprotect$UNIX2003")]
2009 pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
2010 -> ::c_int;
2011 pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int;
2012 pub fn sysctl(name: *mut ::c_int,
2013 namelen: ::c_uint,
2014 oldp: *mut ::c_void,
2015 oldlenp: *mut ::size_t,
2016 newp: *mut ::c_void,
2017 newlen: ::size_t)
2018 -> ::c_int;
2019 pub fn sysctlbyname(name: *const ::c_char,
2020 oldp: *mut ::c_void,
2021 oldlenp: *mut ::size_t,
2022 newp: *mut ::c_void,
2023 newlen: ::size_t)
2024 -> ::c_int;
2025 pub fn mach_absolute_time() -> u64;
2026 pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int;
2027 pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int;
2028 pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void;
2029 pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t;
8bb4bdeb
XL
2030 pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t,
2031 pshared: ::c_int) -> ::c_int;
2032 pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t,
2033 pshared: *mut ::c_int) -> ::c_int;
2034 pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t,
2035 pshared: ::c_int) -> ::c_int;
2036 pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t,
2037 pshared: *mut ::c_int) -> ::c_int;
3b2f2976
XL
2038 pub fn pthread_rwlockattr_getpshared(attr: *const pthread_rwlockattr_t,
2039 val: *mut ::c_int) -> ::c_int;
2040 pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t,
2041 val: ::c_int) -> ::c_int;
92a42be0
SL
2042 pub fn __error() -> *mut ::c_int;
2043 pub fn backtrace(buf: *mut *mut ::c_void,
2044 sz: ::c_int) -> ::c_int;
9cc50fc6
SL
2045 #[cfg_attr(target_os = "macos", link_name = "statfs$INODE64")]
2046 pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
2047 #[cfg_attr(target_os = "macos", link_name = "fstatfs$INODE64")]
2048 pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
2049 pub fn kevent(kq: ::c_int,
2050 changelist: *const ::kevent,
2051 nchanges: ::c_int,
2052 eventlist: *mut ::kevent,
2053 nevents: ::c_int,
2054 timeout: *const ::timespec) -> ::c_int;
2055 pub fn kevent64(kq: ::c_int,
2056 changelist: *const ::kevent64_s,
2057 nchanges: ::c_int,
2058 eventlist: *mut ::kevent64_s,
2059 nevents: ::c_int,
2060 flags: ::c_uint,
2061 timeout: *const ::timespec) -> ::c_int;
2062 pub fn mount(src: *const ::c_char,
2063 target: *const ::c_char,
2064 flags: ::c_int,
2065 data: *mut ::c_void) -> ::c_int;
3b2f2976 2066 pub fn ptrace(request: ::c_int,
9cc50fc6
SL
2067 pid: ::pid_t,
2068 addr: *mut ::c_char,
2069 data: ::c_int) -> ::c_int;
2070 pub fn quotactl(special: *const ::c_char,
2071 cmd: ::c_int,
2072 id: ::c_int,
2073 data: *mut ::c_char) -> ::c_int;
2074 pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
7453a54e
SL
2075 pub fn sendfile(fd: ::c_int,
2076 s: ::c_int,
2077 offset: ::off_t,
2078 len: *mut ::off_t,
2079 hdtr: *mut ::sf_hdtr,
2080 flags: ::c_int) -> ::c_int;
54a0048b
SL
2081 pub fn openpty(amaster: *mut ::c_int,
2082 aslave: *mut ::c_int,
2083 name: *mut ::c_char,
2084 termp: *mut termios,
2085 winp: *mut ::winsize) -> ::c_int;
2086 pub fn forkpty(amaster: *mut ::c_int,
2087 name: *mut ::c_char,
2088 termp: *mut termios,
2089 winp: *mut ::winsize) -> ::pid_t;
a7813a04
XL
2090 pub fn duplocale(base: ::locale_t) -> ::locale_t;
2091 pub fn freelocale(loc: ::locale_t) -> ::c_int;
2092 pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
2093 pub fn newlocale(mask: ::c_int,
2094 locale: *const ::c_char,
2095 base: ::locale_t) -> ::locale_t;
2096 pub fn uselocale(loc: ::locale_t) -> ::locale_t;
2097 pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
3157f602
XL
2098 pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
2099 pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
5bcae85e 2100
041b39d2
XL
2101 pub fn getxattr(path: *const ::c_char, name: *const ::c_char,
2102 value: *mut ::c_void, size: ::size_t, position: u32,
2103 flags: ::c_int) -> ::ssize_t;
2104 pub fn fgetxattr(filedes: ::c_int, name: *const ::c_char,
2105 value: *mut ::c_void, size: ::size_t, position: u32,
2106 flags: ::c_int) -> ::ssize_t;
2107 pub fn setxattr(path: *const ::c_char, name: *const ::c_char,
2108 value: *const ::c_void, size: ::size_t, position: u32,
2109 flags: ::c_int) -> ::c_int;
2110 pub fn fsetxattr(filedes: ::c_int, name: *const ::c_char,
2111 value: *const ::c_void, size: ::size_t, position: u32,
2112 flags: ::c_int) -> ::c_int;
2113 pub fn listxattr(path: *const ::c_char, list: *mut ::c_char,
2114 size: ::size_t, flags: ::c_int) -> ::ssize_t;
2115 pub fn flistxattr(filedes: ::c_int, list: *mut ::c_char,
2116 size: ::size_t, flags: ::c_int) -> ::ssize_t;
2117 pub fn removexattr(path: *const ::c_char, name: *const ::c_char,
2118 flags: ::c_int) -> ::c_int;
2119 pub fn fremovexattr(filedes: ::c_int, name: *const ::c_char,
2120 flags: ::c_int) -> ::c_int;
2121
3b2f2976
XL
2122 pub fn getgrouplist(name: *const ::c_char,
2123 basegid: ::c_int,
2124 groups: *mut ::c_int,
2125 ngroups: *mut ::c_int) -> ::c_int;
32a655c1 2126 pub fn initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int;
8bb4bdeb
XL
2127
2128 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2129 link_name = "waitid$UNIX2003")]
2130 pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t,
2131 options: ::c_int) -> ::c_int;
041b39d2
XL
2132 pub fn brk(addr: *const ::c_void) -> *mut ::c_void;
2133 pub fn sbrk(increment: ::c_int) -> *mut ::c_void;
2134 pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
92a42be0
SL
2135}
2136
2137cfg_if! {
2138 if #[cfg(any(target_arch = "arm", target_arch = "x86"))] {
2139 mod b32;
2140 pub use self::b32::*;
2141 } else if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] {
2142 mod b64;
2143 pub use self::b64::*;
2144 } else {
54a0048b 2145 // Unknown target_arch
92a42be0
SL
2146 }
2147}