1 pub type fflags_t = u32;
2 pub type clock_t = i32;
3 pub type ino_t = u32;
4 pub type lwpid_t = i32;
5 pub type nlink_t = u16;
6 pub type blksize_t = i32;
7 pub type clockid_t = ::c_int;
8 pub type sem_t = _sem;
9 
10 pub type fsblkcnt_t = ::uint64_t;
11 pub type fsfilcnt_t = ::uint64_t;
12 pub type idtype_t = ::c_uint;
13 
14 pub type key_t = ::c_long;
15 pub type msglen_t = ::c_ulong;
16 pub type msgqnum_t = ::c_ulong;
17 
18 pub type posix_spawnattr_t = *mut ::c_void;
19 pub type posix_spawn_file_actions_t = *mut ::c_void;
20 
21 s! {
22     pub struct aiocb {
23         pub aio_fildes: ::c_int,
24         pub aio_offset: ::off_t,
25         pub aio_buf: *mut ::c_void,
26         pub aio_nbytes: ::size_t,
27         __unused1: [::c_int; 2],
28         __unused2: *mut ::c_void,
29         pub aio_lio_opcode: ::c_int,
30         pub aio_reqprio: ::c_int,
31         // unused 3 through 5 are the __aiocb_private structure
32         __unused3: ::c_long,
33         __unused4: ::c_long,
34         __unused5: *mut ::c_void,
35         pub aio_sigevent: sigevent
36     }
37 
38     pub struct jail {
39         pub version: u32,
40         pub path: *mut ::c_char,
41         pub hostname: *mut ::c_char,
42         pub jailname: *mut ::c_char,
43         pub ip4s: ::c_uint,
44         pub ip6s: ::c_uint,
45         pub ip4: *mut ::in_addr,
46         pub ip6: *mut ::in6_addr,
47     }
48 
49     pub struct mq_attr {
50         pub mq_flags: ::c_long,
51         pub mq_maxmsg: ::c_long,
52         pub mq_msgsize: ::c_long,
53         pub mq_curmsgs: ::c_long,
54         __reserved: [::c_long; 4]
55     }
56 
57     pub struct sigevent {
58         pub sigev_notify: ::c_int,
59         pub sigev_signo: ::c_int,
60         pub sigev_value: ::sigval,
61         //The rest of the structure is actually a union.  We expose only
62         //sigev_notify_thread_id because it's the most useful union member.
63         pub sigev_notify_thread_id: ::lwpid_t,
64         #[cfg(target_pointer_width = "64")]
65         __unused1: ::c_int,
66         __unused2: [::c_long; 7]
67     }
68 
69     pub struct statvfs {
70         pub f_bavail: ::fsblkcnt_t,
71         pub f_bfree: ::fsblkcnt_t,
72         pub f_blocks: ::fsblkcnt_t,
73         pub f_favail: ::fsfilcnt_t,
74         pub f_ffree: ::fsfilcnt_t,
75         pub f_files: ::fsfilcnt_t,
76         pub f_bsize: ::c_ulong,
77         pub f_flag: ::c_ulong,
78         pub f_frsize: ::c_ulong,
79         pub f_fsid: ::c_ulong,
80         pub f_namemax: ::c_ulong,
81     }
82 
83     // internal structure has changed over time
84     pub struct _sem {
85         data: [u32; 4],
86     }
87 
88     pub struct ipc_perm {
89         pub cuid: ::uid_t,
90         pub cgid: ::gid_t,
91         pub uid: ::uid_t,
92         pub gid: ::gid_t,
93         pub mode: ::mode_t,
94         pub seq: ::c_ushort,
95         pub key: ::key_t,
96     }
97 
98     pub struct msqid_ds {
99         pub msg_perm: ::ipc_perm,
100         __unused1: *mut ::c_void,
101         __unused2: *mut ::c_void,
102         pub msg_cbytes: ::msglen_t,
103         pub msg_qnum: ::msgqnum_t,
104         pub msg_qbytes: ::msglen_t,
105         pub msg_lspid: ::pid_t,
106         pub msg_lrpid: ::pid_t,
107         pub msg_stime: ::time_t,
108         pub msg_rtime: ::time_t,
109         pub msg_ctime: ::time_t,
110     }
111 
112     pub struct shmid_ds {
113         pub shm_perm: ::ipc_perm,
114         pub shm_segsz: ::size_t,
115         pub shm_lpid: ::pid_t,
116         pub shm_cpid: ::pid_t,
117         pub shm_nattch: ::c_int,
118         pub shm_atime: ::time_t,
119         pub shm_dtime: ::time_t,
120         pub shm_ctime: ::time_t,
121     }
122 
123     pub struct xucred {
124         pub cr_version: ::c_uint,
125         pub cr_uid: ::uid_t,
126         pub cr_ngroups: ::c_short,
127         pub cr_groups: [::gid_t;16],
128         __cr_unused1: *mut ::c_void,
129     }
130 
131     pub struct stack_t {
132         pub ss_sp: *mut ::c_void,
133         pub ss_size: ::size_t,
134         pub ss_flags: ::c_int,
135     }
136 
137     pub struct mmsghdr {
138         pub msg_hdr: ::msghdr,
139         pub msg_len: ::ssize_t,
140     }
141 }
142 
143 s_no_extra_traits! {
144     #[allow(missing_debug_implementations)]
145     pub struct utmpx {
146         pub ut_type: ::c_short,
147         pub ut_tv: ::timeval,
148         pub ut_id: [::c_char; 8],
149         pub ut_pid: ::pid_t,
150         pub ut_user: [::c_char; 32],
151         pub ut_line: [::c_char; 16],
152         pub ut_host: [::c_char; 128],
153         pub __ut_spare: [::c_char; 64],
154     }
155 
156     #[allow(missing_debug_implementations)]
157     pub struct dirent {
158         pub d_fileno: u32,
159         pub d_reclen: u16,
160         pub d_type: u8,
161         pub d_namlen: u8,
162         pub d_name: [::c_char; 256],
163     }
164 
165     #[allow(missing_debug_implementations)]
166     pub struct statfs {
167         pub f_version: ::uint32_t,
168         pub f_type: ::uint32_t,
169         pub f_flags: ::uint64_t,
170         pub f_bsize: ::uint64_t,
171         pub f_iosize: ::uint64_t,
172         pub f_blocks: ::uint64_t,
173         pub f_bfree: ::uint64_t,
174         pub f_bavail: ::int64_t,
175         pub f_files: ::uint64_t,
176         pub f_ffree: ::int64_t,
177         pub f_syncwrites: ::uint64_t,
178         pub f_asyncwrites: ::uint64_t,
179         pub f_syncreads: ::uint64_t,
180         pub f_asyncreads: ::uint64_t,
181         f_spare: [::uint64_t; 10],
182         pub f_namemax: ::uint32_t,
183         pub f_owner: ::uid_t,
184         pub f_fsid: ::fsid_t,
185         f_charspare: [::c_char; 80],
186         pub f_fstypename: [::c_char; 16],
187         pub f_mntfromname: [::c_char; 88],
188         pub f_mntonname: [::c_char; 88],
189     }
190 
191     #[allow(missing_debug_implementations)]
192     pub struct sockaddr_dl {
193         pub sdl_len: ::c_uchar,
194         pub sdl_family: ::c_uchar,
195         pub sdl_index: ::c_ushort,
196         pub sdl_type: ::c_uchar,
197         pub sdl_nlen: ::c_uchar,
198         pub sdl_alen: ::c_uchar,
199         pub sdl_slen: ::c_uchar,
200         pub sdl_data: [::c_char; 46],
201     }
202 }
203 
204 pub const SIGEV_THREAD_ID: ::c_int = 4;
205 
206 pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0;
207 pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
208 pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
209 
210 pub const RAND_MAX: ::c_int = 0x7fff_fffd;
211 pub const PTHREAD_STACK_MIN: ::size_t = 2048;
212 pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4;
213 pub const SIGSTKSZ: ::size_t = 34816;
214 pub const SF_NODISKIO: ::c_int = 0x00000001;
215 pub const SF_MNOWAIT: ::c_int = 0x00000002;
216 pub const SF_SYNC: ::c_int = 0x00000004;
217 pub const SF_USER_READAHEAD: ::c_int = 0x00000008;
218 pub const SF_NOCACHE: ::c_int = 0x00000010;
219 pub const O_CLOEXEC: ::c_int = 0x00100000;
220 pub const O_DIRECTORY: ::c_int = 0x00020000;
221 pub const O_EXEC: ::c_int = 0x00040000;
222 pub const O_TTY_INIT: ::c_int = 0x00080000;
223 pub const F_GETLK: ::c_int = 11;
224 pub const F_SETLK: ::c_int = 12;
225 pub const F_SETLKW: ::c_int = 13;
226 pub const ENOTCAPABLE: ::c_int = 93;
227 pub const ECAPMODE: ::c_int = 94;
228 pub const ENOTRECOVERABLE: ::c_int = 95;
229 pub const EOWNERDEAD: ::c_int = 96;
230 pub const ELAST: ::c_int = 96;
231 pub const RLIMIT_NPTS: ::c_int = 11;
232 pub const RLIMIT_SWAP: ::c_int = 12;
233 pub const RLIMIT_KQUEUES: ::c_int = 13;
234 pub const RLIMIT_UMTXP: ::c_int = 14;
235 pub const RLIM_NLIMITS: ::rlim_t = 15;
236 
237 pub const Q_GETQUOTA: ::c_int = 0x700;
238 pub const Q_SETQUOTA: ::c_int = 0x800;
239 
240 pub const POSIX_FADV_NORMAL: ::c_int = 0;
241 pub const POSIX_FADV_RANDOM: ::c_int = 1;
242 pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
243 pub const POSIX_FADV_WILLNEED: ::c_int = 3;
244 pub const POSIX_FADV_DONTNEED: ::c_int = 4;
245 pub const POSIX_FADV_NOREUSE: ::c_int = 5;
246 
247 pub const POLLINIGNEOF: ::c_short = 0x2000;
248 
249 pub const EVFILT_READ: ::int16_t = -1;
250 pub const EVFILT_WRITE: ::int16_t = -2;
251 pub const EVFILT_AIO: ::int16_t = -3;
252 pub const EVFILT_VNODE: ::int16_t = -4;
253 pub const EVFILT_PROC: ::int16_t = -5;
254 pub const EVFILT_SIGNAL: ::int16_t = -6;
255 pub const EVFILT_TIMER: ::int16_t = -7;
256 pub const EVFILT_PROCDESC: ::int16_t = -8;
257 pub const EVFILT_FS: ::int16_t = -9;
258 pub const EVFILT_LIO: ::int16_t = -10;
259 pub const EVFILT_USER: ::int16_t = -11;
260 pub const EVFILT_SENDFILE: ::int16_t = -12;
261 pub const EVFILT_EMPTY: ::int16_t = -13;
262 
263 pub const EV_ADD: ::uint16_t = 0x1;
264 pub const EV_DELETE: ::uint16_t = 0x2;
265 pub const EV_ENABLE: ::uint16_t = 0x4;
266 pub const EV_DISABLE: ::uint16_t = 0x8;
267 pub const EV_ONESHOT: ::uint16_t = 0x10;
268 pub const EV_CLEAR: ::uint16_t = 0x20;
269 pub const EV_RECEIPT: ::uint16_t = 0x40;
270 pub const EV_DISPATCH: ::uint16_t = 0x80;
271 pub const EV_DROP: ::uint16_t = 0x1000;
272 pub const EV_FLAG1: ::uint16_t = 0x2000;
273 pub const EV_ERROR: ::uint16_t = 0x4000;
274 pub const EV_EOF: ::uint16_t = 0x8000;
275 pub const EV_SYSFLAGS: ::uint16_t = 0xf000;
276 
277 pub const NOTE_TRIGGER: ::uint32_t = 0x01000000;
278 pub const NOTE_FFNOP: ::uint32_t = 0x00000000;
279 pub const NOTE_FFAND: ::uint32_t = 0x40000000;
280 pub const NOTE_FFOR: ::uint32_t = 0x80000000;
281 pub const NOTE_FFCOPY: ::uint32_t = 0xc0000000;
282 pub const NOTE_FFCTRLMASK: ::uint32_t = 0xc0000000;
283 pub const NOTE_FFLAGSMASK: ::uint32_t = 0x00ffffff;
284 pub const NOTE_LOWAT: ::uint32_t = 0x00000001;
285 pub const NOTE_DELETE: ::uint32_t = 0x00000001;
286 pub const NOTE_WRITE: ::uint32_t = 0x00000002;
287 pub const NOTE_EXTEND: ::uint32_t = 0x00000004;
288 pub const NOTE_ATTRIB: ::uint32_t = 0x00000008;
289 pub const NOTE_LINK: ::uint32_t = 0x00000010;
290 pub const NOTE_RENAME: ::uint32_t = 0x00000020;
291 pub const NOTE_REVOKE: ::uint32_t = 0x00000040;
292 pub const NOTE_EXIT: ::uint32_t = 0x80000000;
293 pub const NOTE_FORK: ::uint32_t = 0x40000000;
294 pub const NOTE_EXEC: ::uint32_t = 0x20000000;
295 pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff;
296 pub const NOTE_PCTRLMASK: ::uint32_t = 0xf0000000;
297 pub const NOTE_TRACK: ::uint32_t = 0x00000001;
298 pub const NOTE_TRACKERR: ::uint32_t = 0x00000002;
299 pub const NOTE_CHILD: ::uint32_t = 0x00000004;
300 pub const NOTE_SECONDS: ::uint32_t = 0x00000001;
301 pub const NOTE_MSECONDS: ::uint32_t = 0x00000002;
302 pub const NOTE_USECONDS: ::uint32_t = 0x00000004;
303 pub const NOTE_NSECONDS: ::uint32_t = 0x00000008;
304 
305 pub const MADV_PROTECT: ::c_int = 10;
306 pub const RUSAGE_THREAD: ::c_int = 1;
307 
308 pub const CLOCK_REALTIME: ::clockid_t = 0;
309 pub const CLOCK_VIRTUAL: ::clockid_t = 1;
310 pub const CLOCK_PROF: ::clockid_t = 2;
311 pub const CLOCK_MONOTONIC: ::clockid_t = 4;
312 pub const CLOCK_UPTIME: ::clockid_t = 5;
313 pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7;
314 pub const CLOCK_UPTIME_FAST: ::clockid_t = 8;
315 pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9;
316 pub const CLOCK_REALTIME_FAST: ::clockid_t = 10;
317 pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11;
318 pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12;
319 pub const CLOCK_SECOND: ::clockid_t = 13;
320 pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14;
321 pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15;
322 
323 pub const CTL_UNSPEC: ::c_int = 0;
324 pub const CTL_KERN: ::c_int = 1;
325 pub const CTL_VM: ::c_int = 2;
326 pub const CTL_VFS: ::c_int = 3;
327 pub const CTL_NET: ::c_int = 4;
328 pub const CTL_DEBUG: ::c_int = 5;
329 pub const CTL_HW: ::c_int = 6;
330 pub const CTL_MACHDEP: ::c_int = 7;
331 pub const CTL_USER: ::c_int = 8;
332 pub const CTL_P1003_1B: ::c_int = 9;
333 pub const KERN_OSTYPE: ::c_int = 1;
334 pub const KERN_OSRELEASE: ::c_int = 2;
335 pub const KERN_OSREV: ::c_int = 3;
336 pub const KERN_VERSION: ::c_int = 4;
337 pub const KERN_MAXVNODES: ::c_int = 5;
338 pub const KERN_MAXPROC: ::c_int = 6;
339 pub const KERN_MAXFILES: ::c_int = 7;
340 pub const KERN_ARGMAX: ::c_int = 8;
341 pub const KERN_SECURELVL: ::c_int = 9;
342 pub const KERN_HOSTNAME: ::c_int = 10;
343 pub const KERN_HOSTID: ::c_int = 11;
344 pub const KERN_CLOCKRATE: ::c_int = 12;
345 pub const KERN_VNODE: ::c_int = 13;
346 pub const KERN_PROC: ::c_int = 14;
347 pub const KERN_FILE: ::c_int = 15;
348 pub const KERN_PROF: ::c_int = 16;
349 pub const KERN_POSIX1: ::c_int = 17;
350 pub const KERN_NGROUPS: ::c_int = 18;
351 pub const KERN_JOB_CONTROL: ::c_int = 19;
352 pub const KERN_SAVED_IDS: ::c_int = 20;
353 pub const KERN_BOOTTIME: ::c_int = 21;
354 pub const KERN_NISDOMAINNAME: ::c_int = 22;
355 pub const KERN_UPDATEINTERVAL: ::c_int = 23;
356 pub const KERN_OSRELDATE: ::c_int = 24;
357 pub const KERN_NTP_PLL: ::c_int = 25;
358 pub const KERN_BOOTFILE: ::c_int = 26;
359 pub const KERN_MAXFILESPERPROC: ::c_int = 27;
360 pub const KERN_MAXPROCPERUID: ::c_int = 28;
361 pub const KERN_DUMPDEV: ::c_int = 29;
362 pub const KERN_IPC: ::c_int = 30;
363 pub const KERN_DUMMY: ::c_int = 31;
364 pub const KERN_PS_STRINGS: ::c_int = 32;
365 pub const KERN_USRSTACK: ::c_int = 33;
366 pub const KERN_LOGSIGEXIT: ::c_int = 34;
367 pub const KERN_IOV_MAX: ::c_int = 35;
368 pub const KERN_HOSTUUID: ::c_int = 36;
369 pub const KERN_ARND: ::c_int = 37;
370 pub const KERN_PROC_ALL: ::c_int = 0;
371 pub const KERN_PROC_PID: ::c_int = 1;
372 pub const KERN_PROC_PGRP: ::c_int = 2;
373 pub const KERN_PROC_SESSION: ::c_int = 3;
374 pub const KERN_PROC_TTY: ::c_int = 4;
375 pub const KERN_PROC_UID: ::c_int = 5;
376 pub const KERN_PROC_RUID: ::c_int = 6;
377 pub const KERN_PROC_ARGS: ::c_int = 7;
378 pub const KERN_PROC_PROC: ::c_int = 8;
379 pub const KERN_PROC_SV_NAME: ::c_int = 9;
380 pub const KERN_PROC_RGID: ::c_int = 10;
381 pub const KERN_PROC_GID: ::c_int = 11;
382 pub const KERN_PROC_PATHNAME: ::c_int = 12;
383 pub const KERN_PROC_OVMMAP: ::c_int = 13;
384 pub const KERN_PROC_OFILEDESC: ::c_int = 14;
385 pub const KERN_PROC_KSTACK: ::c_int = 15;
386 pub const KERN_PROC_INC_THREAD: ::c_int = 0x10;
387 pub const KERN_PROC_VMMAP: ::c_int = 32;
388 pub const KERN_PROC_FILEDESC: ::c_int = 33;
389 pub const KERN_PROC_GROUPS: ::c_int = 34;
390 pub const KERN_PROC_ENV: ::c_int = 35;
391 pub const KERN_PROC_AUXV: ::c_int = 36;
392 pub const KERN_PROC_RLIMIT: ::c_int = 37;
393 pub const KERN_PROC_PS_STRINGS: ::c_int = 38;
394 pub const KERN_PROC_UMASK: ::c_int = 39;
395 pub const KERN_PROC_OSREL: ::c_int = 40;
396 pub const KERN_PROC_SIGTRAMP: ::c_int = 41;
397 pub const KIPC_MAXSOCKBUF: ::c_int = 1;
398 pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
399 pub const KIPC_SOMAXCONN: ::c_int = 3;
400 pub const KIPC_MAX_LINKHDR: ::c_int = 4;
401 pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
402 pub const KIPC_MAX_HDR: ::c_int = 6;
403 pub const KIPC_MAX_DATALEN: ::c_int = 7;
404 pub const HW_MACHINE: ::c_int = 1;
405 pub const HW_MODEL: ::c_int = 2;
406 pub const HW_NCPU: ::c_int = 3;
407 pub const HW_BYTEORDER: ::c_int = 4;
408 pub const HW_PHYSMEM: ::c_int = 5;
409 pub const HW_USERMEM: ::c_int = 6;
410 pub const HW_PAGESIZE: ::c_int = 7;
411 pub const HW_DISKNAMES: ::c_int = 8;
412 pub const HW_DISKSTATS: ::c_int = 9;
413 pub const HW_FLOATINGPT: ::c_int = 10;
414 pub const HW_MACHINE_ARCH: ::c_int = 11;
415 pub const HW_REALMEM: ::c_int = 12;
416 pub const USER_CS_PATH: ::c_int = 1;
417 pub const USER_BC_BASE_MAX: ::c_int = 2;
418 pub const USER_BC_DIM_MAX: ::c_int = 3;
419 pub const USER_BC_SCALE_MAX: ::c_int = 4;
420 pub const USER_BC_STRING_MAX: ::c_int = 5;
421 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
422 pub const USER_EXPR_NEST_MAX: ::c_int = 7;
423 pub const USER_LINE_MAX: ::c_int = 8;
424 pub const USER_RE_DUP_MAX: ::c_int = 9;
425 pub const USER_POSIX2_VERSION: ::c_int = 10;
426 pub const USER_POSIX2_C_BIND: ::c_int = 11;
427 pub const USER_POSIX2_C_DEV: ::c_int = 12;
428 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
429 pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
430 pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
431 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
432 pub const USER_POSIX2_SW_DEV: ::c_int = 17;
433 pub const USER_POSIX2_UPE: ::c_int = 18;
434 pub const USER_STREAM_MAX: ::c_int = 19;
435 pub const USER_TZNAME_MAX: ::c_int = 20;
436 pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
437 pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
438 pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
439 pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4;
440 pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5;
441 pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6;
442 pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7;
443 pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8;
444 pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9;
445 pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10;
446 pub const CTL_P1003_1B_FSYNC: ::c_int = 11;
447 pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12;
448 pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13;
449 pub const CTL_P1003_1B_TIMERS: ::c_int = 14;
450 pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15;
451 pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16;
452 pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17;
453 pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18;
454 pub const CTL_P1003_1B_MQ_OPEN_MAX: ::c_int = 19;
455 pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20;
456 pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21;
457 pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
458 pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
459 pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
460 pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
461 pub const TIOCGPTN: ::c_uint = 0x4004740f;
462 pub const TIOCPTMASTER: ::c_uint = 0x2000741c;
463 pub const TIOCSIG: ::c_uint = 0x2004745f;
464 pub const TIOCM_DCD: ::c_int = 0x40;
465 pub const H4DISC: ::c_int = 0x7;
466 
467 pub const FIONCLEX: ::c_ulong = 0x20006602;
468 pub const FIONREAD: ::c_ulong = 0x4004667f;
469 pub const FIOASYNC: ::c_ulong = 0x8004667d;
470 pub const FIOSETOWN: ::c_ulong = 0x8004667c;
471 pub const FIOGETOWN: ::c_ulong = 0x4004667b;
472 pub const FIODTYPE: ::c_ulong = 0x4004667a;
473 pub const FIOGETLBA: ::c_ulong = 0x40046679;
474 pub const FIODGNAME: ::c_ulong = 0x80106678;
475 pub const FIONWRITE: ::c_ulong = 0x40046677;
476 pub const FIONSPACE: ::c_ulong = 0x40046676;
477 pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;
478 pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662;
479 
480 pub const JAIL_API_VERSION: u32 = 2;
481 pub const JAIL_CREATE: ::c_int = 0x01;
482 pub const JAIL_UPDATE: ::c_int = 0x02;
483 pub const JAIL_ATTACH: ::c_int = 0x04;
484 pub const JAIL_DYING: ::c_int = 0x08;
485 pub const JAIL_SET_MASK: ::c_int = 0x0f;
486 pub const JAIL_GET_MASK: ::c_int = 0x08;
487 pub const JAIL_SYS_DISABLE: ::c_int = 0;
488 pub const JAIL_SYS_NEW: ::c_int = 1;
489 pub const JAIL_SYS_INHERIT: ::c_int = 2;
490 
491 pub const SO_BINTIME: ::c_int = 0x2000;
492 pub const SO_NO_OFFLOAD: ::c_int = 0x4000;
493 pub const SO_NO_DDP: ::c_int = 0x8000;
494 pub const SO_REUSEPORT_LB: ::c_int = 0x10000;
495 pub const SO_LABEL: ::c_int = 0x1009;
496 pub const SO_PEERLABEL: ::c_int = 0x1010;
497 pub const SO_LISTENQLIMIT: ::c_int = 0x1011;
498 pub const SO_LISTENQLEN: ::c_int = 0x1012;
499 pub const SO_LISTENINCQLEN: ::c_int = 0x1013;
500 pub const SO_SETFIB: ::c_int = 0x1014;
501 pub const SO_USER_COOKIE: ::c_int = 0x1015;
502 pub const SO_PROTOCOL: ::c_int = 0x1016;
503 pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL;
504 pub const SO_VENDOR: ::c_int = 0x80000000;
505 
506 pub const LOCAL_PEERCRED: ::c_int = 1;
507 pub const LOCAL_CREDS: ::c_int = 2;
508 pub const LOCAL_CONNWAIT: ::c_int = 4;
509 pub const LOCAL_VENDOR: ::c_int = SO_VENDOR;
510 
511 pub const PT_LWPINFO: ::c_int = 13;
512 pub const PT_GETNUMLWPS: ::c_int = 14;
513 pub const PT_GETLWPLIST: ::c_int = 15;
514 pub const PT_CLEARSTEP: ::c_int = 16;
515 pub const PT_SETSTEP: ::c_int = 17;
516 pub const PT_SUSPEND: ::c_int = 18;
517 pub const PT_RESUME: ::c_int = 19;
518 pub const PT_TO_SCE: ::c_int = 20;
519 pub const PT_TO_SCX: ::c_int = 21;
520 pub const PT_SYSCALL: ::c_int = 22;
521 pub const PT_FOLLOW_FORK: ::c_int = 23;
522 pub const PT_LWP_EVENTS: ::c_int = 24;
523 pub const PT_GET_EVENT_MASK: ::c_int = 25;
524 pub const PT_SET_EVENT_MASK: ::c_int = 26;
525 pub const PT_GETREGS: ::c_int = 33;
526 pub const PT_SETREGS: ::c_int = 34;
527 pub const PT_GETFPREGS: ::c_int = 35;
528 pub const PT_SETFPREGS: ::c_int = 36;
529 pub const PT_GETDBREGS: ::c_int = 37;
530 pub const PT_SETDBREGS: ::c_int = 38;
531 pub const PT_VM_TIMESTAMP: ::c_int = 40;
532 pub const PT_VM_ENTRY: ::c_int = 41;
533 pub const PT_FIRSTMACH: ::c_int = 64;
534 
535 pub const PTRACE_EXEC: ::c_int = 0x0001;
536 pub const PTRACE_SCE: ::c_int = 0x0002;
537 pub const PTRACE_SCX: ::c_int = 0x0004;
538 pub const PTRACE_SYSCALL: ::c_int = PTRACE_SCE | PTRACE_SCX;
539 pub const PTRACE_FORK: ::c_int = 0x0008;
540 pub const PTRACE_LWP: ::c_int = 0x0010;
541 pub const PTRACE_VFORK: ::c_int = 0x0020;
542 pub const PTRACE_DEFAULT: ::c_int = PTRACE_EXEC;
543 
544 pub const AF_SLOW: ::c_int = 33;
545 pub const AF_SCLUSTER: ::c_int = 34;
546 pub const AF_ARP: ::c_int = 35;
547 pub const AF_BLUETOOTH: ::c_int = 36;
548 pub const AF_IEEE80211: ::c_int = 37;
549 pub const AF_INET_SDP: ::c_int = 40;
550 pub const AF_INET6_SDP: ::c_int = 42;
551 #[doc(hidden)]
552 pub const AF_MAX: ::c_int = 42;
553 
554 // https://github.com/freebsd/freebsd/blob/master/sys/net/if.h#L140
555 pub const IFF_UP: ::c_int = 0x1; // (n) interface is up
556 pub const IFF_BROADCAST: ::c_int = 0x2; // (i) broadcast address valid
557 pub const IFF_DEBUG: ::c_int = 0x4; // (n) turn on debugging
558 pub const IFF_LOOPBACK: ::c_int = 0x8; // (i) is a loopback net
559 pub const IFF_POINTOPOINT: ::c_int = 0x10; // (i) is a point-to-point link
560 // 0x20           was IFF_SMART
561 pub const IFF_RUNNING: ::c_int = 0x40; // (d) resources allocated
562 #[doc(hidden)]
563 // IFF_DRV_RUNNING is deprecated.  Use the portable `IFF_RUNNING` instead
564 pub const IFF_DRV_RUNNING: ::c_int = 0x40;
565 pub const IFF_NOARP: ::c_int = 0x80; // (n) no address resolution protocol
566 pub const IFF_PROMISC: ::c_int = 0x100; // (n) receive all packets
567 pub const IFF_ALLMULTI: ::c_int = 0x200; // (n) receive all multicast packets
568 pub const IFF_OACTIVE: ::c_int = 0x400; // (d) tx hardware queue is full
569 #[doc(hidden)]
570 // IFF_DRV_OACTIVE is deprecated.  Use the portable `IFF_OACTIVE` instead
571 pub const IFF_DRV_OACTIVE: ::c_int = 0x400;
572 pub const IFF_SIMPLEX: ::c_int = 0x800; // (i) can't hear own transmissions
573 pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
574 pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
575 pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
576 pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
577 pub const IFF_MULTICAST: ::c_int = 0x8000; // (i) supports multicast
578 // (i) unconfigurable using ioctl(2)
579 pub const IFF_CANTCONFIG: ::c_int = 0x10000;
580 pub const IFF_PPROMISC: ::c_int = 0x20000; // (n) user-requested promisc mode
581 pub const IFF_MONITOR: ::c_int = 0x40000; // (n) user-requested monitor mode
582 pub const IFF_STATICARP: ::c_int = 0x80000; // (n) static ARP
583 pub const IFF_DYING: ::c_int = 0x200000; // (n) interface is winding down
584 pub const IFF_RENAMING: ::c_int = 0x400000; // (n) interface is being renamed
585 
586 // sys/netinet/in.h
587 // Protocols (RFC 1700)
588 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
589 
590 // IPPROTO_IP defined in src/unix/mod.rs
591 /// IP6 hop-by-hop options
592 pub const IPPROTO_HOPOPTS: ::c_int = 0;
593 // IPPROTO_ICMP defined in src/unix/mod.rs
594 /// group mgmt protocol
595 pub const IPPROTO_IGMP: ::c_int = 2;
596 /// gateway^2 (deprecated)
597 pub const IPPROTO_GGP: ::c_int = 3;
598 /// for compatibility
599 pub const IPPROTO_IPIP: ::c_int = 4;
600 // IPPROTO_TCP defined in src/unix/mod.rs
601 /// Stream protocol II.
602 pub const IPPROTO_ST: ::c_int = 7;
603 /// exterior gateway protocol
604 pub const IPPROTO_EGP: ::c_int = 8;
605 /// private interior gateway
606 pub const IPPROTO_PIGP: ::c_int = 9;
607 /// BBN RCC Monitoring
608 pub const IPPROTO_RCCMON: ::c_int = 10;
609 /// network voice protocol
610 pub const IPPROTO_NVPII: ::c_int = 11;
611 /// pup
612 pub const IPPROTO_PUP: ::c_int = 12;
613 /// Argus
614 pub const IPPROTO_ARGUS: ::c_int = 13;
615 /// EMCON
616 pub const IPPROTO_EMCON: ::c_int = 14;
617 /// Cross Net Debugger
618 pub const IPPROTO_XNET: ::c_int = 15;
619 /// Chaos
620 pub const IPPROTO_CHAOS: ::c_int = 16;
621 // IPPROTO_UDP defined in src/unix/mod.rs
622 /// Multiplexing
623 pub const IPPROTO_MUX: ::c_int = 18;
624 /// DCN Measurement Subsystems
625 pub const IPPROTO_MEAS: ::c_int = 19;
626 /// Host Monitoring
627 pub const IPPROTO_HMP: ::c_int = 20;
628 /// Packet Radio Measurement
629 pub const IPPROTO_PRM: ::c_int = 21;
630 /// xns idp
631 pub const IPPROTO_IDP: ::c_int = 22;
632 /// Trunk-1
633 pub const IPPROTO_TRUNK1: ::c_int = 23;
634 /// Trunk-2
635 pub const IPPROTO_TRUNK2: ::c_int = 24;
636 /// Leaf-1
637 pub const IPPROTO_LEAF1: ::c_int = 25;
638 /// Leaf-2
639 pub const IPPROTO_LEAF2: ::c_int = 26;
640 /// Reliable Data
641 pub const IPPROTO_RDP: ::c_int = 27;
642 /// Reliable Transaction
643 pub const IPPROTO_IRTP: ::c_int = 28;
644 /// tp-4 w/ class negotiation
645 pub const IPPROTO_TP: ::c_int = 29;
646 /// Bulk Data Transfer
647 pub const IPPROTO_BLT: ::c_int = 30;
648 /// Network Services
649 pub const IPPROTO_NSP: ::c_int = 31;
650 /// Merit Internodal
651 pub const IPPROTO_INP: ::c_int = 32;
652 /// Sequential Exchange
653 pub const IPPROTO_SEP: ::c_int = 33;
654 /// Third Party Connect
655 pub const IPPROTO_3PC: ::c_int = 34;
656 /// InterDomain Policy Routing
657 pub const IPPROTO_IDPR: ::c_int = 35;
658 /// XTP
659 pub const IPPROTO_XTP: ::c_int = 36;
660 /// Datagram Delivery
661 pub const IPPROTO_DDP: ::c_int = 37;
662 /// Control Message Transport
663 pub const IPPROTO_CMTP: ::c_int = 38;
664 /// TP++ Transport
665 pub const IPPROTO_TPXX: ::c_int = 39;
666 /// IL transport protocol
667 pub const IPPROTO_IL: ::c_int = 40;
668 // IPPROTO_IPV6 defined in src/unix/mod.rs
669 /// Source Demand Routing
670 pub const IPPROTO_SDRP: ::c_int = 42;
671 /// IP6 routing header
672 pub const IPPROTO_ROUTING: ::c_int = 43;
673 /// IP6 fragmentation header
674 pub const IPPROTO_FRAGMENT: ::c_int = 44;
675 /// InterDomain Routing
676 pub const IPPROTO_IDRP: ::c_int = 45;
677 /// resource reservation
678 pub const IPPROTO_RSVP: ::c_int = 46;
679 /// General Routing Encap.
680 pub const IPPROTO_GRE: ::c_int = 47;
681 /// Mobile Host Routing
682 pub const IPPROTO_MHRP: ::c_int = 48;
683 /// BHA
684 pub const IPPROTO_BHA: ::c_int = 49;
685 /// IP6 Encap Sec. Payload
686 pub const IPPROTO_ESP: ::c_int = 50;
687 /// IP6 Auth Header
688 pub const IPPROTO_AH: ::c_int = 51;
689 /// Integ. Net Layer Security
690 pub const IPPROTO_INLSP: ::c_int = 52;
691 /// IP with encryption
692 pub const IPPROTO_SWIPE: ::c_int = 53;
693 /// Next Hop Resolution
694 pub const IPPROTO_NHRP: ::c_int = 54;
695 /// IP Mobility
696 pub const IPPROTO_MOBILE: ::c_int = 55;
697 /// Transport Layer Security
698 pub const IPPROTO_TLSP: ::c_int = 56;
699 /// SKIP
700 pub const IPPROTO_SKIP: ::c_int = 57;
701 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
702 /// IP6 no next header
703 pub const IPPROTO_NONE: ::c_int = 59;
704 /// IP6 destination option
705 pub const IPPROTO_DSTOPTS: ::c_int = 60;
706 /// any host internal protocol
707 pub const IPPROTO_AHIP: ::c_int = 61;
708 /// CFTP
709 pub const IPPROTO_CFTP: ::c_int = 62;
710 /// "hello" routing protocol
711 pub const IPPROTO_HELLO: ::c_int = 63;
712 /// SATNET/Backroom EXPAK
713 pub const IPPROTO_SATEXPAK: ::c_int = 64;
714 /// Kryptolan
715 pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
716 /// Remote Virtual Disk
717 pub const IPPROTO_RVD: ::c_int = 66;
718 /// Pluribus Packet Core
719 pub const IPPROTO_IPPC: ::c_int = 67;
720 /// Any distributed FS
721 pub const IPPROTO_ADFS: ::c_int = 68;
722 /// Satnet Monitoring
723 pub const IPPROTO_SATMON: ::c_int = 69;
724 /// VISA Protocol
725 pub const IPPROTO_VISA: ::c_int = 70;
726 /// Packet Core Utility
727 pub const IPPROTO_IPCV: ::c_int = 71;
728 /// Comp. Prot. Net. Executive
729 pub const IPPROTO_CPNX: ::c_int = 72;
730 /// Comp. Prot. HeartBeat
731 pub const IPPROTO_CPHB: ::c_int = 73;
732 /// Wang Span Network
733 pub const IPPROTO_WSN: ::c_int = 74;
734 /// Packet Video Protocol
735 pub const IPPROTO_PVP: ::c_int = 75;
736 /// BackRoom SATNET Monitoring
737 pub const IPPROTO_BRSATMON: ::c_int = 76;
738 /// Sun net disk proto (temp.)
739 pub const IPPROTO_ND: ::c_int = 77;
740 /// WIDEBAND Monitoring
741 pub const IPPROTO_WBMON: ::c_int = 78;
742 /// WIDEBAND EXPAK
743 pub const IPPROTO_WBEXPAK: ::c_int = 79;
744 /// ISO cnlp
745 pub const IPPROTO_EON: ::c_int = 80;
746 /// VMTP
747 pub const IPPROTO_VMTP: ::c_int = 81;
748 /// Secure VMTP
749 pub const IPPROTO_SVMTP: ::c_int = 82;
750 /// Banyon VINES
751 pub const IPPROTO_VINES: ::c_int = 83;
752 /// TTP
753 pub const IPPROTO_TTP: ::c_int = 84;
754 /// NSFNET-IGP
755 pub const IPPROTO_IGP: ::c_int = 85;
756 /// dissimilar gateway prot.
757 pub const IPPROTO_DGP: ::c_int = 86;
758 /// TCF
759 pub const IPPROTO_TCF: ::c_int = 87;
760 /// Cisco/GXS IGRP
761 pub const IPPROTO_IGRP: ::c_int = 88;
762 /// OSPFIGP
763 pub const IPPROTO_OSPFIGP: ::c_int = 89;
764 /// Strite RPC protocol
765 pub const IPPROTO_SRPC: ::c_int = 90;
766 /// Locus Address Resoloution
767 pub const IPPROTO_LARP: ::c_int = 91;
768 /// Multicast Transport
769 pub const IPPROTO_MTP: ::c_int = 92;
770 /// AX.25 Frames
771 pub const IPPROTO_AX25: ::c_int = 93;
772 /// IP encapsulated in IP
773 pub const IPPROTO_IPEIP: ::c_int = 94;
774 /// Mobile Int.ing control
775 pub const IPPROTO_MICP: ::c_int = 95;
776 /// Semaphore Comm. security
777 pub const IPPROTO_SCCSP: ::c_int = 96;
778 /// Ethernet IP encapsulation
779 pub const IPPROTO_ETHERIP: ::c_int = 97;
780 /// encapsulation header
781 pub const IPPROTO_ENCAP: ::c_int = 98;
782 /// any private encr. scheme
783 pub const IPPROTO_APES: ::c_int = 99;
784 /// GMTP
785 pub const IPPROTO_GMTP: ::c_int = 100;
786 /// payload compression (IPComp)
787 pub const IPPROTO_IPCOMP: ::c_int = 108;
788 /// SCTP
789 pub const IPPROTO_SCTP: ::c_int = 132;
790 /// IPv6 Mobility Header
791 pub const IPPROTO_MH: ::c_int = 135;
792 /// UDP-Lite
793 pub const IPPROTO_UDPLITE: ::c_int = 136;
794 /// IP6 Host Identity Protocol
795 pub const IPPROTO_HIP: ::c_int = 139;
796 /// IP6 Shim6 Protocol
797 pub const IPPROTO_SHIM6: ::c_int = 140;
798 
799 /* 101-254: Partly Unassigned */
800 /// Protocol Independent Mcast
801 pub const IPPROTO_PIM: ::c_int = 103;
802 /// CARP
803 pub const IPPROTO_CARP: ::c_int = 112;
804 /// PGM
805 pub const IPPROTO_PGM: ::c_int = 113;
806 /// MPLS-in-IP
807 pub const IPPROTO_MPLS: ::c_int = 137;
808 /// PFSYNC
809 pub const IPPROTO_PFSYNC: ::c_int = 240;
810 
811 /* 255: Reserved */
812 /* BSD Private, local use, namespace incursion, no longer used */
813 /// OLD divert pseudo-proto
814 pub const IPPROTO_OLD_DIVERT: ::c_int = 254;
815 pub const IPPROTO_MAX: ::c_int = 256;
816 /// last return value of *_input(), meaning "all job for this pkt is done".
817 pub const IPPROTO_DONE: ::c_int = 257;
818 
819 /* Only used internally, so can be outside the range of valid IP protocols. */
820 /// divert pseudo-protocol
821 pub const IPPROTO_DIVERT: ::c_int = 258;
822 /// SeND pseudo-protocol
823 pub const IPPROTO_SEND: ::c_int = 259;
824 
825 // sys/netinet/TCP.h
826 pub const TCP_MD5SIG: ::c_int = 16;
827 pub const TCP_INFO: ::c_int = 32;
828 pub const TCP_CONGESTION: ::c_int = 64;
829 pub const TCP_CCALGOOPT: ::c_int = 65;
830 pub const TCP_KEEPINIT: ::c_int = 128;
831 pub const TCP_FASTOPEN: ::c_int = 1025;
832 pub const TCP_PCAP_OUT: ::c_int = 2048;
833 pub const TCP_PCAP_IN: ::c_int = 4096;
834 
835 pub const IP_BINDANY: ::c_int = 24;
836 pub const IP_BINDMULTI: ::c_int = 25;
837 pub const IP_RSS_LISTEN_BUCKET: ::c_int = 26;
838 pub const IP_ORIGDSTADDR : ::c_int = 27;
839 pub const IP_RECVORIGDSTADDR : ::c_int = IP_ORIGDSTADDR;
840 
841 pub const IP_RECVTOS: ::c_int = 68;
842 
843 pub const IPV6_ORIGDSTADDR: ::c_int = 72;
844 pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR;
845 
846 pub const PF_SLOW: ::c_int = AF_SLOW;
847 pub const PF_SCLUSTER: ::c_int = AF_SCLUSTER;
848 pub const PF_ARP: ::c_int = AF_ARP;
849 pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
850 pub const PF_IEEE80211: ::c_int = AF_IEEE80211;
851 pub const PF_INET_SDP: ::c_int = AF_INET_SDP;
852 pub const PF_INET6_SDP: ::c_int = AF_INET6_SDP;
853 #[doc(hidden)]
854 pub const PF_MAX: ::c_int = AF_MAX;
855 
856 pub const NET_RT_DUMP: ::c_int = 1;
857 pub const NET_RT_FLAGS: ::c_int = 2;
858 pub const NET_RT_IFLIST: ::c_int = 3;
859 pub const NET_RT_IFMALIST: ::c_int = 4;
860 pub const NET_RT_IFLISTL: ::c_int = 5;
861 
862 // System V IPC
863 pub const IPC_PRIVATE: ::key_t = 0;
864 pub const IPC_CREAT: ::c_int = 0o1000;
865 pub const IPC_EXCL: ::c_int = 0o2000;
866 pub const IPC_NOWAIT: ::c_int = 0o4000;
867 pub const IPC_RMID: ::c_int = 0;
868 pub const IPC_SET: ::c_int = 1;
869 pub const IPC_STAT: ::c_int = 2;
870 pub const IPC_INFO: ::c_int = 3;
871 pub const IPC_R : ::c_int = 0o400;
872 pub const IPC_W : ::c_int = 0o200;
873 pub const IPC_M : ::c_int = 0o10000;
874 pub const MSG_NOERROR: ::c_int = 0o10000;
875 pub const SHM_RDONLY: ::c_int = 0o10000;
876 pub const SHM_RND: ::c_int = 0o20000;
877 pub const SHM_R: ::c_int = 0o400;
878 pub const SHM_W: ::c_int = 0o200;
879 pub const SHM_LOCK: ::c_int = 11;
880 pub const SHM_UNLOCK: ::c_int = 12;
881 pub const SHM_STAT: ::c_int = 13;
882 pub const SHM_INFO: ::c_int = 14;
883 pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char;
884 
885 // The *_MAXID constants never should've been used outside of the
886 // FreeBSD base system.  And with the exception of CTL_P1003_1B_MAXID,
887 // they were all removed in svn r262489.  They remain here for backwards
888 // compatibility only, and are scheduled to be removed in libc 1.0.0.
889 #[doc(hidden)]
890 pub const NET_MAXID: ::c_int = AF_MAX;
891 #[doc(hidden)]
892 pub const CTL_MAXID: ::c_int = 10;
893 #[doc(hidden)]
894 pub const KERN_MAXID: ::c_int = 38;
895 #[doc(hidden)]
896 pub const HW_MAXID: ::c_int = 13;
897 #[doc(hidden)]
898 pub const USER_MAXID: ::c_int = 21;
899 #[doc(hidden)]
900 pub const CTL_P1003_1B_MAXID: ::c_int = 26;
901 
902 pub const MSG_NOTIFICATION: ::c_int = 0x00002000;
903 pub const MSG_NBIO: ::c_int = 0x00004000;
904 pub const MSG_COMPAT: ::c_int = 0x00008000;
905 pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00040000;
906 pub const MSG_NOSIGNAL: ::c_int = 0x20000;
907 
908 pub const EMPTY: ::c_short = 0;
909 pub const BOOT_TIME: ::c_short = 1;
910 pub const OLD_TIME: ::c_short = 2;
911 pub const NEW_TIME: ::c_short = 3;
912 pub const USER_PROCESS: ::c_short = 4;
913 pub const INIT_PROCESS: ::c_short = 5;
914 pub const LOGIN_PROCESS: ::c_short = 6;
915 pub const DEAD_PROCESS: ::c_short = 7;
916 pub const SHUTDOWN_TIME: ::c_short = 8;
917 
918 pub const LC_COLLATE_MASK: ::c_int = (1 << 0);
919 pub const LC_CTYPE_MASK: ::c_int = (1 << 1);
920 pub const LC_MONETARY_MASK: ::c_int =(1 << 2);
921 pub const LC_NUMERIC_MASK: ::c_int = (1 << 3);
922 pub const LC_TIME_MASK: ::c_int = (1 << 4);
923 pub const LC_MESSAGES_MASK: ::c_int = (1 << 5);
924 pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
925                                | LC_CTYPE_MASK
926                                | LC_MESSAGES_MASK
927                                | LC_MONETARY_MASK
928                                | LC_NUMERIC_MASK
929                                | LC_TIME_MASK;
930 
931 pub const WSTOPPED: ::c_int = 2; // same as WUNTRACED
932 pub const WCONTINUED: ::c_int = 4;
933 pub const WNOWAIT: ::c_int = 8;
934 pub const WEXITED: ::c_int = 16;
935 pub const WTRAPPED: ::c_int = 32;
936 
937 // FreeBSD defines a great many more of these, we only expose the
938 // standardized ones.
939 pub const P_PID: idtype_t = 0;
940 pub const P_PGID: idtype_t = 2;
941 pub const P_ALL: idtype_t = 7;
942 
943 pub const B460800: ::speed_t = 460800;
944 pub const B921600: ::speed_t = 921600;
945 
946 pub const AT_FDCWD: ::c_int = -100;
947 pub const AT_EACCESS: ::c_int = 0x100;
948 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
949 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
950 pub const AT_REMOVEDIR: ::c_int = 0x800;
951 
952 pub const TABDLY: ::tcflag_t = 0x00000004;
953 pub const TAB0: ::tcflag_t = 0x00000000;
954 pub const TAB3: ::tcflag_t = 0x00000004;
955 
956 pub const _PC_ACL_NFS4: ::c_int = 64;
957 
958 pub const _SC_CPUSET_SIZE: ::c_int = 122;
959 
960 pub const XU_NGROUPS: ::c_int = 16;
961 pub const XUCRED_VERSION: ::c_uint = 0;
962 
963 // Flags which can be passed to pdfork(2)
964 pub const PD_DAEMON: ::c_int = 0x00000001;
965 pub const PD_CLOEXEC: ::c_int = 0x00000002;
966 pub const PD_ALLOWED_AT_FORK: ::c_int = PD_DAEMON | PD_CLOEXEC;
967 
968 // Values for struct rtprio (type_ field)
969 pub const RTP_PRIO_REALTIME: ::c_ushort = 2;
970 pub const RTP_PRIO_NORMAL: ::c_ushort = 3;
971 pub const RTP_PRIO_IDLE: ::c_ushort = 4;
972 
973 pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
974 pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
975 pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04;
976 pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08;
977 pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
978 pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
979 
980 // Flags for chflags(2)
981 pub const UF_SYSTEM:    ::c_ulong = 0x00000080;
982 pub const UF_SPARSE:    ::c_ulong = 0x00000100;
983 pub const UF_OFFLINE:   ::c_ulong = 0x00000200;
984 pub const UF_REPARSE:   ::c_ulong = 0x00000400;
985 pub const UF_ARCHIVE:   ::c_ulong = 0x00000800;
986 pub const UF_READONLY:  ::c_ulong = 0x00001000;
987 pub const UF_HIDDEN:    ::c_ulong = 0x00008000;
988 pub const SF_SNAPSHOT:  ::c_ulong = 0x00200000;
989 
_ALIGN(p: usize) -> usize990 fn _ALIGN(p: usize) -> usize {
991     (p + _ALIGNBYTES) & !_ALIGNBYTES
992 }
993 
994 f! {
995     pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
996         (cmsg as *mut ::c_uchar)
997             .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
998     }
999 
1000     pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
1001         _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
1002     }
1003 
1004     pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
1005         -> *mut ::cmsghdr
1006     {
1007         if cmsg.is_null() {
1008             return ::CMSG_FIRSTHDR(mhdr);
1009         };
1010         let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
1011             + _ALIGN(::mem::size_of::<::cmsghdr>());
1012         let max = (*mhdr).msg_control as usize
1013             + (*mhdr).msg_controllen as usize;
1014         if next > max {
1015             0 as *mut ::cmsghdr
1016         } else {
1017             (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize))
1018                 as *mut ::cmsghdr
1019         }
1020     }
1021 
1022     pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
1023         (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize))
1024             as ::c_uint
1025     }
1026 
1027     pub fn uname(buf: *mut ::utsname) -> ::c_int {
1028         __xuname(256, buf as *mut ::c_void)
1029     }
1030 }
1031 
1032 extern {
__error() -> *mut ::c_int1033     pub fn __error() -> *mut ::c_int;
1034 
mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int1035     pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
1036                     -> ::c_int;
1037 
clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int1038     pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int1039     pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int1040     pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
1041 
extattr_delete_fd(fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char) -> ::c_int1042     pub fn extattr_delete_fd(fd: ::c_int,
1043                              attrnamespace: ::c_int,
1044                              attrname: *const ::c_char) -> ::c_int;
extattr_delete_file(path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char) -> ::c_int1045     pub fn extattr_delete_file(path: *const ::c_char,
1046                                attrnamespace: ::c_int,
1047                                attrname: *const ::c_char) -> ::c_int;
extattr_delete_link(path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char) -> ::c_int1048     pub fn extattr_delete_link(path: *const ::c_char,
1049                                attrnamespace: ::c_int,
1050                                attrname: *const ::c_char) -> ::c_int;
extattr_get_fd(fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t) -> ::ssize_t1051     pub fn extattr_get_fd(fd: ::c_int,
1052                           attrnamespace: ::c_int,
1053                           attrname: *const ::c_char,
1054                           data: *mut ::c_void,
1055                           nbytes: ::size_t) -> ::ssize_t;
extattr_get_file(path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t) -> ::ssize_t1056     pub fn extattr_get_file(path: *const ::c_char,
1057                             attrnamespace: ::c_int,
1058                             attrname: *const ::c_char,
1059                             data: *mut ::c_void,
1060                             nbytes: ::size_t) -> ::ssize_t;
extattr_get_link(path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t) -> ::ssize_t1061     pub fn extattr_get_link(path: *const ::c_char,
1062                             attrnamespace: ::c_int,
1063                             attrname: *const ::c_char,
1064                             data: *mut ::c_void,
1065                             nbytes: ::size_t) -> ::ssize_t;
extattr_list_fd(fd: ::c_int, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t) -> ::ssize_t1066     pub fn extattr_list_fd(fd: ::c_int,
1067                            attrnamespace: ::c_int,
1068                            data: *mut ::c_void,
1069                            nbytes: ::size_t) -> ::ssize_t;
extattr_list_file(path: *const ::c_char, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t) -> ::ssize_t1070     pub fn extattr_list_file(path: *const ::c_char,
1071                              attrnamespace: ::c_int,
1072                              data: *mut ::c_void,
1073                              nbytes: ::size_t) -> ::ssize_t;
extattr_list_link(path: *const ::c_char, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t) -> ::ssize_t1074     pub fn extattr_list_link(path: *const ::c_char,
1075                              attrnamespace: ::c_int,
1076                              data: *mut ::c_void,
1077                              nbytes: ::size_t) -> ::ssize_t;
extattr_set_fd(fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t) -> ::ssize_t1078     pub fn extattr_set_fd(fd: ::c_int,
1079                           attrnamespace: ::c_int,
1080                           attrname: *const ::c_char,
1081                           data: *const ::c_void,
1082                           nbytes: ::size_t) -> ::ssize_t;
extattr_set_file(path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t) -> ::ssize_t1083     pub fn extattr_set_file(path: *const ::c_char,
1084                             attrnamespace: ::c_int,
1085                             attrname: *const ::c_char,
1086                             data: *const ::c_void,
1087                             nbytes: ::size_t) -> ::ssize_t;
extattr_set_link(path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t) -> ::ssize_t1088     pub fn extattr_set_link(path: *const ::c_char,
1089                             attrnamespace: ::c_int,
1090                             attrname: *const ::c_char,
1091                             data: *const ::c_void,
1092                             nbytes: ::size_t) -> ::ssize_t;
1093 
jail(jail: *mut ::jail) -> ::c_int1094     pub fn jail(jail: *mut ::jail) -> ::c_int;
jail_attach(jid: ::c_int) -> ::c_int1095     pub fn jail_attach(jid: ::c_int) -> ::c_int;
jail_remove(jid: ::c_int) -> ::c_int1096     pub fn jail_remove(jid: ::c_int) -> ::c_int;
jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int1097     pub fn jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int)
1098                     -> ::c_int;
jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int1099     pub fn jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int)
1100                     -> ::c_int;
1101 
fdatasync(fd: ::c_int) -> ::c_int1102     pub fn fdatasync(fd: ::c_int) -> ::c_int;
posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int1103     pub fn posix_fallocate(fd: ::c_int, offset: ::off_t,
1104                            len: ::off_t) -> ::c_int;
posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int1105     pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t,
1106                          advise: ::c_int) -> ::c_int;
mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int1107     pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int1108     pub fn mkostemps(template: *mut ::c_char,
1109                      suffixlen: ::c_int,
1110                      flags: ::c_int) -> ::c_int;
1111 
getutxuser(user: *const ::c_char) -> *mut utmpx1112     pub fn getutxuser(user: *const ::c_char) -> *mut utmpx;
setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int1113     pub fn setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int;
1114 
aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t1115     pub fn aio_waitcomplete(iocbp: *mut *mut aiocb,
1116                             timeout: *mut ::timespec) -> ::ssize_t;
1117 
freelocale(loc: ::locale_t) -> ::c_int1118     pub fn freelocale(loc: ::locale_t) -> ::c_int;
waitid(idtype: idtype_t, id: ::id_t, infop: *mut ::siginfo_t, options: ::c_int) -> ::c_int1119     pub fn waitid(idtype: idtype_t, id: ::id_t, infop: *mut ::siginfo_t,
1120                   options: ::c_int) -> ::c_int;
1121 
ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t1122     pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int1123     pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void1124     pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void,
1125         shmflg: ::c_int) -> *mut ::c_void;
shmdt(shmaddr: *const ::c_void) -> ::c_int1126     pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int1127     pub fn shmctl(shmid: ::c_int, cmd: ::c_int,
1128         buf: *mut ::shmid_ds) -> ::c_int;
msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int1129     pub fn msgctl(msqid: ::c_int, cmd: ::c_int,
1130         buf: *mut ::msqid_ds) -> ::c_int;
msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int1131     pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t, msgtyp: ::c_long, msgflg: ::c_int) -> ::c_int1132     pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t,
1133         msgtyp: ::c_long, msgflg: ::c_int) -> ::c_int;
msgsnd(msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t, msgflg: ::c_int) -> ::c_int1134     pub fn msgsnd(msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t,
1135         msgflg: ::c_int) -> ::c_int;
cfmakesane(termios: *mut ::termios)1136     pub fn cfmakesane(termios: *mut ::termios);
fexecve(fd: ::c_int, argv: *const *const ::c_char, envp: *const *const ::c_char) -> ::c_int1137     pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char,
1138                    envp: *const *const ::c_char)
1139                    -> ::c_int;
1140 
pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t1141     pub fn pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t;
pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int1142     pub fn pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int;
pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int1143     pub fn pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int;
1144 
rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int1145     pub fn rtprio_thread(function: ::c_int, lwpid: ::lwpid_t,
1146                          rtp: *mut super::rtprio) -> ::c_int;
1147 
posix_spawn(pid: *mut ::pid_t, path: *const ::c_char, file_actions: *const ::posix_spawn_file_actions_t, attrp: *const ::posix_spawnattr_t, argv: *const *mut ::c_char, envp: *const *mut ::c_char) -> ::c_int1148     pub fn posix_spawn(pid: *mut ::pid_t,
1149                        path: *const ::c_char,
1150                        file_actions: *const ::posix_spawn_file_actions_t,
1151                        attrp: *const ::posix_spawnattr_t,
1152                        argv: *const *mut ::c_char,
1153                        envp: *const *mut ::c_char) -> ::c_int;
posix_spawnp(pid: *mut ::pid_t, file: *const ::c_char, file_actions: *const ::posix_spawn_file_actions_t, attrp: *const ::posix_spawnattr_t, argv: *const *mut ::c_char, envp: *const *mut ::c_char) -> ::c_int1154     pub fn posix_spawnp(pid: *mut ::pid_t,
1155                        file: *const ::c_char,
1156                         file_actions: *const ::posix_spawn_file_actions_t,
1157                         attrp: *const ::posix_spawnattr_t,
1158                         argv: *const *mut ::c_char,
1159                         envp: *const *mut ::c_char) -> ::c_int;
posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int1160     pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int1161     pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
posix_spawnattr_getsigdefault(attr: *const posix_spawnattr_t, default: *mut ::sigset_t) -> ::c_int1162     pub fn posix_spawnattr_getsigdefault(attr: *const posix_spawnattr_t,
1163                                          default: *mut ::sigset_t) -> ::c_int;
posix_spawnattr_setsigdefault(attr: *mut posix_spawnattr_t, default: *const ::sigset_t) -> ::c_int1164     pub fn posix_spawnattr_setsigdefault(attr: *mut posix_spawnattr_t,
1165                                          default: *const ::sigset_t) -> ::c_int;
posix_spawnattr_getsigmask(attr: *const posix_spawnattr_t, default: *mut ::sigset_t) -> ::c_int1166     pub fn posix_spawnattr_getsigmask(attr: *const posix_spawnattr_t,
1167                                       default: *mut ::sigset_t) -> ::c_int;
posix_spawnattr_setsigmask(attr: *mut posix_spawnattr_t, default: *const ::sigset_t) -> ::c_int1168     pub fn posix_spawnattr_setsigmask(attr: *mut posix_spawnattr_t,
1169                                       default: *const ::sigset_t) -> ::c_int;
posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut ::c_short) -> ::c_int1170     pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t,
1171                                     flags: *mut ::c_short) -> ::c_int;
posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int1172     pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t,
1173                                     flags: ::c_short) -> ::c_int;
posix_spawnattr_getpgroup(attr: *const posix_spawnattr_t, flags: *mut ::pid_t) -> ::c_int1174     pub fn posix_spawnattr_getpgroup(attr: *const posix_spawnattr_t,
1175                                      flags: *mut ::pid_t) -> ::c_int;
posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int1176     pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t,
1177                                      flags: ::pid_t) -> ::c_int;
posix_spawnattr_getschedpolicy(attr: *const posix_spawnattr_t, flags: *mut ::c_int) -> ::c_int1178     pub fn posix_spawnattr_getschedpolicy(attr: *const posix_spawnattr_t,
1179                                           flags: *mut ::c_int) -> ::c_int;
posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int1180     pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t,
1181                                           flags: ::c_int) -> ::c_int;
posix_spawnattr_getschedparam( attr: *const posix_spawnattr_t, param: *mut ::sched_param, ) -> ::c_int1182     pub fn posix_spawnattr_getschedparam(
1183         attr: *const posix_spawnattr_t,
1184         param: *mut ::sched_param,
1185     ) -> ::c_int;
posix_spawnattr_setschedparam( attr: *mut posix_spawnattr_t, param: *const ::sched_param, ) -> ::c_int1186     pub fn posix_spawnattr_setschedparam(
1187         attr: *mut posix_spawnattr_t,
1188         param: *const ::sched_param,
1189     ) -> ::c_int;
1190 
posix_spawn_file_actions_init( actions: *mut posix_spawn_file_actions_t, ) -> ::c_int1191     pub fn posix_spawn_file_actions_init(
1192         actions: *mut posix_spawn_file_actions_t,
1193     ) -> ::c_int;
posix_spawn_file_actions_destroy( actions: *mut posix_spawn_file_actions_t, ) -> ::c_int1194     pub fn posix_spawn_file_actions_destroy(
1195         actions: *mut posix_spawn_file_actions_t,
1196     ) -> ::c_int;
posix_spawn_file_actions_addopen( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, path: *const ::c_char, oflag: ::c_int, mode: ::mode_t, ) -> ::c_int1197     pub fn posix_spawn_file_actions_addopen(
1198         actions: *mut posix_spawn_file_actions_t,
1199         fd: ::c_int,
1200         path: *const ::c_char,
1201         oflag: ::c_int,
1202         mode: ::mode_t,
1203     ) -> ::c_int;
posix_spawn_file_actions_addclose( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, ) -> ::c_int1204     pub fn posix_spawn_file_actions_addclose(
1205         actions: *mut posix_spawn_file_actions_t,
1206         fd: ::c_int,
1207     ) -> ::c_int;
posix_spawn_file_actions_adddup2( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, newfd: ::c_int, ) -> ::c_int1208     pub fn posix_spawn_file_actions_adddup2(
1209         actions: *mut posix_spawn_file_actions_t,
1210         fd: ::c_int,
1211         newfd: ::c_int,
1212     ) -> ::c_int;
1213 
statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int1214     pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int1215     pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
1216 
dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int1217     pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
__xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int1218     pub fn __xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int;
1219 
sendmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, flags: ::c_int) -> ::ssize_t1220     pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t,
1221                     flags: ::c_int) -> ::ssize_t;
recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, flags: ::c_int, timeout: *const ::timespec) -> ::ssize_t1222     pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t,
1223                     flags: ::c_int, timeout: *const ::timespec) -> ::ssize_t;
1224 }
1225 
1226 #[link(name = "util")]
1227 extern {
extattr_namespace_to_string(attrnamespace: ::c_int, string: *mut *mut ::c_char) -> ::c_int1228     pub fn extattr_namespace_to_string(attrnamespace: ::c_int,
1229                                        string: *mut *mut ::c_char) -> ::c_int;
extattr_string_to_namespace(string: *const ::c_char, attrnamespace: *mut ::c_int) -> ::c_int1230     pub fn extattr_string_to_namespace(string: *const ::c_char,
1231                                        attrnamespace: *mut ::c_int) -> ::c_int;
1232 }
1233 
1234 cfg_if! {
1235     if #[cfg(target_arch = "x86")] {
1236         mod x86;
1237         pub use self::x86::*;
1238     } else if #[cfg(target_arch = "x86_64")] {
1239         mod x86_64;
1240         pub use self::x86_64::*;
1241     } else if #[cfg(target_arch = "aarch64")] {
1242         mod aarch64;
1243         pub use self::aarch64::*;
1244     } else if #[cfg(target_arch = "arm")] {
1245         mod arm;
1246         pub use self::arm::*;
1247     } else if #[cfg(target_arch = "powerpc64")] {
1248         mod powerpc64;
1249         pub use self::powerpc64::*;
1250     } else if #[cfg(target_arch = "powerpc")] {
1251         mod powerpc;
1252         pub use self::powerpc::*;
1253     } else {
1254         // Unknown target_arch
1255     }
1256 }
1257