]> git.proxmox.com Git - rustc.git/blob - src/liblibc/src/unix/bsd/freebsdlike/mod.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / liblibc / src / unix / bsd / freebsdlike / mod.rs
1 pub type dev_t = u32;
2 pub type mode_t = u16;
3 pub type pthread_attr_t = *mut ::c_void;
4 pub type rlim_t = i64;
5 pub type pthread_mutex_t = *mut ::c_void;
6 pub type pthread_mutexattr_t = *mut ::c_void;
7 pub type pthread_cond_t = *mut ::c_void;
8 pub type pthread_rwlock_t = *mut ::c_void;
9 pub type pthread_key_t = ::c_int;
10 pub type tcflag_t = ::c_uint;
11 pub type speed_t = ::c_uint;
12
13 pub enum timezone {}
14
15 s! {
16 pub struct glob_t {
17 pub gl_pathc: ::size_t,
18 __unused1: ::size_t,
19 pub gl_offs: ::size_t,
20 __unused2: ::c_int,
21 pub gl_pathv: *mut *mut ::c_char,
22
23 __unused3: *mut ::c_void,
24
25 __unused4: *mut ::c_void,
26 __unused5: *mut ::c_void,
27 __unused6: *mut ::c_void,
28 __unused7: *mut ::c_void,
29 __unused8: *mut ::c_void,
30 }
31
32 pub struct sockaddr_storage {
33 pub ss_len: u8,
34 pub ss_family: ::sa_family_t,
35 __ss_pad1: [u8; 6],
36 __ss_align: i64,
37 __ss_pad2: [u8; 112],
38 }
39
40 pub struct addrinfo {
41 pub ai_flags: ::c_int,
42 pub ai_family: ::c_int,
43 pub ai_socktype: ::c_int,
44 pub ai_protocol: ::c_int,
45 pub ai_addrlen: ::socklen_t,
46 pub ai_canonname: *mut ::c_char,
47 pub ai_addr: *mut ::sockaddr,
48 pub ai_next: *mut addrinfo,
49 }
50
51 pub struct sigset_t {
52 bits: [u32; 4],
53 }
54
55 pub struct siginfo_t {
56 pub si_signo: ::c_int,
57 pub si_errno: ::c_int,
58 pub si_code: ::c_int,
59 pub si_pid: ::pid_t,
60 pub si_uid: ::uid_t,
61 pub si_status: ::c_int,
62 pub si_addr: *mut ::c_void,
63 _pad: [::c_int; 12],
64 }
65
66 pub struct sigaction {
67 pub sa_sigaction: ::sighandler_t,
68 pub sa_flags: ::c_int,
69 pub sa_mask: sigset_t,
70 }
71
72 pub struct stack_t {
73 pub ss_sp: *mut ::c_char,
74 pub ss_size: ::size_t,
75 pub ss_flags: ::c_int,
76 }
77
78 pub struct sched_param {
79 pub sched_priority: ::c_int,
80 }
81
82 pub struct Dl_info {
83 pub dli_fname: *const ::c_char,
84 pub dli_fbase: *mut ::c_void,
85 pub dli_sname: *const ::c_char,
86 pub dli_saddr: *mut ::c_void,
87 }
88
89 pub struct sockaddr_in {
90 pub sin_len: u8,
91 pub sin_family: ::sa_family_t,
92 pub sin_port: ::in_port_t,
93 pub sin_addr: ::in_addr,
94 pub sin_zero: [::c_char; 8],
95 }
96
97 pub struct termios {
98 pub c_iflag: ::tcflag_t,
99 pub c_oflag: ::tcflag_t,
100 pub c_cflag: ::tcflag_t,
101 pub c_lflag: ::tcflag_t,
102 pub c_cc: [::cc_t; ::NCCS],
103 pub c_ispeed: ::speed_t,
104 pub c_ospeed: ::speed_t,
105 }
106
107 pub struct flock {
108 pub l_start: ::off_t,
109 pub l_len: ::off_t,
110 pub l_pid: ::pid_t,
111 pub l_type: ::c_short,
112 pub l_whence: ::c_short,
113 #[cfg(not(target_os = "dragonfly"))]
114 pub l_sysid: ::c_int,
115 }
116
117 pub struct sf_hdtr {
118 pub headers: *mut ::iovec,
119 pub hdr_cnt: ::c_int,
120 pub trailers: *mut ::iovec,
121 pub trl_cnt: ::c_int,
122 }
123
124 pub struct lconv {
125 pub decimal_point: *mut ::c_char,
126 pub thousands_sep: *mut ::c_char,
127 pub grouping: *mut ::c_char,
128 pub int_curr_symbol: *mut ::c_char,
129 pub currency_symbol: *mut ::c_char,
130 pub mon_decimal_point: *mut ::c_char,
131 pub mon_thousands_sep: *mut ::c_char,
132 pub mon_grouping: *mut ::c_char,
133 pub positive_sign: *mut ::c_char,
134 pub negative_sign: *mut ::c_char,
135 pub int_frac_digits: ::c_char,
136 pub frac_digits: ::c_char,
137 pub p_cs_precedes: ::c_char,
138 pub p_sep_by_space: ::c_char,
139 pub n_cs_precedes: ::c_char,
140 pub n_sep_by_space: ::c_char,
141 pub p_sign_posn: ::c_char,
142 pub n_sign_posn: ::c_char,
143 pub int_p_cs_precedes: ::c_char,
144 pub int_n_cs_precedes: ::c_char,
145 pub int_p_sep_by_space: ::c_char,
146 pub int_n_sep_by_space: ::c_char,
147 pub int_p_sign_posn: ::c_char,
148 pub int_n_sign_posn: ::c_char,
149 }
150 }
151
152 pub const EXIT_FAILURE: ::c_int = 1;
153 pub const EXIT_SUCCESS: ::c_int = 0;
154 pub const EOF: ::c_int = -1;
155 pub const SEEK_SET: ::c_int = 0;
156 pub const SEEK_CUR: ::c_int = 1;
157 pub const SEEK_END: ::c_int = 2;
158 pub const _IOFBF: ::c_int = 0;
159 pub const _IONBF: ::c_int = 2;
160 pub const _IOLBF: ::c_int = 1;
161 pub const BUFSIZ: ::c_uint = 1024;
162 pub const FOPEN_MAX: ::c_uint = 20;
163 pub const FILENAME_MAX: ::c_uint = 1024;
164 pub const L_tmpnam: ::c_uint = 1024;
165 pub const TMP_MAX: ::c_uint = 308915776;
166
167 pub const O_RDONLY: ::c_int = 0;
168 pub const O_WRONLY: ::c_int = 1;
169 pub const O_RDWR: ::c_int = 2;
170 pub const O_ACCMODE: ::c_int = 3;
171 pub const O_APPEND: ::c_int = 8;
172 pub const O_CREAT: ::c_int = 512;
173 pub const O_EXCL: ::c_int = 2048;
174 pub const O_NOCTTY: ::c_int = 32768;
175 pub const O_TRUNC: ::c_int = 1024;
176 pub const S_IFIFO: mode_t = 4096;
177 pub const S_IFCHR: mode_t = 8192;
178 pub const S_IFBLK: mode_t = 24576;
179 pub const S_IFDIR: mode_t = 16384;
180 pub const S_IFREG: mode_t = 32768;
181 pub const S_IFLNK: mode_t = 40960;
182 pub const S_IFSOCK: mode_t = 49152;
183 pub const S_IFMT: mode_t = 61440;
184 pub const S_IEXEC: mode_t = 64;
185 pub const S_IWRITE: mode_t = 128;
186 pub const S_IREAD: mode_t = 256;
187 pub const S_IRWXU: mode_t = 448;
188 pub const S_IXUSR: mode_t = 64;
189 pub const S_IWUSR: mode_t = 128;
190 pub const S_IRUSR: mode_t = 256;
191 pub const S_IRWXG: mode_t = 56;
192 pub const S_IXGRP: mode_t = 8;
193 pub const S_IWGRP: mode_t = 16;
194 pub const S_IRGRP: mode_t = 32;
195 pub const S_IRWXO: mode_t = 7;
196 pub const S_IXOTH: mode_t = 1;
197 pub const S_IWOTH: mode_t = 2;
198 pub const S_IROTH: mode_t = 4;
199 pub const F_OK: ::c_int = 0;
200 pub const R_OK: ::c_int = 4;
201 pub const W_OK: ::c_int = 2;
202 pub const X_OK: ::c_int = 1;
203 pub const STDIN_FILENO: ::c_int = 0;
204 pub const STDOUT_FILENO: ::c_int = 1;
205 pub const STDERR_FILENO: ::c_int = 2;
206 pub const F_LOCK: ::c_int = 1;
207 pub const F_TEST: ::c_int = 3;
208 pub const F_TLOCK: ::c_int = 2;
209 pub const F_ULOCK: ::c_int = 0;
210 pub const F_DUPFD_CLOEXEC: ::c_int = 17;
211 pub const SIGHUP: ::c_int = 1;
212 pub const SIGINT: ::c_int = 2;
213 pub const SIGQUIT: ::c_int = 3;
214 pub const SIGILL: ::c_int = 4;
215 pub const SIGABRT: ::c_int = 6;
216 pub const SIGFPE: ::c_int = 8;
217 pub const SIGKILL: ::c_int = 9;
218 pub const SIGSEGV: ::c_int = 11;
219 pub const SIGPIPE: ::c_int = 13;
220 pub const SIGALRM: ::c_int = 14;
221 pub const SIGTERM: ::c_int = 15;
222
223 pub const PROT_NONE: ::c_int = 0;
224 pub const PROT_READ: ::c_int = 1;
225 pub const PROT_WRITE: ::c_int = 2;
226 pub const PROT_EXEC: ::c_int = 4;
227
228 pub const MAP_FILE: ::c_int = 0x0000;
229 pub const MAP_SHARED: ::c_int = 0x0001;
230 pub const MAP_PRIVATE: ::c_int = 0x0002;
231 pub const MAP_FIXED: ::c_int = 0x0010;
232 pub const MAP_ANON: ::c_int = 0x1000;
233
234 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
235
236 pub const MCL_CURRENT: ::c_int = 0x0001;
237 pub const MCL_FUTURE: ::c_int = 0x0002;
238
239 pub const MS_SYNC: ::c_int = 0x0000;
240 pub const MS_ASYNC: ::c_int = 0x0001;
241 pub const MS_INVALIDATE: ::c_int = 0x0002;
242
243 pub const EPERM: ::c_int = 1;
244 pub const ENOENT: ::c_int = 2;
245 pub const ESRCH: ::c_int = 3;
246 pub const EINTR: ::c_int = 4;
247 pub const EIO: ::c_int = 5;
248 pub const ENXIO: ::c_int = 6;
249 pub const E2BIG: ::c_int = 7;
250 pub const ENOEXEC: ::c_int = 8;
251 pub const EBADF: ::c_int = 9;
252 pub const ECHILD: ::c_int = 10;
253 pub const EDEADLK: ::c_int = 11;
254 pub const ENOMEM: ::c_int = 12;
255 pub const EACCES: ::c_int = 13;
256 pub const EFAULT: ::c_int = 14;
257 pub const ENOTBLK: ::c_int = 15;
258 pub const EBUSY: ::c_int = 16;
259 pub const EEXIST: ::c_int = 17;
260 pub const EXDEV: ::c_int = 18;
261 pub const ENODEV: ::c_int = 19;
262 pub const ENOTDIR: ::c_int = 20;
263 pub const EISDIR: ::c_int = 21;
264 pub const EINVAL: ::c_int = 22;
265 pub const ENFILE: ::c_int = 23;
266 pub const EMFILE: ::c_int = 24;
267 pub const ENOTTY: ::c_int = 25;
268 pub const ETXTBSY: ::c_int = 26;
269 pub const EFBIG: ::c_int = 27;
270 pub const ENOSPC: ::c_int = 28;
271 pub const ESPIPE: ::c_int = 29;
272 pub const EROFS: ::c_int = 30;
273 pub const EMLINK: ::c_int = 31;
274 pub const EPIPE: ::c_int = 32;
275 pub const EDOM: ::c_int = 33;
276 pub const ERANGE: ::c_int = 34;
277 pub const EAGAIN: ::c_int = 35;
278 pub const EWOULDBLOCK: ::c_int = 35;
279 pub const EINPROGRESS: ::c_int = 36;
280 pub const EALREADY: ::c_int = 37;
281 pub const ENOTSOCK: ::c_int = 38;
282 pub const EDESTADDRREQ: ::c_int = 39;
283 pub const EMSGSIZE: ::c_int = 40;
284 pub const EPROTOTYPE: ::c_int = 41;
285 pub const ENOPROTOOPT: ::c_int = 42;
286 pub const EPROTONOSUPPORT: ::c_int = 43;
287 pub const ESOCKTNOSUPPORT: ::c_int = 44;
288 pub const EOPNOTSUPP: ::c_int = 45;
289 pub const EPFNOSUPPORT: ::c_int = 46;
290 pub const EAFNOSUPPORT: ::c_int = 47;
291 pub const EADDRINUSE: ::c_int = 48;
292 pub const EADDRNOTAVAIL: ::c_int = 49;
293 pub const ENETDOWN: ::c_int = 50;
294 pub const ENETUNREACH: ::c_int = 51;
295 pub const ENETRESET: ::c_int = 52;
296 pub const ECONNABORTED: ::c_int = 53;
297 pub const ECONNRESET: ::c_int = 54;
298 pub const ENOBUFS: ::c_int = 55;
299 pub const EISCONN: ::c_int = 56;
300 pub const ENOTCONN: ::c_int = 57;
301 pub const ESHUTDOWN: ::c_int = 58;
302 pub const ETOOMANYREFS: ::c_int = 59;
303 pub const ETIMEDOUT: ::c_int = 60;
304 pub const ECONNREFUSED: ::c_int = 61;
305 pub const ELOOP: ::c_int = 62;
306 pub const ENAMETOOLONG: ::c_int = 63;
307 pub const EHOSTDOWN: ::c_int = 64;
308 pub const EHOSTUNREACH: ::c_int = 65;
309 pub const ENOTEMPTY: ::c_int = 66;
310 pub const EPROCLIM: ::c_int = 67;
311 pub const EUSERS: ::c_int = 68;
312 pub const EDQUOT: ::c_int = 69;
313 pub const ESTALE: ::c_int = 70;
314 pub const EREMOTE: ::c_int = 71;
315 pub const EBADRPC: ::c_int = 72;
316 pub const ERPCMISMATCH: ::c_int = 73;
317 pub const EPROGUNAVAIL: ::c_int = 74;
318 pub const EPROGMISMATCH: ::c_int = 75;
319 pub const EPROCUNAVAIL: ::c_int = 76;
320 pub const ENOLCK: ::c_int = 77;
321 pub const ENOSYS: ::c_int = 78;
322 pub const EFTYPE: ::c_int = 79;
323 pub const EAUTH: ::c_int = 80;
324 pub const ENEEDAUTH: ::c_int = 81;
325 pub const EIDRM: ::c_int = 82;
326 pub const ENOMSG: ::c_int = 83;
327 pub const EOVERFLOW: ::c_int = 84;
328 pub const ECANCELED: ::c_int = 85;
329 pub const EILSEQ: ::c_int = 86;
330 pub const ENOATTR: ::c_int = 87;
331 pub const EDOOFUS: ::c_int = 88;
332 pub const EBADMSG: ::c_int = 89;
333 pub const EMULTIHOP: ::c_int = 90;
334 pub const ENOLINK: ::c_int = 91;
335 pub const EPROTO: ::c_int = 92;
336
337 pub const F_DUPFD: ::c_int = 0;
338 pub const F_GETFD: ::c_int = 1;
339 pub const F_SETFD: ::c_int = 2;
340 pub const F_GETFL: ::c_int = 3;
341 pub const F_SETFL: ::c_int = 4;
342
343 pub const SIGTRAP: ::c_int = 5;
344
345 pub const GLOB_APPEND : ::c_int = 0x0001;
346 pub const GLOB_DOOFFS : ::c_int = 0x0002;
347 pub const GLOB_ERR : ::c_int = 0x0004;
348 pub const GLOB_MARK : ::c_int = 0x0008;
349 pub const GLOB_NOCHECK : ::c_int = 0x0010;
350 pub const GLOB_NOSORT : ::c_int = 0x0020;
351 pub const GLOB_NOESCAPE: ::c_int = 0x2000;
352
353 pub const GLOB_NOSPACE : ::c_int = -1;
354 pub const GLOB_ABORTED : ::c_int = -2;
355 pub const GLOB_NOMATCH : ::c_int = -3;
356
357 pub const POSIX_MADV_NORMAL: ::c_int = 0;
358 pub const POSIX_MADV_RANDOM: ::c_int = 1;
359 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
360 pub const POSIX_MADV_WILLNEED: ::c_int = 3;
361 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
362
363 pub const _SC_IOV_MAX: ::c_int = 56;
364 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70;
365 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71;
366 pub const _SC_LOGIN_NAME_MAX: ::c_int = 73;
367 pub const _SC_MQ_PRIO_MAX: ::c_int = 75;
368 pub const _SC_NPROCESSORS_ONLN: ::c_int = 58;
369 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82;
370 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83;
371 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85;
372 pub const _SC_THREAD_KEYS_MAX: ::c_int = 86;
373 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87;
374 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88;
375 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89;
376 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90;
377 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91;
378 pub const _SC_THREAD_STACK_MIN: ::c_int = 93;
379 pub const _SC_THREAD_THREADS_MAX: ::c_int = 94;
380 pub const _SC_THREADS: ::c_int = 96;
381 pub const _SC_TTY_NAME_MAX: ::c_int = 101;
382 pub const _SC_ATEXIT_MAX: ::c_int = 107;
383 pub const _SC_XOPEN_CRYPT: ::c_int = 108;
384 pub const _SC_XOPEN_ENH_I18N: ::c_int = 109;
385 pub const _SC_XOPEN_LEGACY: ::c_int = 110;
386 pub const _SC_XOPEN_REALTIME: ::c_int = 111;
387 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112;
388 pub const _SC_XOPEN_SHM: ::c_int = 113;
389 pub const _SC_XOPEN_UNIX: ::c_int = 115;
390 pub const _SC_XOPEN_VERSION: ::c_int = 116;
391 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 117;
392
393 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
394 pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
395
396 pub const RLIMIT_CPU: ::c_int = 0;
397 pub const RLIMIT_FSIZE: ::c_int = 1;
398 pub const RLIMIT_DATA: ::c_int = 2;
399 pub const RLIMIT_STACK: ::c_int = 3;
400 pub const RLIMIT_CORE: ::c_int = 4;
401 pub const RLIMIT_RSS: ::c_int = 5;
402 pub const RLIMIT_MEMLOCK: ::c_int = 6;
403 pub const RLIMIT_NPROC: ::c_int = 7;
404 pub const RLIMIT_NOFILE: ::c_int = 8;
405 pub const RLIMIT_SBSIZE: ::c_int = 9;
406 pub const RLIMIT_VMEM: ::c_int = 10;
407 pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM;
408 pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
409
410 pub const RUSAGE_SELF: ::c_int = 0;
411 pub const RUSAGE_CHILDREN: ::c_int = -1;
412
413 pub const MADV_NORMAL: ::c_int = 0;
414 pub const MADV_RANDOM: ::c_int = 1;
415 pub const MADV_SEQUENTIAL: ::c_int = 2;
416 pub const MADV_WILLNEED: ::c_int = 3;
417 pub const MADV_DONTNEED: ::c_int = 4;
418 pub const MADV_FREE: ::c_int = 5;
419 pub const MADV_NOSYNC: ::c_int = 6;
420 pub const MADV_AUTOSYNC: ::c_int = 7;
421 pub const MADV_NOCORE: ::c_int = 8;
422 pub const MADV_CORE: ::c_int = 9;
423
424 pub const MINCORE_INCORE: ::c_int = 0x1;
425 pub const MINCORE_REFERENCED: ::c_int = 0x2;
426 pub const MINCORE_MODIFIED: ::c_int = 0x4;
427 pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
428 pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
429 pub const MINCORE_SUPER: ::c_int = 0x20;
430
431 pub const AF_INET: ::c_int = 2;
432 pub const AF_INET6: ::c_int = 28;
433 pub const AF_UNIX: ::c_int = 1;
434 pub const SOCK_STREAM: ::c_int = 1;
435 pub const SOCK_DGRAM: ::c_int = 2;
436 pub const SOCK_RAW: ::c_int = 3;
437 pub const IPPROTO_TCP: ::c_int = 6;
438 pub const IPPROTO_IP: ::c_int = 0;
439 pub const IPPROTO_IPV6: ::c_int = 41;
440 pub const IP_MULTICAST_TTL: ::c_int = 10;
441 pub const IP_MULTICAST_LOOP: ::c_int = 11;
442 pub const IP_TTL: ::c_int = 4;
443 pub const IP_HDRINCL: ::c_int = 2;
444 pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
445 pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
446 pub const IPV6_JOIN_GROUP: ::c_int = 12;
447 pub const IPV6_LEAVE_GROUP: ::c_int = 13;
448
449 pub const TCP_NODELAY: ::c_int = 1;
450 pub const TCP_KEEPIDLE: ::c_int = 256;
451 pub const SOL_SOCKET: ::c_int = 0xffff;
452 pub const SO_DEBUG: ::c_int = 0x01;
453 pub const SO_ACCEPTCONN: ::c_int = 0x0002;
454 pub const SO_REUSEADDR: ::c_int = 0x0004;
455 pub const SO_KEEPALIVE: ::c_int = 0x0008;
456 pub const SO_DONTROUTE: ::c_int = 0x0010;
457 pub const SO_BROADCAST: ::c_int = 0x0020;
458 pub const SO_USELOOPBACK: ::c_int = 0x0040;
459 pub const SO_LINGER: ::c_int = 0x0080;
460 pub const SO_OOBINLINE: ::c_int = 0x0100;
461 pub const SO_REUSEPORT: ::c_int = 0x0200;
462 pub const SO_SNDBUF: ::c_int = 0x1001;
463 pub const SO_RCVBUF: ::c_int = 0x1002;
464 pub const SO_SNDLOWAT: ::c_int = 0x1003;
465 pub const SO_RCVLOWAT: ::c_int = 0x1004;
466 pub const SO_SNDTIMEO: ::c_int = 0x1005;
467 pub const SO_RCVTIMEO: ::c_int = 0x1006;
468 pub const SO_ERROR: ::c_int = 0x1007;
469 pub const SO_TYPE: ::c_int = 0x1008;
470
471 pub const IFF_LOOPBACK: ::c_int = 0x8;
472
473 pub const SHUT_RD: ::c_int = 0;
474 pub const SHUT_WR: ::c_int = 1;
475 pub const SHUT_RDWR: ::c_int = 2;
476
477 pub const LOCK_SH: ::c_int = 1;
478 pub const LOCK_EX: ::c_int = 2;
479 pub const LOCK_NB: ::c_int = 4;
480 pub const LOCK_UN: ::c_int = 8;
481
482 pub const O_SYNC: ::c_int = 128;
483 pub const O_NONBLOCK: ::c_int = 4;
484 pub const CTL_KERN: ::c_int = 1;
485 pub const KERN_PROC: ::c_int = 14;
486
487 pub const MAP_COPY: ::c_int = 0x0002;
488 pub const MAP_RENAME: ::c_int = 0x0020;
489 pub const MAP_NORESERVE: ::c_int = 0x0040;
490 pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
491 pub const MAP_STACK: ::c_int = 0x0400;
492 pub const MAP_NOSYNC: ::c_int = 0x0800;
493 pub const MAP_NOCORE: ::c_int = 0x020000;
494
495 pub const IPPROTO_RAW: ::c_int = 255;
496
497 pub const _SC_ARG_MAX: ::c_int = 1;
498 pub const _SC_CHILD_MAX: ::c_int = 2;
499 pub const _SC_CLK_TCK: ::c_int = 3;
500 pub const _SC_NGROUPS_MAX: ::c_int = 4;
501 pub const _SC_OPEN_MAX: ::c_int = 5;
502 pub const _SC_JOB_CONTROL: ::c_int = 6;
503 pub const _SC_SAVED_IDS: ::c_int = 7;
504 pub const _SC_VERSION: ::c_int = 8;
505 pub const _SC_BC_BASE_MAX: ::c_int = 9;
506 pub const _SC_BC_DIM_MAX: ::c_int = 10;
507 pub const _SC_BC_SCALE_MAX: ::c_int = 11;
508 pub const _SC_BC_STRING_MAX: ::c_int = 12;
509 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
510 pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
511 pub const _SC_LINE_MAX: ::c_int = 15;
512 pub const _SC_RE_DUP_MAX: ::c_int = 16;
513 pub const _SC_2_VERSION: ::c_int = 17;
514 pub const _SC_2_C_BIND: ::c_int = 18;
515 pub const _SC_2_C_DEV: ::c_int = 19;
516 pub const _SC_2_CHAR_TERM: ::c_int = 20;
517 pub const _SC_2_FORT_DEV: ::c_int = 21;
518 pub const _SC_2_FORT_RUN: ::c_int = 22;
519 pub const _SC_2_LOCALEDEF: ::c_int = 23;
520 pub const _SC_2_SW_DEV: ::c_int = 24;
521 pub const _SC_2_UPE: ::c_int = 25;
522 pub const _SC_STREAM_MAX: ::c_int = 26;
523 pub const _SC_TZNAME_MAX: ::c_int = 27;
524 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28;
525 pub const _SC_MAPPED_FILES: ::c_int = 29;
526 pub const _SC_MEMLOCK: ::c_int = 30;
527 pub const _SC_MEMLOCK_RANGE: ::c_int = 31;
528 pub const _SC_MEMORY_PROTECTION: ::c_int = 32;
529 pub const _SC_MESSAGE_PASSING: ::c_int = 33;
530 pub const _SC_PRIORITIZED_IO: ::c_int = 34;
531 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35;
532 pub const _SC_REALTIME_SIGNALS: ::c_int = 36;
533 pub const _SC_SEMAPHORES: ::c_int = 37;
534 pub const _SC_FSYNC: ::c_int = 38;
535 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39;
536 pub const _SC_SYNCHRONIZED_IO: ::c_int = 40;
537 pub const _SC_TIMERS: ::c_int = 41;
538 pub const _SC_AIO_LISTIO_MAX: ::c_int = 42;
539 pub const _SC_AIO_MAX: ::c_int = 43;
540 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
541 pub const _SC_DELAYTIMER_MAX: ::c_int = 45;
542 pub const _SC_MQ_OPEN_MAX: ::c_int = 46;
543 pub const _SC_PAGESIZE: ::c_int = 47;
544 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
545 pub const _SC_RTSIG_MAX: ::c_int = 48;
546 pub const _SC_SEM_NSEMS_MAX: ::c_int = 49;
547 pub const _SC_SEM_VALUE_MAX: ::c_int = 50;
548 pub const _SC_SIGQUEUE_MAX: ::c_int = 51;
549 pub const _SC_TIMER_MAX: ::c_int = 52;
550
551 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;
552 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _;
553 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _;
554 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
555
556 pub const SCHED_FIFO: ::c_int = 1;
557 pub const SCHED_OTHER: ::c_int = 2;
558 pub const SCHED_RR: ::c_int = 3;
559
560 pub const FD_SETSIZE: usize = 1024;
561
562 pub const ST_NOSUID: ::c_ulong = 2;
563
564 pub const NI_MAXHOST: ::size_t = 1025;
565
566 pub const RTLD_LOCAL: ::c_int = 0;
567 pub const RTLD_NODELETE: ::c_int = 0x1000;
568 pub const RTLD_NOLOAD: ::c_int = 0x2000;
569 pub const RTLD_GLOBAL: ::c_int = 0x100;
570
571 #[link(name = "util")]
572 extern {
573 pub fn getnameinfo(sa: *const ::sockaddr,
574 salen: ::socklen_t,
575 host: *mut ::c_char,
576 hostlen: ::size_t,
577 serv: *mut ::c_char,
578 servlen: ::size_t,
579 flags: ::c_int) -> ::c_int;
580 pub fn mincore(addr: *const ::c_void, len: ::size_t,
581 vec: *mut ::c_char) -> ::c_int;
582 pub fn sysctlnametomib(name: *const ::c_char,
583 mibp: *mut ::c_int,
584 sizep: *mut ::size_t)
585 -> ::c_int;
586 pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t)
587 -> ::c_int;
588 pub fn sysctl(name: *const ::c_int,
589 namelen: ::c_uint,
590 oldp: *mut ::c_void,
591 oldlenp: *mut ::size_t,
592 newp: *const ::c_void,
593 newlen: ::size_t)
594 -> ::c_int;
595 pub fn sysctlbyname(name: *const ::c_char,
596 oldp: *mut ::c_void,
597 oldlenp: *mut ::size_t,
598 newp: *const ::c_void,
599 newlen: ::size_t)
600 -> ::c_int;
601 pub fn sched_setscheduler(pid: ::pid_t,
602 policy: ::c_int,
603 param: *const sched_param) -> ::c_int;
604 pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
605 pub fn memrchr(cx: *const ::c_void,
606 c: ::c_int,
607 n: ::size_t) -> *mut ::c_void;
608 pub fn sendfile(fd: ::c_int,
609 s: ::c_int,
610 offset: ::off_t,
611 nbytes: ::size_t,
612 hdtr: *mut ::sf_hdtr,
613 sbytes: *mut ::off_t,
614 flags: ::c_int) -> ::c_int;
615 pub fn sigtimedwait(set: *const sigset_t,
616 info: *mut siginfo_t,
617 timeout: *const ::timespec) -> ::c_int;
618 pub fn sigwaitinfo(set: *const sigset_t,
619 info: *mut siginfo_t) -> ::c_int;
620 pub fn openpty(amaster: *mut ::c_int,
621 aslave: *mut ::c_int,
622 name: *mut ::c_char,
623 termp: *mut termios,
624 winp: *mut ::winsize) -> ::c_int;
625 pub fn forkpty(amaster: *mut ::c_int,
626 name: *mut ::c_char,
627 termp: *mut termios,
628 winp: *mut ::winsize) -> ::pid_t;
629
630 pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
631 pub fn pthread_attr_get_np(tid: ::pthread_t,
632 attr: *mut ::pthread_attr_t) -> ::c_int;
633 pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
634 guardsize: *mut ::size_t) -> ::c_int;
635 pub fn pthread_attr_getstack(attr: *const ::pthread_attr_t,
636 stackaddr: *mut *mut ::c_void,
637 stacksize: *mut ::size_t) -> ::c_int;
638 }
639
640 cfg_if! {
641 if #[cfg(target_os = "freebsd")] {
642 mod freebsd;
643 pub use self::freebsd::*;
644 } else if #[cfg(target_os = "dragonfly")] {
645 mod dragonfly;
646 pub use self::dragonfly::*;
647 } else {
648 // ...
649 }
650 }