]> git.proxmox.com Git - rustc.git/blob - src/liblibc/src/unix/bsd/freebsdlike/mod.rs
New upstream version 1.29.0+dfsg1
[rustc.git] / src / liblibc / src / unix / bsd / freebsdlike / mod.rs
1 pub type c_char = i8;
2 pub type dev_t = u32;
3 pub type mode_t = u16;
4 pub type pthread_attr_t = *mut ::c_void;
5 pub type rlim_t = i64;
6 pub type mqd_t = *mut ::c_void;
7 pub type pthread_mutex_t = *mut ::c_void;
8 pub type pthread_mutexattr_t = *mut ::c_void;
9 pub type pthread_cond_t = *mut ::c_void;
10 pub type pthread_condattr_t = *mut ::c_void;
11 pub type pthread_rwlock_t = *mut ::c_void;
12 pub type pthread_rwlockattr_t = *mut ::c_void;
13 pub type pthread_key_t = ::c_int;
14 pub type tcflag_t = ::c_uint;
15 pub type speed_t = ::c_uint;
16 pub type nl_item = ::c_int;
17 pub type id_t = i64;
18
19 pub enum timezone {}
20
21 s! {
22 pub struct glob_t {
23 pub gl_pathc: ::size_t,
24 pub gl_matchc: ::size_t,
25 pub gl_offs: ::size_t,
26 pub gl_flags: ::c_int,
27 pub gl_pathv: *mut *mut ::c_char,
28 __unused3: *mut ::c_void,
29 __unused4: *mut ::c_void,
30 __unused5: *mut ::c_void,
31 __unused6: *mut ::c_void,
32 __unused7: *mut ::c_void,
33 __unused8: *mut ::c_void,
34 }
35
36 pub struct kevent {
37 pub ident: ::uintptr_t,
38 pub filter: ::c_short,
39 pub flags: ::c_ushort,
40 pub fflags: ::c_uint,
41 pub data: ::intptr_t,
42 pub udata: *mut ::c_void,
43 }
44
45 pub struct sockaddr_storage {
46 pub ss_len: u8,
47 pub ss_family: ::sa_family_t,
48 __ss_pad1: [u8; 6],
49 __ss_align: i64,
50 __ss_pad2: [u8; 112],
51 }
52
53 pub struct addrinfo {
54 pub ai_flags: ::c_int,
55 pub ai_family: ::c_int,
56 pub ai_socktype: ::c_int,
57 pub ai_protocol: ::c_int,
58 pub ai_addrlen: ::socklen_t,
59 pub ai_canonname: *mut ::c_char,
60 pub ai_addr: *mut ::sockaddr,
61 pub ai_next: *mut addrinfo,
62 }
63
64 pub struct sigset_t {
65 bits: [u32; 4],
66 }
67
68 pub struct siginfo_t {
69 pub si_signo: ::c_int,
70 pub si_errno: ::c_int,
71 pub si_code: ::c_int,
72 pub si_pid: ::pid_t,
73 pub si_uid: ::uid_t,
74 pub si_status: ::c_int,
75 pub si_addr: *mut ::c_void,
76 _pad: [::c_int; 12],
77 }
78
79 pub struct sigaction {
80 pub sa_sigaction: ::sighandler_t,
81 pub sa_flags: ::c_int,
82 pub sa_mask: sigset_t,
83 }
84
85 pub struct stack_t {
86 // In FreeBSD 11 and later, ss_sp is actually a void*
87 pub ss_sp: *mut ::c_char,
88 pub ss_size: ::size_t,
89 pub ss_flags: ::c_int,
90 }
91
92 pub struct sched_param {
93 pub sched_priority: ::c_int,
94 }
95
96 pub struct Dl_info {
97 pub dli_fname: *const ::c_char,
98 pub dli_fbase: *mut ::c_void,
99 pub dli_sname: *const ::c_char,
100 pub dli_saddr: *mut ::c_void,
101 }
102
103 pub struct sockaddr_in {
104 pub sin_len: u8,
105 pub sin_family: ::sa_family_t,
106 pub sin_port: ::in_port_t,
107 pub sin_addr: ::in_addr,
108 pub sin_zero: [::c_char; 8],
109 }
110
111 pub struct termios {
112 pub c_iflag: ::tcflag_t,
113 pub c_oflag: ::tcflag_t,
114 pub c_cflag: ::tcflag_t,
115 pub c_lflag: ::tcflag_t,
116 pub c_cc: [::cc_t; ::NCCS],
117 pub c_ispeed: ::speed_t,
118 pub c_ospeed: ::speed_t,
119 }
120
121 pub struct flock {
122 pub l_start: ::off_t,
123 pub l_len: ::off_t,
124 pub l_pid: ::pid_t,
125 pub l_type: ::c_short,
126 pub l_whence: ::c_short,
127 #[cfg(not(target_os = "dragonfly"))]
128 pub l_sysid: ::c_int,
129 }
130
131 pub struct sf_hdtr {
132 pub headers: *mut ::iovec,
133 pub hdr_cnt: ::c_int,
134 pub trailers: *mut ::iovec,
135 pub trl_cnt: ::c_int,
136 }
137
138 pub struct lconv {
139 pub decimal_point: *mut ::c_char,
140 pub thousands_sep: *mut ::c_char,
141 pub grouping: *mut ::c_char,
142 pub int_curr_symbol: *mut ::c_char,
143 pub currency_symbol: *mut ::c_char,
144 pub mon_decimal_point: *mut ::c_char,
145 pub mon_thousands_sep: *mut ::c_char,
146 pub mon_grouping: *mut ::c_char,
147 pub positive_sign: *mut ::c_char,
148 pub negative_sign: *mut ::c_char,
149 pub int_frac_digits: ::c_char,
150 pub frac_digits: ::c_char,
151 pub p_cs_precedes: ::c_char,
152 pub p_sep_by_space: ::c_char,
153 pub n_cs_precedes: ::c_char,
154 pub n_sep_by_space: ::c_char,
155 pub p_sign_posn: ::c_char,
156 pub n_sign_posn: ::c_char,
157 pub int_p_cs_precedes: ::c_char,
158 pub int_n_cs_precedes: ::c_char,
159 pub int_p_sep_by_space: ::c_char,
160 pub int_n_sep_by_space: ::c_char,
161 pub int_p_sign_posn: ::c_char,
162 pub int_n_sign_posn: ::c_char,
163 }
164
165 pub struct cmsgcred {
166 pub cmcred_pid: ::pid_t,
167 pub cmcred_uid: ::uid_t,
168 pub cmcred_euid: ::uid_t,
169 pub cmcred_gid: ::gid_t,
170 pub cmcred_ngroups: ::c_short,
171 pub cmcred_groups: [::gid_t; CMGROUP_MAX],
172 }
173
174 pub struct rtprio {
175 pub type_: ::c_ushort,
176 pub prio: ::c_ushort,
177 }
178
179 pub struct in6_pktinfo {
180 pub ipi6_addr: ::in6_addr,
181 pub ipi6_ifindex: ::c_uint,
182 }
183
184 pub struct arphdr {
185 pub ar_hrd: u16,
186 pub ar_pro: u16,
187 pub ar_hln: u8,
188 pub ar_pln: u8,
189 pub ar_op: u16,
190 }
191 }
192
193 pub const AIO_LISTIO_MAX: ::c_int = 16;
194 pub const AIO_CANCELED: ::c_int = 1;
195 pub const AIO_NOTCANCELED: ::c_int = 2;
196 pub const AIO_ALLDONE: ::c_int = 3;
197 pub const LIO_NOP: ::c_int = 0;
198 pub const LIO_WRITE: ::c_int = 1;
199 pub const LIO_READ: ::c_int = 2;
200 pub const LIO_WAIT: ::c_int = 1;
201 pub const LIO_NOWAIT: ::c_int = 0;
202
203 pub const SIGEV_NONE: ::c_int = 0;
204 pub const SIGEV_SIGNAL: ::c_int = 1;
205 pub const SIGEV_THREAD: ::c_int = 2;
206 pub const SIGEV_KEVENT: ::c_int = 3;
207
208 pub const CODESET: ::nl_item = 0;
209 pub const D_T_FMT: ::nl_item = 1;
210 pub const D_FMT: ::nl_item = 2;
211 pub const T_FMT: ::nl_item = 3;
212 pub const T_FMT_AMPM: ::nl_item = 4;
213 pub const AM_STR: ::nl_item = 5;
214 pub const PM_STR: ::nl_item = 6;
215
216 pub const DAY_1: ::nl_item = 7;
217 pub const DAY_2: ::nl_item = 8;
218 pub const DAY_3: ::nl_item = 9;
219 pub const DAY_4: ::nl_item = 10;
220 pub const DAY_5: ::nl_item = 11;
221 pub const DAY_6: ::nl_item = 12;
222 pub const DAY_7: ::nl_item = 13;
223
224 pub const ABDAY_1: ::nl_item = 14;
225 pub const ABDAY_2: ::nl_item = 15;
226 pub const ABDAY_3: ::nl_item = 16;
227 pub const ABDAY_4: ::nl_item = 17;
228 pub const ABDAY_5: ::nl_item = 18;
229 pub const ABDAY_6: ::nl_item = 19;
230 pub const ABDAY_7: ::nl_item = 20;
231
232 pub const MON_1: ::nl_item = 21;
233 pub const MON_2: ::nl_item = 22;
234 pub const MON_3: ::nl_item = 23;
235 pub const MON_4: ::nl_item = 24;
236 pub const MON_5: ::nl_item = 25;
237 pub const MON_6: ::nl_item = 26;
238 pub const MON_7: ::nl_item = 27;
239 pub const MON_8: ::nl_item = 28;
240 pub const MON_9: ::nl_item = 29;
241 pub const MON_10: ::nl_item = 30;
242 pub const MON_11: ::nl_item = 31;
243 pub const MON_12: ::nl_item = 32;
244
245 pub const ABMON_1: ::nl_item = 33;
246 pub const ABMON_2: ::nl_item = 34;
247 pub const ABMON_3: ::nl_item = 35;
248 pub const ABMON_4: ::nl_item = 36;
249 pub const ABMON_5: ::nl_item = 37;
250 pub const ABMON_6: ::nl_item = 38;
251 pub const ABMON_7: ::nl_item = 39;
252 pub const ABMON_8: ::nl_item = 40;
253 pub const ABMON_9: ::nl_item = 41;
254 pub const ABMON_10: ::nl_item = 42;
255 pub const ABMON_11: ::nl_item = 43;
256 pub const ABMON_12: ::nl_item = 44;
257
258 pub const ERA: ::nl_item = 45;
259 pub const ERA_D_FMT: ::nl_item = 46;
260 pub const ERA_D_T_FMT: ::nl_item = 47;
261 pub const ERA_T_FMT: ::nl_item = 48;
262 pub const ALT_DIGITS: ::nl_item = 49;
263
264 pub const RADIXCHAR: ::nl_item = 50;
265 pub const THOUSEP: ::nl_item = 51;
266
267 pub const YESEXPR: ::nl_item = 52;
268 pub const NOEXPR: ::nl_item = 53;
269
270 pub const YESSTR: ::nl_item = 54;
271 pub const NOSTR: ::nl_item = 55;
272
273 pub const CRNCYSTR: ::nl_item = 56;
274
275 pub const D_MD_ORDER: ::nl_item = 57;
276
277 pub const ALTMON_1: ::nl_item = 58;
278 pub const ALTMON_2: ::nl_item = 59;
279 pub const ALTMON_3: ::nl_item = 60;
280 pub const ALTMON_4: ::nl_item = 61;
281 pub const ALTMON_5: ::nl_item = 62;
282 pub const ALTMON_6: ::nl_item = 63;
283 pub const ALTMON_7: ::nl_item = 64;
284 pub const ALTMON_8: ::nl_item = 65;
285 pub const ALTMON_9: ::nl_item = 66;
286 pub const ALTMON_10: ::nl_item = 67;
287 pub const ALTMON_11: ::nl_item = 68;
288 pub const ALTMON_12: ::nl_item = 69;
289
290 pub const EXIT_FAILURE: ::c_int = 1;
291 pub const EXIT_SUCCESS: ::c_int = 0;
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 SEEK_DATA: ::c_int = 3;
297 pub const SEEK_HOLE: ::c_int = 4;
298 pub const _IOFBF: ::c_int = 0;
299 pub const _IONBF: ::c_int = 2;
300 pub const _IOLBF: ::c_int = 1;
301 pub const BUFSIZ: ::c_uint = 1024;
302 pub const FOPEN_MAX: ::c_uint = 20;
303 pub const FILENAME_MAX: ::c_uint = 1024;
304 pub const L_tmpnam: ::c_uint = 1024;
305 pub const TMP_MAX: ::c_uint = 308915776;
306
307 pub const O_NOCTTY: ::c_int = 32768;
308 pub const O_DIRECT: ::c_int = 0x00010000;
309
310 pub const S_IFIFO: mode_t = 4096;
311 pub const S_IFCHR: mode_t = 8192;
312 pub const S_IFBLK: mode_t = 24576;
313 pub const S_IFDIR: mode_t = 16384;
314 pub const S_IFREG: mode_t = 32768;
315 pub const S_IFLNK: mode_t = 40960;
316 pub const S_IFSOCK: mode_t = 49152;
317 pub const S_IFMT: mode_t = 61440;
318 pub const S_IEXEC: mode_t = 64;
319 pub const S_IWRITE: mode_t = 128;
320 pub const S_IREAD: mode_t = 256;
321 pub const S_IRWXU: mode_t = 448;
322 pub const S_IXUSR: mode_t = 64;
323 pub const S_IWUSR: mode_t = 128;
324 pub const S_IRUSR: mode_t = 256;
325 pub const S_IRWXG: mode_t = 56;
326 pub const S_IXGRP: mode_t = 8;
327 pub const S_IWGRP: mode_t = 16;
328 pub const S_IRGRP: mode_t = 32;
329 pub const S_IRWXO: mode_t = 7;
330 pub const S_IXOTH: mode_t = 1;
331 pub const S_IWOTH: mode_t = 2;
332 pub const S_IROTH: mode_t = 4;
333 pub const F_OK: ::c_int = 0;
334 pub const R_OK: ::c_int = 4;
335 pub const W_OK: ::c_int = 2;
336 pub const X_OK: ::c_int = 1;
337 pub const STDIN_FILENO: ::c_int = 0;
338 pub const STDOUT_FILENO: ::c_int = 1;
339 pub const STDERR_FILENO: ::c_int = 2;
340 pub const F_LOCK: ::c_int = 1;
341 pub const F_TEST: ::c_int = 3;
342 pub const F_TLOCK: ::c_int = 2;
343 pub const F_ULOCK: ::c_int = 0;
344 pub const F_DUPFD_CLOEXEC: ::c_int = 17;
345 pub const SIGHUP: ::c_int = 1;
346 pub const SIGINT: ::c_int = 2;
347 pub const SIGQUIT: ::c_int = 3;
348 pub const SIGILL: ::c_int = 4;
349 pub const SIGABRT: ::c_int = 6;
350 pub const SIGEMT: ::c_int = 7;
351 pub const SIGFPE: ::c_int = 8;
352 pub const SIGKILL: ::c_int = 9;
353 pub const SIGSEGV: ::c_int = 11;
354 pub const SIGPIPE: ::c_int = 13;
355 pub const SIGALRM: ::c_int = 14;
356 pub const SIGTERM: ::c_int = 15;
357
358 pub const PROT_NONE: ::c_int = 0;
359 pub const PROT_READ: ::c_int = 1;
360 pub const PROT_WRITE: ::c_int = 2;
361 pub const PROT_EXEC: ::c_int = 4;
362
363 pub const MAP_FILE: ::c_int = 0x0000;
364 pub const MAP_SHARED: ::c_int = 0x0001;
365 pub const MAP_PRIVATE: ::c_int = 0x0002;
366 pub const MAP_FIXED: ::c_int = 0x0010;
367 pub const MAP_ANON: ::c_int = 0x1000;
368 pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
369
370 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
371
372 pub const MCL_CURRENT: ::c_int = 0x0001;
373 pub const MCL_FUTURE: ::c_int = 0x0002;
374
375 pub const MS_SYNC: ::c_int = 0x0000;
376 pub const MS_ASYNC: ::c_int = 0x0001;
377 pub const MS_INVALIDATE: ::c_int = 0x0002;
378
379 pub const EPERM: ::c_int = 1;
380 pub const ENOENT: ::c_int = 2;
381 pub const ESRCH: ::c_int = 3;
382 pub const EINTR: ::c_int = 4;
383 pub const EIO: ::c_int = 5;
384 pub const ENXIO: ::c_int = 6;
385 pub const E2BIG: ::c_int = 7;
386 pub const ENOEXEC: ::c_int = 8;
387 pub const EBADF: ::c_int = 9;
388 pub const ECHILD: ::c_int = 10;
389 pub const EDEADLK: ::c_int = 11;
390 pub const ENOMEM: ::c_int = 12;
391 pub const EACCES: ::c_int = 13;
392 pub const EFAULT: ::c_int = 14;
393 pub const ENOTBLK: ::c_int = 15;
394 pub const EBUSY: ::c_int = 16;
395 pub const EEXIST: ::c_int = 17;
396 pub const EXDEV: ::c_int = 18;
397 pub const ENODEV: ::c_int = 19;
398 pub const ENOTDIR: ::c_int = 20;
399 pub const EISDIR: ::c_int = 21;
400 pub const EINVAL: ::c_int = 22;
401 pub const ENFILE: ::c_int = 23;
402 pub const EMFILE: ::c_int = 24;
403 pub const ENOTTY: ::c_int = 25;
404 pub const ETXTBSY: ::c_int = 26;
405 pub const EFBIG: ::c_int = 27;
406 pub const ENOSPC: ::c_int = 28;
407 pub const ESPIPE: ::c_int = 29;
408 pub const EROFS: ::c_int = 30;
409 pub const EMLINK: ::c_int = 31;
410 pub const EPIPE: ::c_int = 32;
411 pub const EDOM: ::c_int = 33;
412 pub const ERANGE: ::c_int = 34;
413 pub const EAGAIN: ::c_int = 35;
414 pub const EWOULDBLOCK: ::c_int = 35;
415 pub const EINPROGRESS: ::c_int = 36;
416 pub const EALREADY: ::c_int = 37;
417 pub const ENOTSOCK: ::c_int = 38;
418 pub const EDESTADDRREQ: ::c_int = 39;
419 pub const EMSGSIZE: ::c_int = 40;
420 pub const EPROTOTYPE: ::c_int = 41;
421 pub const ENOPROTOOPT: ::c_int = 42;
422 pub const EPROTONOSUPPORT: ::c_int = 43;
423 pub const ESOCKTNOSUPPORT: ::c_int = 44;
424 pub const EOPNOTSUPP: ::c_int = 45;
425 pub const ENOTSUP: ::c_int = EOPNOTSUPP;
426 pub const EPFNOSUPPORT: ::c_int = 46;
427 pub const EAFNOSUPPORT: ::c_int = 47;
428 pub const EADDRINUSE: ::c_int = 48;
429 pub const EADDRNOTAVAIL: ::c_int = 49;
430 pub const ENETDOWN: ::c_int = 50;
431 pub const ENETUNREACH: ::c_int = 51;
432 pub const ENETRESET: ::c_int = 52;
433 pub const ECONNABORTED: ::c_int = 53;
434 pub const ECONNRESET: ::c_int = 54;
435 pub const ENOBUFS: ::c_int = 55;
436 pub const EISCONN: ::c_int = 56;
437 pub const ENOTCONN: ::c_int = 57;
438 pub const ESHUTDOWN: ::c_int = 58;
439 pub const ETOOMANYREFS: ::c_int = 59;
440 pub const ETIMEDOUT: ::c_int = 60;
441 pub const ECONNREFUSED: ::c_int = 61;
442 pub const ELOOP: ::c_int = 62;
443 pub const ENAMETOOLONG: ::c_int = 63;
444 pub const EHOSTDOWN: ::c_int = 64;
445 pub const EHOSTUNREACH: ::c_int = 65;
446 pub const ENOTEMPTY: ::c_int = 66;
447 pub const EPROCLIM: ::c_int = 67;
448 pub const EUSERS: ::c_int = 68;
449 pub const EDQUOT: ::c_int = 69;
450 pub const ESTALE: ::c_int = 70;
451 pub const EREMOTE: ::c_int = 71;
452 pub const EBADRPC: ::c_int = 72;
453 pub const ERPCMISMATCH: ::c_int = 73;
454 pub const EPROGUNAVAIL: ::c_int = 74;
455 pub const EPROGMISMATCH: ::c_int = 75;
456 pub const EPROCUNAVAIL: ::c_int = 76;
457 pub const ENOLCK: ::c_int = 77;
458 pub const ENOSYS: ::c_int = 78;
459 pub const EFTYPE: ::c_int = 79;
460 pub const EAUTH: ::c_int = 80;
461 pub const ENEEDAUTH: ::c_int = 81;
462 pub const EIDRM: ::c_int = 82;
463 pub const ENOMSG: ::c_int = 83;
464 pub const EOVERFLOW: ::c_int = 84;
465 pub const ECANCELED: ::c_int = 85;
466 pub const EILSEQ: ::c_int = 86;
467 pub const ENOATTR: ::c_int = 87;
468 pub const EDOOFUS: ::c_int = 88;
469 pub const EBADMSG: ::c_int = 89;
470 pub const EMULTIHOP: ::c_int = 90;
471 pub const ENOLINK: ::c_int = 91;
472 pub const EPROTO: ::c_int = 92;
473
474 pub const POLLSTANDARD: ::c_short = ::POLLIN | ::POLLPRI | ::POLLOUT |
475 ::POLLRDNORM | ::POLLRDBAND | ::POLLWRBAND | ::POLLERR |
476 ::POLLHUP | ::POLLNVAL;
477
478 pub const EAI_AGAIN: ::c_int = 2;
479 pub const EAI_BADFLAGS: ::c_int = 3;
480 pub const EAI_FAIL: ::c_int = 4;
481 pub const EAI_FAMILY: ::c_int = 5;
482 pub const EAI_MEMORY: ::c_int = 6;
483 pub const EAI_NONAME: ::c_int = 8;
484 pub const EAI_SERVICE: ::c_int = 9;
485 pub const EAI_SOCKTYPE: ::c_int = 10;
486 pub const EAI_SYSTEM: ::c_int = 11;
487 pub const EAI_OVERFLOW: ::c_int = 14;
488
489 pub const F_DUPFD: ::c_int = 0;
490 pub const F_GETFD: ::c_int = 1;
491 pub const F_SETFD: ::c_int = 2;
492 pub const F_GETFL: ::c_int = 3;
493 pub const F_SETFL: ::c_int = 4;
494
495 pub const SIGTRAP: ::c_int = 5;
496
497 pub const GLOB_APPEND : ::c_int = 0x0001;
498 pub const GLOB_DOOFFS : ::c_int = 0x0002;
499 pub const GLOB_ERR : ::c_int = 0x0004;
500 pub const GLOB_MARK : ::c_int = 0x0008;
501 pub const GLOB_NOCHECK : ::c_int = 0x0010;
502 pub const GLOB_NOSORT : ::c_int = 0x0020;
503 pub const GLOB_NOESCAPE: ::c_int = 0x2000;
504
505 pub const GLOB_NOSPACE : ::c_int = -1;
506 pub const GLOB_ABORTED : ::c_int = -2;
507 pub const GLOB_NOMATCH : ::c_int = -3;
508
509 pub const POSIX_MADV_NORMAL: ::c_int = 0;
510 pub const POSIX_MADV_RANDOM: ::c_int = 1;
511 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
512 pub const POSIX_MADV_WILLNEED: ::c_int = 3;
513 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
514
515 pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
516 pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
517 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
518 pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
519
520 pub const RLIMIT_CPU: ::c_int = 0;
521 pub const RLIMIT_FSIZE: ::c_int = 1;
522 pub const RLIMIT_DATA: ::c_int = 2;
523 pub const RLIMIT_STACK: ::c_int = 3;
524 pub const RLIMIT_CORE: ::c_int = 4;
525 pub const RLIMIT_RSS: ::c_int = 5;
526 pub const RLIMIT_MEMLOCK: ::c_int = 6;
527 pub const RLIMIT_NPROC: ::c_int = 7;
528 pub const RLIMIT_NOFILE: ::c_int = 8;
529 pub const RLIMIT_SBSIZE: ::c_int = 9;
530 pub const RLIMIT_VMEM: ::c_int = 10;
531 pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM;
532 pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
533
534 pub const RUSAGE_SELF: ::c_int = 0;
535 pub const RUSAGE_CHILDREN: ::c_int = -1;
536
537 pub const MADV_NORMAL: ::c_int = 0;
538 pub const MADV_RANDOM: ::c_int = 1;
539 pub const MADV_SEQUENTIAL: ::c_int = 2;
540 pub const MADV_WILLNEED: ::c_int = 3;
541 pub const MADV_DONTNEED: ::c_int = 4;
542 pub const MADV_FREE: ::c_int = 5;
543 pub const MADV_NOSYNC: ::c_int = 6;
544 pub const MADV_AUTOSYNC: ::c_int = 7;
545 pub const MADV_NOCORE: ::c_int = 8;
546 pub const MADV_CORE: ::c_int = 9;
547
548 pub const MINCORE_INCORE: ::c_int = 0x1;
549 pub const MINCORE_REFERENCED: ::c_int = 0x2;
550 pub const MINCORE_MODIFIED: ::c_int = 0x4;
551 pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
552 pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
553 pub const MINCORE_SUPER: ::c_int = 0x20;
554
555 pub const AF_UNSPEC: ::c_int = 0;
556 pub const AF_LOCAL: ::c_int = 1;
557 pub const AF_UNIX: ::c_int = AF_LOCAL;
558 pub const AF_INET: ::c_int = 2;
559 pub const AF_IMPLINK: ::c_int = 3;
560 pub const AF_PUP: ::c_int = 4;
561 pub const AF_CHAOS: ::c_int = 5;
562 pub const AF_NETBIOS: ::c_int = 6;
563 pub const AF_ISO: ::c_int = 7;
564 pub const AF_OSI: ::c_int = AF_ISO;
565 pub const AF_ECMA: ::c_int = 8;
566 pub const AF_DATAKIT: ::c_int = 9;
567 pub const AF_CCITT: ::c_int = 10;
568 pub const AF_SNA: ::c_int = 11;
569 pub const AF_DECnet: ::c_int = 12;
570 pub const AF_DLI: ::c_int = 13;
571 pub const AF_LAT: ::c_int = 14;
572 pub const AF_HYLINK: ::c_int = 15;
573 pub const AF_APPLETALK: ::c_int = 16;
574 pub const AF_ROUTE: ::c_int = 17;
575 pub const AF_LINK: ::c_int = 18;
576 pub const pseudo_AF_XTP: ::c_int = 19;
577 pub const AF_COIP: ::c_int = 20;
578 pub const AF_CNT: ::c_int = 21;
579 pub const pseudo_AF_RTIP: ::c_int = 22;
580 pub const AF_IPX: ::c_int = 23;
581 pub const AF_SIP: ::c_int = 24;
582 pub const pseudo_AF_PIP: ::c_int = 25;
583 pub const AF_ISDN: ::c_int = 26;
584 pub const AF_E164: ::c_int = AF_ISDN;
585 pub const pseudo_AF_KEY: ::c_int = 27;
586 pub const AF_INET6: ::c_int = 28;
587 pub const AF_NATM: ::c_int = 29;
588 pub const AF_ATM: ::c_int = 30;
589 pub const pseudo_AF_HDRCMPLT: ::c_int = 31;
590 pub const AF_NETGRAPH: ::c_int = 32;
591
592 pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
593 pub const PF_LOCAL: ::c_int = AF_LOCAL;
594 pub const PF_UNIX: ::c_int = PF_LOCAL;
595 pub const PF_INET: ::c_int = AF_INET;
596 pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
597 pub const PF_PUP: ::c_int = AF_PUP;
598 pub const PF_CHAOS: ::c_int = AF_CHAOS;
599 pub const PF_NETBIOS: ::c_int = AF_NETBIOS;
600 pub const PF_ISO: ::c_int = AF_ISO;
601 pub const PF_OSI: ::c_int = AF_ISO;
602 pub const PF_ECMA: ::c_int = AF_ECMA;
603 pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
604 pub const PF_CCITT: ::c_int = AF_CCITT;
605 pub const PF_SNA: ::c_int = AF_SNA;
606 pub const PF_DECnet: ::c_int = AF_DECnet;
607 pub const PF_DLI: ::c_int = AF_DLI;
608 pub const PF_LAT: ::c_int = AF_LAT;
609 pub const PF_HYLINK: ::c_int = AF_HYLINK;
610 pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
611 pub const PF_ROUTE: ::c_int = AF_ROUTE;
612 pub const PF_LINK: ::c_int = AF_LINK;
613 pub const PF_XTP: ::c_int = pseudo_AF_XTP;
614 pub const PF_COIP: ::c_int = AF_COIP;
615 pub const PF_CNT: ::c_int = AF_CNT;
616 pub const PF_SIP: ::c_int = AF_SIP;
617 pub const PF_IPX: ::c_int = AF_IPX;
618 pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
619 pub const PF_PIP: ::c_int = pseudo_AF_PIP;
620 pub const PF_ISDN: ::c_int = AF_ISDN;
621 pub const PF_KEY: ::c_int = pseudo_AF_KEY;
622 pub const PF_INET6: ::c_int = AF_INET6;
623 pub const PF_NATM: ::c_int = AF_NATM;
624 pub const PF_ATM: ::c_int = AF_ATM;
625 pub const PF_NETGRAPH: ::c_int = AF_NETGRAPH;
626
627 pub const SOMAXCONN: ::c_int = 128;
628
629 pub const MSG_OOB: ::c_int = 0x00000001;
630 pub const MSG_PEEK: ::c_int = 0x00000002;
631 pub const MSG_DONTROUTE: ::c_int = 0x00000004;
632 pub const MSG_EOR: ::c_int = 0x00000008;
633 pub const MSG_TRUNC: ::c_int = 0x00000010;
634 pub const MSG_CTRUNC: ::c_int = 0x00000020;
635 pub const MSG_WAITALL: ::c_int = 0x00000040;
636 pub const MSG_DONTWAIT: ::c_int = 0x00000080;
637 pub const MSG_EOF: ::c_int = 0x00000100;
638
639 pub const SCM_TIMESTAMP: ::c_int = 0x02;
640
641 pub const SOCK_STREAM: ::c_int = 1;
642 pub const SOCK_DGRAM: ::c_int = 2;
643 pub const SOCK_RAW: ::c_int = 3;
644 pub const SOCK_RDM: ::c_int = 4;
645 pub const SOCK_SEQPACKET: ::c_int = 5;
646 pub const SOCK_CLOEXEC: ::c_int = 0x10000000;
647 pub const SOCK_NONBLOCK: ::c_int = 0x20000000;
648 pub const SOCK_MAXADDRLEN: ::c_int = 255;
649 pub const IP_TTL: ::c_int = 4;
650 pub const IP_HDRINCL: ::c_int = 2;
651 pub const IP_RECVDSTADDR: ::c_int = 7;
652 pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR;
653 pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
654 pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
655 pub const IPV6_JOIN_GROUP: ::c_int = 12;
656 pub const IPV6_LEAVE_GROUP: ::c_int = 13;
657 pub const IPV6_RECVPKTINFO: ::c_int = 36;
658 pub const IPV6_PKTINFO: ::c_int = 46;
659
660 pub const TCP_NODELAY: ::c_int = 1;
661 pub const TCP_KEEPIDLE: ::c_int = 256;
662 pub const TCP_KEEPINTVL: ::c_int = 512;
663 pub const TCP_KEEPCNT: ::c_int = 1024;
664
665 pub const SOL_SOCKET: ::c_int = 0xffff;
666 pub const SO_DEBUG: ::c_int = 0x01;
667 pub const SO_ACCEPTCONN: ::c_int = 0x0002;
668 pub const SO_REUSEADDR: ::c_int = 0x0004;
669 pub const SO_KEEPALIVE: ::c_int = 0x0008;
670 pub const SO_DONTROUTE: ::c_int = 0x0010;
671 pub const SO_BROADCAST: ::c_int = 0x0020;
672 pub const SO_USELOOPBACK: ::c_int = 0x0040;
673 pub const SO_LINGER: ::c_int = 0x0080;
674 pub const SO_OOBINLINE: ::c_int = 0x0100;
675 pub const SO_REUSEPORT: ::c_int = 0x0200;
676 pub const SO_TIMESTAMP: ::c_int = 0x0400;
677 pub const SO_NOSIGPIPE: ::c_int = 0x0800;
678 pub const SO_ACCEPTFILTER: ::c_int = 0x1000;
679 pub const SO_SNDBUF: ::c_int = 0x1001;
680 pub const SO_RCVBUF: ::c_int = 0x1002;
681 pub const SO_SNDLOWAT: ::c_int = 0x1003;
682 pub const SO_RCVLOWAT: ::c_int = 0x1004;
683 pub const SO_SNDTIMEO: ::c_int = 0x1005;
684 pub const SO_RCVTIMEO: ::c_int = 0x1006;
685 pub const SO_ERROR: ::c_int = 0x1007;
686 pub const SO_TYPE: ::c_int = 0x1008;
687
688 pub const SHUT_RD: ::c_int = 0;
689 pub const SHUT_WR: ::c_int = 1;
690 pub const SHUT_RDWR: ::c_int = 2;
691
692 pub const LOCK_SH: ::c_int = 1;
693 pub const LOCK_EX: ::c_int = 2;
694 pub const LOCK_NB: ::c_int = 4;
695 pub const LOCK_UN: ::c_int = 8;
696
697 pub const MAP_COPY: ::c_int = 0x0002;
698 pub const MAP_RENAME: ::c_int = 0x0020;
699 pub const MAP_NORESERVE: ::c_int = 0x0040;
700 pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
701 pub const MAP_STACK: ::c_int = 0x0400;
702 pub const MAP_NOSYNC: ::c_int = 0x0800;
703 pub const MAP_NOCORE: ::c_int = 0x020000;
704
705 pub const IPPROTO_RAW: ::c_int = 255;
706
707 pub const _PC_LINK_MAX: ::c_int = 1;
708 pub const _PC_MAX_CANON: ::c_int = 2;
709 pub const _PC_MAX_INPUT: ::c_int = 3;
710 pub const _PC_NAME_MAX: ::c_int = 4;
711 pub const _PC_PATH_MAX: ::c_int = 5;
712 pub const _PC_PIPE_BUF: ::c_int = 6;
713 pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
714 pub const _PC_NO_TRUNC: ::c_int = 8;
715 pub const _PC_VDISABLE: ::c_int = 9;
716 pub const _PC_ALLOC_SIZE_MIN: ::c_int = 10;
717 pub const _PC_FILESIZEBITS: ::c_int = 12;
718 pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
719 pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
720 pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
721 pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
722 pub const _PC_SYMLINK_MAX: ::c_int = 18;
723 pub const _PC_MIN_HOLE_SIZE: ::c_int = 21;
724 pub const _PC_ASYNC_IO: ::c_int = 53;
725 pub const _PC_PRIO_IO: ::c_int = 54;
726 pub const _PC_SYNC_IO: ::c_int = 55;
727 pub const _PC_ACL_EXTENDED: ::c_int = 59;
728 pub const _PC_ACL_PATH_MAX: ::c_int = 60;
729 pub const _PC_CAP_PRESENT: ::c_int = 61;
730 pub const _PC_INF_PRESENT: ::c_int = 62;
731 pub const _PC_MAC_PRESENT: ::c_int = 63;
732
733 pub const _SC_ARG_MAX: ::c_int = 1;
734 pub const _SC_CHILD_MAX: ::c_int = 2;
735 pub const _SC_CLK_TCK: ::c_int = 3;
736 pub const _SC_NGROUPS_MAX: ::c_int = 4;
737 pub const _SC_OPEN_MAX: ::c_int = 5;
738 pub const _SC_JOB_CONTROL: ::c_int = 6;
739 pub const _SC_SAVED_IDS: ::c_int = 7;
740 pub const _SC_VERSION: ::c_int = 8;
741 pub const _SC_BC_BASE_MAX: ::c_int = 9;
742 pub const _SC_BC_DIM_MAX: ::c_int = 10;
743 pub const _SC_BC_SCALE_MAX: ::c_int = 11;
744 pub const _SC_BC_STRING_MAX: ::c_int = 12;
745 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
746 pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
747 pub const _SC_LINE_MAX: ::c_int = 15;
748 pub const _SC_RE_DUP_MAX: ::c_int = 16;
749 pub const _SC_2_VERSION: ::c_int = 17;
750 pub const _SC_2_C_BIND: ::c_int = 18;
751 pub const _SC_2_C_DEV: ::c_int = 19;
752 pub const _SC_2_CHAR_TERM: ::c_int = 20;
753 pub const _SC_2_FORT_DEV: ::c_int = 21;
754 pub const _SC_2_FORT_RUN: ::c_int = 22;
755 pub const _SC_2_LOCALEDEF: ::c_int = 23;
756 pub const _SC_2_SW_DEV: ::c_int = 24;
757 pub const _SC_2_UPE: ::c_int = 25;
758 pub const _SC_STREAM_MAX: ::c_int = 26;
759 pub const _SC_TZNAME_MAX: ::c_int = 27;
760 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28;
761 pub const _SC_MAPPED_FILES: ::c_int = 29;
762 pub const _SC_MEMLOCK: ::c_int = 30;
763 pub const _SC_MEMLOCK_RANGE: ::c_int = 31;
764 pub const _SC_MEMORY_PROTECTION: ::c_int = 32;
765 pub const _SC_MESSAGE_PASSING: ::c_int = 33;
766 pub const _SC_PRIORITIZED_IO: ::c_int = 34;
767 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35;
768 pub const _SC_REALTIME_SIGNALS: ::c_int = 36;
769 pub const _SC_SEMAPHORES: ::c_int = 37;
770 pub const _SC_FSYNC: ::c_int = 38;
771 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39;
772 pub const _SC_SYNCHRONIZED_IO: ::c_int = 40;
773 pub const _SC_TIMERS: ::c_int = 41;
774 pub const _SC_AIO_LISTIO_MAX: ::c_int = 42;
775 pub const _SC_AIO_MAX: ::c_int = 43;
776 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
777 pub const _SC_DELAYTIMER_MAX: ::c_int = 45;
778 pub const _SC_MQ_OPEN_MAX: ::c_int = 46;
779 pub const _SC_PAGESIZE: ::c_int = 47;
780 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
781 pub const _SC_RTSIG_MAX: ::c_int = 48;
782 pub const _SC_SEM_NSEMS_MAX: ::c_int = 49;
783 pub const _SC_SEM_VALUE_MAX: ::c_int = 50;
784 pub const _SC_SIGQUEUE_MAX: ::c_int = 51;
785 pub const _SC_TIMER_MAX: ::c_int = 52;
786 pub const _SC_IOV_MAX: ::c_int = 56;
787 pub const _SC_NPROCESSORS_CONF: ::c_int = 57;
788 pub const _SC_2_PBS: ::c_int = 59;
789 pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60;
790 pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61;
791 pub const _SC_2_PBS_LOCATE: ::c_int = 62;
792 pub const _SC_2_PBS_MESSAGE: ::c_int = 63;
793 pub const _SC_2_PBS_TRACK: ::c_int = 64;
794 pub const _SC_ADVISORY_INFO: ::c_int = 65;
795 pub const _SC_BARRIERS: ::c_int = 66;
796 pub const _SC_CLOCK_SELECTION: ::c_int = 67;
797 pub const _SC_CPUTIME: ::c_int = 68;
798 pub const _SC_FILE_LOCKING: ::c_int = 69;
799 pub const _SC_NPROCESSORS_ONLN: ::c_int = 58;
800 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70;
801 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71;
802 pub const _SC_HOST_NAME_MAX: ::c_int = 72;
803 pub const _SC_LOGIN_NAME_MAX: ::c_int = 73;
804 pub const _SC_MONOTONIC_CLOCK: ::c_int = 74;
805 pub const _SC_MQ_PRIO_MAX: ::c_int = 75;
806 pub const _SC_READER_WRITER_LOCKS: ::c_int = 76;
807 pub const _SC_REGEXP: ::c_int = 77;
808 pub const _SC_SHELL: ::c_int = 78;
809 pub const _SC_SPAWN: ::c_int = 79;
810 pub const _SC_SPIN_LOCKS: ::c_int = 80;
811 pub const _SC_SPORADIC_SERVER: ::c_int = 81;
812 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82;
813 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83;
814 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85;
815 pub const _SC_THREAD_KEYS_MAX: ::c_int = 86;
816 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87;
817 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88;
818 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89;
819 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90;
820 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91;
821 pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92;
822 pub const _SC_THREAD_STACK_MIN: ::c_int = 93;
823 pub const _SC_THREAD_THREADS_MAX: ::c_int = 94;
824 pub const _SC_TIMEOUTS: ::c_int = 95;
825 pub const _SC_THREADS: ::c_int = 96;
826 pub const _SC_TRACE: ::c_int = 97;
827 pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98;
828 pub const _SC_TRACE_INHERIT: ::c_int = 99;
829 pub const _SC_TRACE_LOG: ::c_int = 100;
830 pub const _SC_TTY_NAME_MAX: ::c_int = 101;
831 pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102;
832 pub const _SC_V6_ILP32_OFF32: ::c_int = 103;
833 pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104;
834 pub const _SC_V6_LP64_OFF64: ::c_int = 105;
835 pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106;
836 pub const _SC_ATEXIT_MAX: ::c_int = 107;
837 pub const _SC_XOPEN_CRYPT: ::c_int = 108;
838 pub const _SC_XOPEN_ENH_I18N: ::c_int = 109;
839 pub const _SC_XOPEN_LEGACY: ::c_int = 110;
840 pub const _SC_XOPEN_REALTIME: ::c_int = 111;
841 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112;
842 pub const _SC_XOPEN_SHM: ::c_int = 113;
843 pub const _SC_XOPEN_STREAMS: ::c_int = 114;
844 pub const _SC_XOPEN_UNIX: ::c_int = 115;
845 pub const _SC_XOPEN_VERSION: ::c_int = 116;
846 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 117;
847 pub const _SC_IPV6: ::c_int = 118;
848 pub const _SC_RAW_SOCKETS: ::c_int = 119;
849 pub const _SC_SYMLOOP_MAX: ::c_int = 120;
850 pub const _SC_PHYS_PAGES: ::c_int = 121;
851
852 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;
853 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _;
854 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _;
855 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
856 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
857 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
858 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_ERRORCHECK;
859
860 pub const SCHED_FIFO: ::c_int = 1;
861 pub const SCHED_OTHER: ::c_int = 2;
862 pub const SCHED_RR: ::c_int = 3;
863
864 pub const FD_SETSIZE: usize = 1024;
865
866 pub const ST_NOSUID: ::c_ulong = 2;
867
868 pub const NI_MAXHOST: ::size_t = 1025;
869
870 pub const RTLD_LOCAL: ::c_int = 0;
871 pub const RTLD_NODELETE: ::c_int = 0x1000;
872 pub const RTLD_NOLOAD: ::c_int = 0x2000;
873 pub const RTLD_GLOBAL: ::c_int = 0x100;
874
875 pub const LOG_NTP: ::c_int = 12 << 3;
876 pub const LOG_SECURITY: ::c_int = 13 << 3;
877 pub const LOG_CONSOLE: ::c_int = 14 << 3;
878 pub const LOG_NFACILITIES: ::c_int = 24;
879
880 pub const TIOCEXCL: ::c_uint = 0x2000740d;
881 pub const TIOCNXCL: ::c_uint = 0x2000740e;
882 pub const TIOCFLUSH: ::c_ulong = 0x80047410;
883 pub const TIOCGETA: ::c_uint = 0x402c7413;
884 pub const TIOCSETA: ::c_ulong = 0x802c7414;
885 pub const TIOCSETAW: ::c_ulong = 0x802c7415;
886 pub const TIOCSETAF: ::c_ulong = 0x802c7416;
887 pub const TIOCGETD: ::c_uint = 0x4004741a;
888 pub const TIOCSETD: ::c_ulong = 0x8004741b;
889 pub const TIOCGDRAINWAIT: ::c_uint = 0x40047456;
890 pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
891 pub const TIOCTIMESTAMP: ::c_uint = 0x40107459;
892 pub const TIOCMGDTRWAIT: ::c_uint = 0x4004745a;
893 pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
894 pub const TIOCDRAIN: ::c_uint = 0x2000745e;
895 pub const TIOCEXT: ::c_ulong = 0x80047460;
896 pub const TIOCSCTTY: ::c_uint = 0x20007461;
897 pub const TIOCCONS: ::c_ulong = 0x80047462;
898 pub const TIOCGSID: ::c_uint = 0x40047463;
899 pub const TIOCSTAT: ::c_uint = 0x20007465;
900 pub const TIOCUCNTL: ::c_ulong = 0x80047466;
901 pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
902 pub const TIOCGWINSZ: ::c_uint = 0x40087468;
903 pub const TIOCMGET: ::c_uint = 0x4004746a;
904 pub const TIOCM_LE: ::c_int = 0x1;
905 pub const TIOCM_DTR: ::c_int = 0x2;
906 pub const TIOCM_RTS: ::c_int = 0x4;
907 pub const TIOCM_ST: ::c_int = 0x8;
908 pub const TIOCM_SR: ::c_int = 0x10;
909 pub const TIOCM_CTS: ::c_int = 0x20;
910 pub const TIOCM_RI: ::c_int = 0x80;
911 pub const TIOCM_DSR: ::c_int = 0x100;
912 pub const TIOCM_CD: ::c_int = 0x40;
913 pub const TIOCM_CAR: ::c_int = 0x40;
914 pub const TIOCM_RNG: ::c_int = 0x80;
915 pub const TIOCMBIC: ::c_ulong = 0x8004746b;
916 pub const TIOCMBIS: ::c_ulong = 0x8004746c;
917 pub const TIOCMSET: ::c_ulong = 0x8004746d;
918 pub const TIOCSTART: ::c_uint = 0x2000746e;
919 pub const TIOCSTOP: ::c_uint = 0x2000746f;
920 pub const TIOCPKT: ::c_ulong = 0x80047470;
921 pub const TIOCPKT_DATA: ::c_int = 0x0;
922 pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1;
923 pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2;
924 pub const TIOCPKT_STOP: ::c_int = 0x4;
925 pub const TIOCPKT_START: ::c_int = 0x8;
926 pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
927 pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
928 pub const TIOCPKT_IOCTL: ::c_int = 0x40;
929 pub const TIOCNOTTY: ::c_uint = 0x20007471;
930 pub const TIOCSTI: ::c_ulong = 0x80017472;
931 pub const TIOCOUTQ: ::c_uint = 0x40047473;
932 pub const TIOCSPGRP: ::c_ulong = 0x80047476;
933 pub const TIOCGPGRP: ::c_uint = 0x40047477;
934 pub const TIOCCDTR: ::c_uint = 0x20007478;
935 pub const TIOCSDTR: ::c_uint = 0x20007479;
936 pub const TIOCCBRK: ::c_uint = 0x2000747a;
937 pub const TIOCSBRK: ::c_uint = 0x2000747b;
938 pub const TTYDISC: ::c_int = 0x0;
939 pub const SLIPDISC: ::c_int = 0x4;
940 pub const PPPDISC: ::c_int = 0x5;
941 pub const NETGRAPHDISC: ::c_int = 0x6;
942
943 pub const B0: speed_t = 0;
944 pub const B50: speed_t = 50;
945 pub const B75: speed_t = 75;
946 pub const B110: speed_t = 110;
947 pub const B134: speed_t = 134;
948 pub const B150: speed_t = 150;
949 pub const B200: speed_t = 200;
950 pub const B300: speed_t = 300;
951 pub const B600: speed_t = 600;
952 pub const B1200: speed_t = 1200;
953 pub const B1800: speed_t = 1800;
954 pub const B2400: speed_t = 2400;
955 pub const B4800: speed_t = 4800;
956 pub const B9600: speed_t = 9600;
957 pub const B19200: speed_t = 19200;
958 pub const B38400: speed_t = 38400;
959 pub const B7200: speed_t = 7200;
960 pub const B14400: speed_t = 14400;
961 pub const B28800: speed_t = 28800;
962 pub const B57600: speed_t = 57600;
963 pub const B76800: speed_t = 76800;
964 pub const B115200: speed_t = 115200;
965 pub const B230400: speed_t = 230400;
966 pub const EXTA: speed_t = 19200;
967 pub const EXTB: speed_t = 38400;
968
969 pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
970
971 pub const CRTSCTS: ::tcflag_t = 0x00030000;
972 pub const CCTS_OFLOW: ::tcflag_t = 0x00010000;
973 pub const CRTS_IFLOW: ::tcflag_t = 0x00020000;
974 pub const CDTR_IFLOW: ::tcflag_t = 0x00040000;
975 pub const CDSR_OFLOW: ::tcflag_t = 0x00080000;
976 pub const CCAR_OFLOW: ::tcflag_t = 0x00100000;
977 pub const VERASE2: usize = 7;
978 pub const OCRNL: ::tcflag_t = 0x10;
979 pub const ONOCR: ::tcflag_t = 0x20;
980 pub const ONLRET: ::tcflag_t = 0x40;
981
982 pub const CMGROUP_MAX: usize = 16;
983
984 // https://github.com/freebsd/freebsd/blob/master/sys/net/bpf.h
985 // sizeof(long)
986 pub const BPF_ALIGNMENT: ::c_int = 8;
987
988 // Values for rtprio struct (prio field) and syscall (function argument)
989 pub const RTP_PRIO_MIN: ::c_ushort = 0;
990 pub const RTP_PRIO_MAX: ::c_ushort = 31;
991 pub const RTP_LOOKUP: ::c_int = 0;
992 pub const RTP_SET: ::c_int = 1;
993
994 f! {
995 pub fn WIFCONTINUED(status: ::c_int) -> bool {
996 status == 0x13
997 }
998
999 pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
1000 status >> 8
1001 }
1002
1003 pub fn WIFSIGNALED(status: ::c_int) -> bool {
1004 (status & 0o177) != 0o177 && (status & 0o177) != 0
1005 }
1006
1007 pub fn WIFSTOPPED(status: ::c_int) -> bool {
1008 (status & 0o177) == 0o177
1009 }
1010 }
1011
1012 extern {
1013 pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
1014 pub fn endutxent();
1015 pub fn getutxent() -> *mut utmpx;
1016 pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
1017 pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
1018 pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
1019 pub fn setutxent();
1020 pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
1021 pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
1022 pub fn getgrouplist(name: *const ::c_char,
1023 basegid: ::gid_t,
1024 groups: *mut ::gid_t,
1025 ngroups: *mut ::c_int) -> ::c_int;
1026 pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
1027 #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
1028 pub fn getpwent_r(pwd: *mut ::passwd,
1029 buf: *mut ::c_char,
1030 buflen: ::size_t,
1031 result: *mut *mut ::passwd) -> ::c_int;
1032 pub fn getgrent_r(grp: *mut ::group,
1033 buf: *mut ::c_char,
1034 buflen: ::size_t,
1035 result: *mut *mut ::group) -> ::c_int;
1036 pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
1037 pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
1038 pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
1039 pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
1040 pub fn mq_receive(mqd: ::mqd_t,
1041 msg_ptr: *mut ::c_char,
1042 msg_len: ::size_t,
1043 msq_prio: *mut ::c_uint) -> ::ssize_t;
1044 pub fn mq_send(mqd: ::mqd_t,
1045 msg_ptr: *const ::c_char,
1046 msg_len: ::size_t,
1047 msq_prio: ::c_uint) -> ::c_int;
1048 pub fn mq_setattr(mqd: ::mqd_t,
1049 newattr: *const ::mq_attr,
1050 oldattr: *mut ::mq_attr) -> ::c_int;
1051 pub fn mq_timedreceive(mqd: ::mqd_t,
1052 msg_ptr: *mut ::c_char,
1053 msg_len: ::size_t,
1054 msq_prio: *mut ::c_uint,
1055 abs_timeout: *const ::timespec) -> ::ssize_t;
1056 pub fn mq_timedsend(mqd: ::mqd_t,
1057 msg_ptr: *const ::c_char,
1058 msg_len: ::size_t,
1059 msq_prio: ::c_uint,
1060 abs_timeout: *const ::timespec) -> ::c_int;
1061 pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
1062 }
1063
1064 #[link(name = "util")]
1065 extern {
1066 pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
1067 pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
1068 pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
1069 pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
1070 pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
1071 pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int,
1072 timeout: *const ::timespec) -> ::c_int;
1073 pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
1074 pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
1075 nitems: ::c_int, sevp: *mut sigevent) -> ::c_int;
1076 pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
1077 pub fn getnameinfo(sa: *const ::sockaddr,
1078 salen: ::socklen_t,
1079 host: *mut ::c_char,
1080 hostlen: ::size_t,
1081 serv: *mut ::c_char,
1082 servlen: ::size_t,
1083 flags: ::c_int) -> ::c_int;
1084 #[cfg_attr(target_os = "freebsd", link_name = "kevent@FBSD_1.0")]
1085 pub fn kevent(kq: ::c_int,
1086 changelist: *const ::kevent,
1087 nchanges: ::c_int,
1088 eventlist: *mut ::kevent,
1089 nevents: ::c_int,
1090 timeout: *const ::timespec) -> ::c_int;
1091 pub fn mincore(addr: *const ::c_void, len: ::size_t,
1092 vec: *mut ::c_char) -> ::c_int;
1093 pub fn pwritev(fd: ::c_int,
1094 iov: *const ::iovec,
1095 iovcnt: ::c_int,
1096 offset: ::off_t) -> ::ssize_t;
1097 pub fn preadv(fd: ::c_int,
1098 iov: *const ::iovec,
1099 iovcnt: ::c_int,
1100 offset: ::off_t) -> ::ssize_t;
1101 pub fn sysctlnametomib(name: *const ::c_char,
1102 mibp: *mut ::c_int,
1103 sizep: *mut ::size_t)
1104 -> ::c_int;
1105 pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t)
1106 -> ::c_int;
1107 pub fn sysctl(name: *const ::c_int,
1108 namelen: ::c_uint,
1109 oldp: *mut ::c_void,
1110 oldlenp: *mut ::size_t,
1111 newp: *const ::c_void,
1112 newlen: ::size_t)
1113 -> ::c_int;
1114 pub fn sysctlbyname(name: *const ::c_char,
1115 oldp: *mut ::c_void,
1116 oldlenp: *mut ::size_t,
1117 newp: *const ::c_void,
1118 newlen: ::size_t)
1119 -> ::c_int;
1120 pub fn sched_setscheduler(pid: ::pid_t,
1121 policy: ::c_int,
1122 param: *const ::sched_param) -> ::c_int;
1123 pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
1124 pub fn memrchr(cx: *const ::c_void,
1125 c: ::c_int,
1126 n: ::size_t) -> *mut ::c_void;
1127 pub fn sendfile(fd: ::c_int,
1128 s: ::c_int,
1129 offset: ::off_t,
1130 nbytes: ::size_t,
1131 hdtr: *mut ::sf_hdtr,
1132 sbytes: *mut ::off_t,
1133 flags: ::c_int) -> ::c_int;
1134 pub fn sigtimedwait(set: *const sigset_t,
1135 info: *mut siginfo_t,
1136 timeout: *const ::timespec) -> ::c_int;
1137 pub fn sigwaitinfo(set: *const sigset_t,
1138 info: *mut siginfo_t) -> ::c_int;
1139 pub fn openpty(amaster: *mut ::c_int,
1140 aslave: *mut ::c_int,
1141 name: *mut ::c_char,
1142 termp: *mut termios,
1143 winp: *mut ::winsize) -> ::c_int;
1144 pub fn forkpty(amaster: *mut ::c_int,
1145 name: *mut ::c_char,
1146 termp: *mut termios,
1147 winp: *mut ::winsize) -> ::pid_t;
1148 pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
1149 pub fn duplocale(base: ::locale_t) -> ::locale_t;
1150 pub fn newlocale(mask: ::c_int,
1151 locale: *const ::c_char,
1152 base: ::locale_t) -> ::locale_t;
1153 pub fn uselocale(loc: ::locale_t) -> ::locale_t;
1154 pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
1155 pub fn accept4(s: ::c_int, addr: *mut ::sockaddr,
1156 addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int;
1157 pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
1158 pub fn pthread_attr_get_np(tid: ::pthread_t,
1159 attr: *mut ::pthread_attr_t) -> ::c_int;
1160 pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
1161 guardsize: *mut ::size_t) -> ::c_int;
1162 pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t,
1163 stackaddr: *mut *mut ::c_void,
1164 stacksize: *mut ::size_t) -> ::c_int;
1165 pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t,
1166 pshared: ::c_int) -> ::c_int;
1167 pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t,
1168 pshared: *mut ::c_int) -> ::c_int;
1169 pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t,
1170 pshared: ::c_int) -> ::c_int;
1171 pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t,
1172 pshared: *mut ::c_int) -> ::c_int;
1173 pub fn pthread_rwlockattr_getpshared(attr: *const pthread_rwlockattr_t,
1174 val: *mut ::c_int) -> ::c_int;
1175 pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t,
1176 val: ::c_int) -> ::c_int;
1177 pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
1178 pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
1179 pub fn rtprio(function: ::c_int, pid: ::pid_t, rtp: *mut rtprio) -> ::c_int;
1180
1181 #[cfg_attr(target_os = "freebsd", link_name = "mknodat@FBSD_1.1")]
1182 pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
1183 mode: ::mode_t, dev: dev_t) -> ::c_int;
1184 pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
1185 mode: ::mode_t) -> ::c_int;
1186 pub fn pthread_condattr_getclock(attr: *const pthread_condattr_t,
1187 clock_id: *mut clockid_t) -> ::c_int;
1188 pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t,
1189 clock_id: ::clockid_t) -> ::c_int;
1190 pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
1191 pub fn sem_timedwait(sem: *mut sem_t,
1192 abstime: *const ::timespec) -> ::c_int;
1193 pub fn sem_getvalue(sem: *mut sem_t,
1194 sval: *mut ::c_int) -> ::c_int;
1195 pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
1196 abstime: *const ::timespec) -> ::c_int;
1197 pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
1198 pub fn ppoll(fds: *mut ::pollfd,
1199 nfds: ::nfds_t,
1200 timeout: *const ::timespec,
1201 sigmask: *const sigset_t) -> ::c_int;
1202 pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
1203 pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
1204 pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
1205 }
1206
1207 cfg_if! {
1208 if #[cfg(target_os = "freebsd")] {
1209 mod freebsd;
1210 pub use self::freebsd::*;
1211 } else if #[cfg(target_os = "dragonfly")] {
1212 mod dragonfly;
1213 pub use self::dragonfly::*;
1214 } else {
1215 // ...
1216 }
1217 }