• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 pub type fflags_t = u32;
2 pub type clock_t = i32;
3 
4 pub type lwpid_t = i32;
5 pub type blksize_t = i32;
6 pub type clockid_t = ::c_int;
7 pub type sem_t = _sem;
8 
9 pub type fsblkcnt_t = u64;
10 pub type fsfilcnt_t = u64;
11 pub type idtype_t = ::c_uint;
12 
13 pub type key_t = ::c_long;
14 pub type msglen_t = ::c_ulong;
15 pub type msgqnum_t = ::c_ulong;
16 
17 pub type mqd_t = *mut ::c_void;
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 statvfs {
50         pub f_bavail: ::fsblkcnt_t,
51         pub f_bfree: ::fsblkcnt_t,
52         pub f_blocks: ::fsblkcnt_t,
53         pub f_favail: ::fsfilcnt_t,
54         pub f_ffree: ::fsfilcnt_t,
55         pub f_files: ::fsfilcnt_t,
56         pub f_bsize: ::c_ulong,
57         pub f_flag: ::c_ulong,
58         pub f_frsize: ::c_ulong,
59         pub f_fsid: ::c_ulong,
60         pub f_namemax: ::c_ulong,
61     }
62 
63     // internal structure has changed over time
64     pub struct _sem {
65         data: [u32; 4],
66     }
67 
68     pub struct ipc_perm {
69         pub cuid: ::uid_t,
70         pub cgid: ::gid_t,
71         pub uid: ::uid_t,
72         pub gid: ::gid_t,
73         pub mode: ::mode_t,
74         pub seq: ::c_ushort,
75         pub key: ::key_t,
76     }
77 
78     pub struct msqid_ds {
79         pub msg_perm: ::ipc_perm,
80         __unused1: *mut ::c_void,
81         __unused2: *mut ::c_void,
82         pub msg_cbytes: ::msglen_t,
83         pub msg_qnum: ::msgqnum_t,
84         pub msg_qbytes: ::msglen_t,
85         pub msg_lspid: ::pid_t,
86         pub msg_lrpid: ::pid_t,
87         pub msg_stime: ::time_t,
88         pub msg_rtime: ::time_t,
89         pub msg_ctime: ::time_t,
90     }
91 
92     pub struct stack_t {
93         pub ss_sp: *mut ::c_void,
94         pub ss_size: ::size_t,
95         pub ss_flags: ::c_int,
96     }
97 
98     pub struct mmsghdr {
99         pub msg_hdr: ::msghdr,
100         pub msg_len: ::ssize_t,
101     }
102 
103     pub struct sockcred {
104         pub sc_uid: ::uid_t,
105         pub sc_euid: ::uid_t,
106         pub sc_gid: ::gid_t,
107         pub sc_egid: ::gid_t,
108         pub sc_ngroups: ::c_int,
109         pub sc_groups: [::gid_t; 1],
110     }
111 
112     pub struct ptrace_vm_entry {
113         pub pve_entry: ::c_int,
114         pub pve_timestamp: ::c_int,
115         pub pve_start: ::c_ulong,
116         pub pve_end: ::c_ulong,
117         pub pve_offset: ::c_ulong,
118         pub pve_prot: ::c_uint,
119         pub pve_pathlen: ::c_uint,
120         pub pve_fileid: ::c_long,
121         pub pve_fsid: u32,
122         pub pve_path: *mut ::c_char,
123     }
124 }
125 
126 s_no_extra_traits! {
127     pub struct utmpx {
128         pub ut_type: ::c_short,
129         pub ut_tv: ::timeval,
130         pub ut_id: [::c_char; 8],
131         pub ut_pid: ::pid_t,
132         pub ut_user: [::c_char; 32],
133         pub ut_line: [::c_char; 16],
134         pub ut_host: [::c_char; 128],
135         pub __ut_spare: [::c_char; 64],
136     }
137 
138     #[cfg(libc_union)]
139     pub union __c_anonymous_cr_pid {
140         __cr_unused: *mut ::c_void,
141         pub cr_pid: ::pid_t,
142     }
143 
144     pub struct xucred {
145         pub cr_version: ::c_uint,
146         pub cr_uid: ::uid_t,
147         pub cr_ngroups: ::c_short,
148         pub cr_groups: [::gid_t; 16],
149         #[cfg(libc_union)]
150         pub cr_pid__c_anonymous_union: __c_anonymous_cr_pid,
151         #[cfg(not(libc_union))]
152         __cr_unused1: *mut ::c_void,
153     }
154 
155     pub struct sockaddr_dl {
156         pub sdl_len: ::c_uchar,
157         pub sdl_family: ::c_uchar,
158         pub sdl_index: ::c_ushort,
159         pub sdl_type: ::c_uchar,
160         pub sdl_nlen: ::c_uchar,
161         pub sdl_alen: ::c_uchar,
162         pub sdl_slen: ::c_uchar,
163         pub sdl_data: [::c_char; 46],
164     }
165 
166     pub struct mq_attr {
167         pub mq_flags: ::c_long,
168         pub mq_maxmsg: ::c_long,
169         pub mq_msgsize: ::c_long,
170         pub mq_curmsgs: ::c_long,
171         __reserved: [::c_long; 4]
172     }
173 
174     pub struct sigevent {
175         pub sigev_notify: ::c_int,
176         pub sigev_signo: ::c_int,
177         pub sigev_value: ::sigval,
178         //The rest of the structure is actually a union.  We expose only
179         //sigev_notify_thread_id because it's the most useful union member.
180         pub sigev_notify_thread_id: ::lwpid_t,
181         #[cfg(target_pointer_width = "64")]
182         __unused1: ::c_int,
183         __unused2: [::c_long; 7]
184     }
185 }
186 
187 cfg_if! {
188     if #[cfg(feature = "extra_traits")] {
189         impl PartialEq for utmpx {
190             fn eq(&self, other: &utmpx) -> bool {
191                 self.ut_type == other.ut_type
192                     && self.ut_tv == other.ut_tv
193                     && self.ut_id == other.ut_id
194                     && self.ut_pid == other.ut_pid
195                     && self.ut_user == other.ut_user
196                     && self.ut_line == other.ut_line
197                     && self
198                     .ut_host
199                     .iter()
200                     .zip(other.ut_host.iter())
201                     .all(|(a,b)| a == b)
202                     && self
203                     .__ut_spare
204                     .iter()
205                     .zip(other.__ut_spare.iter())
206                     .all(|(a,b)| a == b)
207             }
208         }
209         impl Eq for utmpx {}
210         impl ::fmt::Debug for utmpx {
211             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
212                 f.debug_struct("utmpx")
213                     .field("ut_type", &self.ut_type)
214                     .field("ut_tv", &self.ut_tv)
215                     .field("ut_id", &self.ut_id)
216                     .field("ut_pid", &self.ut_pid)
217                     .field("ut_user", &self.ut_user)
218                     .field("ut_line", &self.ut_line)
219                     // FIXME: .field("ut_host", &self.ut_host)
220                     // FIXME: .field("__ut_spare", &self.__ut_spare)
221                     .finish()
222             }
223         }
224         impl ::hash::Hash for utmpx {
225             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
226                 self.ut_type.hash(state);
227                 self.ut_tv.hash(state);
228                 self.ut_id.hash(state);
229                 self.ut_pid.hash(state);
230                 self.ut_user.hash(state);
231                 self.ut_line.hash(state);
232                 self.ut_host.hash(state);
233                 self.__ut_spare.hash(state);
234             }
235         }
236 
237         #[cfg(libc_union)]
238         impl PartialEq for __c_anonymous_cr_pid {
239             fn eq(&self, other: &__c_anonymous_cr_pid) -> bool {
240                 unsafe { self.cr_pid == other.cr_pid}
241             }
242         }
243         #[cfg(libc_union)]
244         impl Eq for __c_anonymous_cr_pid {}
245         #[cfg(libc_union)]
246         impl ::fmt::Debug for __c_anonymous_cr_pid {
247             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
248                 f.debug_struct("cr_pid")
249                     .field("cr_pid", unsafe { &self.cr_pid })
250                     .finish()
251             }
252         }
253         #[cfg(libc_union)]
254         impl ::hash::Hash for __c_anonymous_cr_pid {
255             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
256                 unsafe { self.cr_pid.hash(state) };
257             }
258         }
259 
260         impl PartialEq for xucred {
261             fn eq(&self, other: &xucred) -> bool {
262                 #[cfg(libc_union)]
263                 let equal_cr_pid = self.cr_pid__c_anonymous_union
264                     == other.cr_pid__c_anonymous_union;
265                 #[cfg(not(libc_union))]
266                 let equal_cr_pid = self.__cr_unused1 == other.__cr_unused1;
267 
268                 self.cr_version == other.cr_version
269                     && self.cr_uid == other.cr_uid
270                     && self.cr_ngroups == other.cr_ngroups
271                     && self.cr_groups == other.cr_groups
272                     && equal_cr_pid
273             }
274         }
275         impl Eq for xucred {}
276         impl ::fmt::Debug for xucred {
277             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
278                 let mut struct_formatter = f.debug_struct("xucred");
279                 struct_formatter.field("cr_version", &self.cr_version);
280                 struct_formatter.field("cr_uid", &self.cr_uid);
281                 struct_formatter.field("cr_ngroups", &self.cr_ngroups);
282                 struct_formatter.field("cr_groups", &self.cr_groups);
283                 #[cfg(libc_union)]
284                 struct_formatter.field(
285                     "cr_pid__c_anonymous_union",
286                     &self.cr_pid__c_anonymous_union
287                 );
288                 struct_formatter.finish()
289             }
290         }
291         impl ::hash::Hash for xucred {
292             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
293                 self.cr_version.hash(state);
294                 self.cr_uid.hash(state);
295                 self.cr_ngroups.hash(state);
296                 self.cr_groups.hash(state);
297                 #[cfg(libc_union)]
298                 self.cr_pid__c_anonymous_union.hash(state);
299                 #[cfg(not(libc_union))]
300                 self.__cr_unused1.hash(state);
301             }
302         }
303 
304         impl PartialEq for sockaddr_dl {
305             fn eq(&self, other: &sockaddr_dl) -> bool {
306                 self.sdl_len == other.sdl_len
307                     && self.sdl_family == other.sdl_family
308                     && self.sdl_index == other.sdl_index
309                     && self.sdl_type == other.sdl_type
310                     && self.sdl_nlen == other.sdl_nlen
311                     && self.sdl_alen == other.sdl_alen
312                     && self.sdl_slen == other.sdl_slen
313                     && self
314                     .sdl_data
315                     .iter()
316                     .zip(other.sdl_data.iter())
317                     .all(|(a,b)| a == b)
318             }
319         }
320         impl Eq for sockaddr_dl {}
321         impl ::fmt::Debug for sockaddr_dl {
322             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
323                 f.debug_struct("sockaddr_dl")
324                     .field("sdl_len", &self.sdl_len)
325                     .field("sdl_family", &self.sdl_family)
326                     .field("sdl_index", &self.sdl_index)
327                     .field("sdl_type", &self.sdl_type)
328                     .field("sdl_nlen", &self.sdl_nlen)
329                     .field("sdl_alen", &self.sdl_alen)
330                     .field("sdl_slen", &self.sdl_slen)
331                     // FIXME: .field("sdl_data", &self.sdl_data)
332                     .finish()
333             }
334         }
335         impl ::hash::Hash for sockaddr_dl {
336             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
337                 self.sdl_len.hash(state);
338                 self.sdl_family.hash(state);
339                 self.sdl_index.hash(state);
340                 self.sdl_type.hash(state);
341                 self.sdl_nlen.hash(state);
342                 self.sdl_alen.hash(state);
343                 self.sdl_slen.hash(state);
344                 self.sdl_data.hash(state);
345             }
346         }
347 
348         impl PartialEq for mq_attr {
349             fn eq(&self, other: &mq_attr) -> bool {
350                 self.mq_flags == other.mq_flags &&
351                 self.mq_maxmsg == other.mq_maxmsg &&
352                 self.mq_msgsize == other.mq_msgsize &&
353                 self.mq_curmsgs == other.mq_curmsgs
354             }
355         }
356         impl Eq for mq_attr {}
357         impl ::fmt::Debug for mq_attr {
358             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
359                 f.debug_struct("mq_attr")
360                     .field("mq_flags", &self.mq_flags)
361                     .field("mq_maxmsg", &self.mq_maxmsg)
362                     .field("mq_msgsize", &self.mq_msgsize)
363                     .field("mq_curmsgs", &self.mq_curmsgs)
364                     .finish()
365             }
366         }
367         impl ::hash::Hash for mq_attr {
368             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
369                 self.mq_flags.hash(state);
370                 self.mq_maxmsg.hash(state);
371                 self.mq_msgsize.hash(state);
372                 self.mq_curmsgs.hash(state);
373             }
374         }
375 
376         impl PartialEq for sigevent {
377             fn eq(&self, other: &sigevent) -> bool {
378                 self.sigev_notify == other.sigev_notify
379                     && self.sigev_signo == other.sigev_signo
380                     && self.sigev_value == other.sigev_value
381                     && self.sigev_notify_thread_id
382                         == other.sigev_notify_thread_id
383             }
384         }
385         impl Eq for sigevent {}
386         impl ::fmt::Debug for sigevent {
387             fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
388                 f.debug_struct("sigevent")
389                     .field("sigev_notify", &self.sigev_notify)
390                     .field("sigev_signo", &self.sigev_signo)
391                     .field("sigev_value", &self.sigev_value)
392                     .field("sigev_notify_thread_id",
393                            &self.sigev_notify_thread_id)
394                     .finish()
395             }
396         }
397         impl ::hash::Hash for sigevent {
398             fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
399                 self.sigev_notify.hash(state);
400                 self.sigev_signo.hash(state);
401                 self.sigev_value.hash(state);
402                 self.sigev_notify_thread_id.hash(state);
403             }
404         }
405     }
406 }
407 
408 pub const SIGEV_THREAD_ID: ::c_int = 4;
409 
410 pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0;
411 pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
412 pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
413 
414 pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ;
415 pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4;
416 pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768;
417 pub const SF_NODISKIO: ::c_int = 0x00000001;
418 pub const SF_MNOWAIT: ::c_int = 0x00000002;
419 pub const SF_SYNC: ::c_int = 0x00000004;
420 pub const SF_USER_READAHEAD: ::c_int = 0x00000008;
421 pub const SF_NOCACHE: ::c_int = 0x00000010;
422 pub const O_CLOEXEC: ::c_int = 0x00100000;
423 pub const O_DIRECTORY: ::c_int = 0x00020000;
424 pub const O_EXEC: ::c_int = 0x00040000;
425 pub const O_TTY_INIT: ::c_int = 0x00080000;
426 pub const F_GETLK: ::c_int = 11;
427 pub const F_SETLK: ::c_int = 12;
428 pub const F_SETLKW: ::c_int = 13;
429 pub const ENOTCAPABLE: ::c_int = 93;
430 pub const ECAPMODE: ::c_int = 94;
431 pub const ENOTRECOVERABLE: ::c_int = 95;
432 pub const EOWNERDEAD: ::c_int = 96;
433 pub const RLIMIT_NPTS: ::c_int = 11;
434 pub const RLIMIT_SWAP: ::c_int = 12;
435 pub const RLIMIT_KQUEUES: ::c_int = 13;
436 pub const RLIMIT_UMTXP: ::c_int = 14;
437 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
438 pub const RLIM_NLIMITS: ::rlim_t = 15;
439 
440 pub const NI_NOFQDN: ::c_int = 0x00000001;
441 pub const NI_NUMERICHOST: ::c_int = 0x00000002;
442 pub const NI_NAMEREQD: ::c_int = 0x00000004;
443 pub const NI_NUMERICSERV: ::c_int = 0x00000008;
444 pub const NI_DGRAM: ::c_int = 0x00000010;
445 pub const NI_NUMERICSCOPE: ::c_int = 0x00000020;
446 
447 pub const Q_GETQUOTA: ::c_int = 0x700;
448 pub const Q_SETQUOTA: ::c_int = 0x800;
449 
450 pub const MAP_GUARD: ::c_int = 0x00002000;
451 
452 pub const POSIX_FADV_NORMAL: ::c_int = 0;
453 pub const POSIX_FADV_RANDOM: ::c_int = 1;
454 pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
455 pub const POSIX_FADV_WILLNEED: ::c_int = 3;
456 pub const POSIX_FADV_DONTNEED: ::c_int = 4;
457 pub const POSIX_FADV_NOREUSE: ::c_int = 5;
458 
459 pub const POLLINIGNEOF: ::c_short = 0x2000;
460 
461 pub const EVFILT_READ: i16 = -1;
462 pub const EVFILT_WRITE: i16 = -2;
463 pub const EVFILT_AIO: i16 = -3;
464 pub const EVFILT_VNODE: i16 = -4;
465 pub const EVFILT_PROC: i16 = -5;
466 pub const EVFILT_SIGNAL: i16 = -6;
467 pub const EVFILT_TIMER: i16 = -7;
468 pub const EVFILT_PROCDESC: i16 = -8;
469 pub const EVFILT_FS: i16 = -9;
470 pub const EVFILT_LIO: i16 = -10;
471 pub const EVFILT_USER: i16 = -11;
472 pub const EVFILT_SENDFILE: i16 = -12;
473 pub const EVFILT_EMPTY: i16 = -13;
474 
475 pub const EV_ADD: u16 = 0x1;
476 pub const EV_DELETE: u16 = 0x2;
477 pub const EV_ENABLE: u16 = 0x4;
478 pub const EV_DISABLE: u16 = 0x8;
479 pub const EV_ONESHOT: u16 = 0x10;
480 pub const EV_CLEAR: u16 = 0x20;
481 pub const EV_RECEIPT: u16 = 0x40;
482 pub const EV_DISPATCH: u16 = 0x80;
483 pub const EV_DROP: u16 = 0x1000;
484 pub const EV_FLAG1: u16 = 0x2000;
485 pub const EV_ERROR: u16 = 0x4000;
486 pub const EV_EOF: u16 = 0x8000;
487 pub const EV_SYSFLAGS: u16 = 0xf000;
488 
489 pub const NOTE_TRIGGER: u32 = 0x01000000;
490 pub const NOTE_FFNOP: u32 = 0x00000000;
491 pub const NOTE_FFAND: u32 = 0x40000000;
492 pub const NOTE_FFOR: u32 = 0x80000000;
493 pub const NOTE_FFCOPY: u32 = 0xc0000000;
494 pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
495 pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
496 pub const NOTE_LOWAT: u32 = 0x00000001;
497 pub const NOTE_DELETE: u32 = 0x00000001;
498 pub const NOTE_WRITE: u32 = 0x00000002;
499 pub const NOTE_EXTEND: u32 = 0x00000004;
500 pub const NOTE_ATTRIB: u32 = 0x00000008;
501 pub const NOTE_LINK: u32 = 0x00000010;
502 pub const NOTE_RENAME: u32 = 0x00000020;
503 pub const NOTE_REVOKE: u32 = 0x00000040;
504 pub const NOTE_EXIT: u32 = 0x80000000;
505 pub const NOTE_FORK: u32 = 0x40000000;
506 pub const NOTE_EXEC: u32 = 0x20000000;
507 pub const NOTE_PDATAMASK: u32 = 0x000fffff;
508 pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
509 pub const NOTE_TRACK: u32 = 0x00000001;
510 pub const NOTE_TRACKERR: u32 = 0x00000002;
511 pub const NOTE_CHILD: u32 = 0x00000004;
512 pub const NOTE_SECONDS: u32 = 0x00000001;
513 pub const NOTE_MSECONDS: u32 = 0x00000002;
514 pub const NOTE_USECONDS: u32 = 0x00000004;
515 pub const NOTE_NSECONDS: u32 = 0x00000008;
516 
517 pub const MADV_PROTECT: ::c_int = 10;
518 pub const RUSAGE_THREAD: ::c_int = 1;
519 
520 #[doc(hidden)]
521 #[deprecated(
522     since = "0.2.72",
523     note = "CTL_UNSPEC is deprecated. Use CTL_SYSCTL instead"
524 )]
525 pub const CTL_UNSPEC: ::c_int = 0;
526 pub const CTL_SYSCTL: ::c_int = 0;
527 pub const CTL_KERN: ::c_int = 1;
528 pub const CTL_VM: ::c_int = 2;
529 pub const CTL_VFS: ::c_int = 3;
530 pub const CTL_NET: ::c_int = 4;
531 pub const CTL_DEBUG: ::c_int = 5;
532 pub const CTL_HW: ::c_int = 6;
533 pub const CTL_MACHDEP: ::c_int = 7;
534 pub const CTL_USER: ::c_int = 8;
535 pub const CTL_P1003_1B: ::c_int = 9;
536 pub const CTL_SYSCTL_DEBUG: ::c_int = 0;
537 pub const CTL_SYSCTL_NAME: ::c_int = 1;
538 pub const CTL_SYSCTL_NEXT: ::c_int = 2;
539 pub const CTL_SYSCTL_NAME2OID: ::c_int = 3;
540 pub const CTL_SYSCTL_OIDFMT: ::c_int = 4;
541 pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5;
542 pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6;
543 pub const KERN_OSTYPE: ::c_int = 1;
544 pub const KERN_OSRELEASE: ::c_int = 2;
545 pub const KERN_OSREV: ::c_int = 3;
546 pub const KERN_VERSION: ::c_int = 4;
547 pub const KERN_MAXVNODES: ::c_int = 5;
548 pub const KERN_MAXPROC: ::c_int = 6;
549 pub const KERN_MAXFILES: ::c_int = 7;
550 pub const KERN_ARGMAX: ::c_int = 8;
551 pub const KERN_SECURELVL: ::c_int = 9;
552 pub const KERN_HOSTNAME: ::c_int = 10;
553 pub const KERN_HOSTID: ::c_int = 11;
554 pub const KERN_CLOCKRATE: ::c_int = 12;
555 pub const KERN_VNODE: ::c_int = 13;
556 pub const KERN_PROC: ::c_int = 14;
557 pub const KERN_FILE: ::c_int = 15;
558 pub const KERN_PROF: ::c_int = 16;
559 pub const KERN_POSIX1: ::c_int = 17;
560 pub const KERN_NGROUPS: ::c_int = 18;
561 pub const KERN_JOB_CONTROL: ::c_int = 19;
562 pub const KERN_SAVED_IDS: ::c_int = 20;
563 pub const KERN_BOOTTIME: ::c_int = 21;
564 pub const KERN_NISDOMAINNAME: ::c_int = 22;
565 pub const KERN_UPDATEINTERVAL: ::c_int = 23;
566 pub const KERN_OSRELDATE: ::c_int = 24;
567 pub const KERN_NTP_PLL: ::c_int = 25;
568 pub const KERN_BOOTFILE: ::c_int = 26;
569 pub const KERN_MAXFILESPERPROC: ::c_int = 27;
570 pub const KERN_MAXPROCPERUID: ::c_int = 28;
571 pub const KERN_DUMPDEV: ::c_int = 29;
572 pub const KERN_IPC: ::c_int = 30;
573 pub const KERN_DUMMY: ::c_int = 31;
574 pub const KERN_PS_STRINGS: ::c_int = 32;
575 pub const KERN_USRSTACK: ::c_int = 33;
576 pub const KERN_LOGSIGEXIT: ::c_int = 34;
577 pub const KERN_IOV_MAX: ::c_int = 35;
578 pub const KERN_HOSTUUID: ::c_int = 36;
579 pub const KERN_ARND: ::c_int = 37;
580 pub const KERN_PROC_ALL: ::c_int = 0;
581 pub const KERN_PROC_PID: ::c_int = 1;
582 pub const KERN_PROC_PGRP: ::c_int = 2;
583 pub const KERN_PROC_SESSION: ::c_int = 3;
584 pub const KERN_PROC_TTY: ::c_int = 4;
585 pub const KERN_PROC_UID: ::c_int = 5;
586 pub const KERN_PROC_RUID: ::c_int = 6;
587 pub const KERN_PROC_ARGS: ::c_int = 7;
588 pub const KERN_PROC_PROC: ::c_int = 8;
589 pub const KERN_PROC_SV_NAME: ::c_int = 9;
590 pub const KERN_PROC_RGID: ::c_int = 10;
591 pub const KERN_PROC_GID: ::c_int = 11;
592 pub const KERN_PROC_PATHNAME: ::c_int = 12;
593 pub const KERN_PROC_OVMMAP: ::c_int = 13;
594 pub const KERN_PROC_OFILEDESC: ::c_int = 14;
595 pub const KERN_PROC_KSTACK: ::c_int = 15;
596 pub const KERN_PROC_INC_THREAD: ::c_int = 0x10;
597 pub const KERN_PROC_VMMAP: ::c_int = 32;
598 pub const KERN_PROC_FILEDESC: ::c_int = 33;
599 pub const KERN_PROC_GROUPS: ::c_int = 34;
600 pub const KERN_PROC_ENV: ::c_int = 35;
601 pub const KERN_PROC_AUXV: ::c_int = 36;
602 pub const KERN_PROC_RLIMIT: ::c_int = 37;
603 pub const KERN_PROC_PS_STRINGS: ::c_int = 38;
604 pub const KERN_PROC_UMASK: ::c_int = 39;
605 pub const KERN_PROC_OSREL: ::c_int = 40;
606 pub const KERN_PROC_SIGTRAMP: ::c_int = 41;
607 pub const KIPC_MAXSOCKBUF: ::c_int = 1;
608 pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
609 pub const KIPC_SOMAXCONN: ::c_int = 3;
610 pub const KIPC_MAX_LINKHDR: ::c_int = 4;
611 pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
612 pub const KIPC_MAX_HDR: ::c_int = 6;
613 pub const KIPC_MAX_DATALEN: ::c_int = 7;
614 pub const HW_MACHINE: ::c_int = 1;
615 pub const HW_MODEL: ::c_int = 2;
616 pub const HW_NCPU: ::c_int = 3;
617 pub const HW_BYTEORDER: ::c_int = 4;
618 pub const HW_PHYSMEM: ::c_int = 5;
619 pub const HW_USERMEM: ::c_int = 6;
620 pub const HW_PAGESIZE: ::c_int = 7;
621 pub const HW_DISKNAMES: ::c_int = 8;
622 pub const HW_DISKSTATS: ::c_int = 9;
623 pub const HW_FLOATINGPT: ::c_int = 10;
624 pub const HW_MACHINE_ARCH: ::c_int = 11;
625 pub const HW_REALMEM: ::c_int = 12;
626 pub const USER_CS_PATH: ::c_int = 1;
627 pub const USER_BC_BASE_MAX: ::c_int = 2;
628 pub const USER_BC_DIM_MAX: ::c_int = 3;
629 pub const USER_BC_SCALE_MAX: ::c_int = 4;
630 pub const USER_BC_STRING_MAX: ::c_int = 5;
631 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
632 pub const USER_EXPR_NEST_MAX: ::c_int = 7;
633 pub const USER_LINE_MAX: ::c_int = 8;
634 pub const USER_RE_DUP_MAX: ::c_int = 9;
635 pub const USER_POSIX2_VERSION: ::c_int = 10;
636 pub const USER_POSIX2_C_BIND: ::c_int = 11;
637 pub const USER_POSIX2_C_DEV: ::c_int = 12;
638 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
639 pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
640 pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
641 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
642 pub const USER_POSIX2_SW_DEV: ::c_int = 17;
643 pub const USER_POSIX2_UPE: ::c_int = 18;
644 pub const USER_STREAM_MAX: ::c_int = 19;
645 pub const USER_TZNAME_MAX: ::c_int = 20;
646 pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
647 pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
648 pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
649 pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4;
650 pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5;
651 pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6;
652 pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7;
653 pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8;
654 pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9;
655 pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10;
656 pub const CTL_P1003_1B_FSYNC: ::c_int = 11;
657 pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12;
658 pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13;
659 pub const CTL_P1003_1B_TIMERS: ::c_int = 14;
660 pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15;
661 pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16;
662 pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17;
663 pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18;
664 pub const CTL_P1003_1B_MQ_OPEN_MAX: ::c_int = 19;
665 pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20;
666 pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21;
667 pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
668 pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
669 pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
670 pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
671 pub const TIOCGPTN: ::c_uint = 0x4004740f;
672 pub const TIOCPTMASTER: ::c_uint = 0x2000741c;
673 pub const TIOCSIG: ::c_uint = 0x2004745f;
674 pub const TIOCM_DCD: ::c_int = 0x40;
675 pub const H4DISC: ::c_int = 0x7;
676 
677 pub const BIOCSETFNR: ::c_ulong = 0x80104282;
678 
679 pub const FIONWRITE: ::c_ulong = 0x40046677;
680 pub const FIONSPACE: ::c_ulong = 0x40046676;
681 pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;
682 pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662;
683 
684 pub const JAIL_API_VERSION: u32 = 2;
685 pub const JAIL_CREATE: ::c_int = 0x01;
686 pub const JAIL_UPDATE: ::c_int = 0x02;
687 pub const JAIL_ATTACH: ::c_int = 0x04;
688 pub const JAIL_DYING: ::c_int = 0x08;
689 pub const JAIL_SET_MASK: ::c_int = 0x0f;
690 pub const JAIL_GET_MASK: ::c_int = 0x08;
691 pub const JAIL_SYS_DISABLE: ::c_int = 0;
692 pub const JAIL_SYS_NEW: ::c_int = 1;
693 pub const JAIL_SYS_INHERIT: ::c_int = 2;
694 
695 pub const SO_BINTIME: ::c_int = 0x2000;
696 pub const SO_NO_OFFLOAD: ::c_int = 0x4000;
697 pub const SO_NO_DDP: ::c_int = 0x8000;
698 pub const SO_REUSEPORT_LB: ::c_int = 0x10000;
699 pub const SO_LABEL: ::c_int = 0x1009;
700 pub const SO_PEERLABEL: ::c_int = 0x1010;
701 pub const SO_LISTENQLIMIT: ::c_int = 0x1011;
702 pub const SO_LISTENQLEN: ::c_int = 0x1012;
703 pub const SO_LISTENINCQLEN: ::c_int = 0x1013;
704 pub const SO_SETFIB: ::c_int = 0x1014;
705 pub const SO_USER_COOKIE: ::c_int = 0x1015;
706 pub const SO_PROTOCOL: ::c_int = 0x1016;
707 pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL;
708 pub const SO_VENDOR: ::c_int = 0x80000000;
709 
710 pub const LOCAL_CREDS: ::c_int = 2;
711 pub const LOCAL_CONNWAIT: ::c_int = 4;
712 pub const LOCAL_VENDOR: ::c_int = SO_VENDOR;
713 
714 pub const PT_LWPINFO: ::c_int = 13;
715 pub const PT_GETNUMLWPS: ::c_int = 14;
716 pub const PT_GETLWPLIST: ::c_int = 15;
717 pub const PT_CLEARSTEP: ::c_int = 16;
718 pub const PT_SETSTEP: ::c_int = 17;
719 pub const PT_SUSPEND: ::c_int = 18;
720 pub const PT_RESUME: ::c_int = 19;
721 pub const PT_TO_SCE: ::c_int = 20;
722 pub const PT_TO_SCX: ::c_int = 21;
723 pub const PT_SYSCALL: ::c_int = 22;
724 pub const PT_FOLLOW_FORK: ::c_int = 23;
725 pub const PT_LWP_EVENTS: ::c_int = 24;
726 pub const PT_GET_EVENT_MASK: ::c_int = 25;
727 pub const PT_SET_EVENT_MASK: ::c_int = 26;
728 pub const PT_GETREGS: ::c_int = 33;
729 pub const PT_SETREGS: ::c_int = 34;
730 pub const PT_GETFPREGS: ::c_int = 35;
731 pub const PT_SETFPREGS: ::c_int = 36;
732 pub const PT_GETDBREGS: ::c_int = 37;
733 pub const PT_SETDBREGS: ::c_int = 38;
734 pub const PT_VM_TIMESTAMP: ::c_int = 40;
735 pub const PT_VM_ENTRY: ::c_int = 41;
736 pub const PT_FIRSTMACH: ::c_int = 64;
737 
738 pub const PTRACE_EXEC: ::c_int = 0x0001;
739 pub const PTRACE_SCE: ::c_int = 0x0002;
740 pub const PTRACE_SCX: ::c_int = 0x0004;
741 pub const PTRACE_SYSCALL: ::c_int = PTRACE_SCE | PTRACE_SCX;
742 pub const PTRACE_FORK: ::c_int = 0x0008;
743 pub const PTRACE_LWP: ::c_int = 0x0010;
744 pub const PTRACE_VFORK: ::c_int = 0x0020;
745 pub const PTRACE_DEFAULT: ::c_int = PTRACE_EXEC;
746 
747 pub const AF_SLOW: ::c_int = 33;
748 pub const AF_SCLUSTER: ::c_int = 34;
749 pub const AF_ARP: ::c_int = 35;
750 pub const AF_BLUETOOTH: ::c_int = 36;
751 pub const AF_IEEE80211: ::c_int = 37;
752 pub const AF_INET_SDP: ::c_int = 40;
753 pub const AF_INET6_SDP: ::c_int = 42;
754 
755 // https://github.com/freebsd/freebsd/blob/master/sys/net/if.h#L140
756 pub const IFF_UP: ::c_int = 0x1; // (n) interface is up
757 pub const IFF_BROADCAST: ::c_int = 0x2; // (i) broadcast address valid
758 pub const IFF_DEBUG: ::c_int = 0x4; // (n) turn on debugging
759 pub const IFF_LOOPBACK: ::c_int = 0x8; // (i) is a loopback net
760 pub const IFF_POINTOPOINT: ::c_int = 0x10; // (i) is a point-to-point link
761                                            // 0x20           was IFF_SMART
762 pub const IFF_RUNNING: ::c_int = 0x40; // (d) resources allocated
763 #[doc(hidden)]
764 #[deprecated(
765     since = "0.2.54",
766     note = "IFF_DRV_RUNNING is deprecated. Use the portable IFF_RUNNING instead"
767 )]
768 pub const IFF_DRV_RUNNING: ::c_int = 0x40;
769 pub const IFF_NOARP: ::c_int = 0x80; // (n) no address resolution protocol
770 pub const IFF_PROMISC: ::c_int = 0x100; // (n) receive all packets
771 pub const IFF_ALLMULTI: ::c_int = 0x200; // (n) receive all multicast packets
772 pub const IFF_OACTIVE: ::c_int = 0x400; // (d) tx hardware queue is full
773 #[doc(hidden)]
774 #[deprecated(since = "0.2.54", note = "Use the portable `IFF_OACTIVE` instead")]
775 pub const IFF_DRV_OACTIVE: ::c_int = 0x400;
776 pub const IFF_SIMPLEX: ::c_int = 0x800; // (i) can't hear own transmissions
777 pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
778 pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
779 pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
780 pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
781 pub const IFF_MULTICAST: ::c_int = 0x8000; // (i) supports multicast
782                                            // (i) unconfigurable using ioctl(2)
783 pub const IFF_CANTCONFIG: ::c_int = 0x10000;
784 pub const IFF_PPROMISC: ::c_int = 0x20000; // (n) user-requested promisc mode
785 pub const IFF_MONITOR: ::c_int = 0x40000; // (n) user-requested monitor mode
786 pub const IFF_STATICARP: ::c_int = 0x80000; // (n) static ARP
787 pub const IFF_DYING: ::c_int = 0x200000; // (n) interface is winding down
788 pub const IFF_RENAMING: ::c_int = 0x400000; // (n) interface is being renamed
789 
790 // sys/netinet/in.h
791 // Protocols (RFC 1700)
792 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
793 
794 // IPPROTO_IP defined in src/unix/mod.rs
795 /// IP6 hop-by-hop options
796 pub const IPPROTO_HOPOPTS: ::c_int = 0;
797 // IPPROTO_ICMP defined in src/unix/mod.rs
798 /// group mgmt protocol
799 pub const IPPROTO_IGMP: ::c_int = 2;
800 /// gateway^2 (deprecated)
801 pub const IPPROTO_GGP: ::c_int = 3;
802 /// for compatibility
803 pub const IPPROTO_IPIP: ::c_int = 4;
804 // IPPROTO_TCP defined in src/unix/mod.rs
805 /// Stream protocol II.
806 pub const IPPROTO_ST: ::c_int = 7;
807 /// exterior gateway protocol
808 pub const IPPROTO_EGP: ::c_int = 8;
809 /// private interior gateway
810 pub const IPPROTO_PIGP: ::c_int = 9;
811 /// BBN RCC Monitoring
812 pub const IPPROTO_RCCMON: ::c_int = 10;
813 /// network voice protocol
814 pub const IPPROTO_NVPII: ::c_int = 11;
815 /// pup
816 pub const IPPROTO_PUP: ::c_int = 12;
817 /// Argus
818 pub const IPPROTO_ARGUS: ::c_int = 13;
819 /// EMCON
820 pub const IPPROTO_EMCON: ::c_int = 14;
821 /// Cross Net Debugger
822 pub const IPPROTO_XNET: ::c_int = 15;
823 /// Chaos
824 pub const IPPROTO_CHAOS: ::c_int = 16;
825 // IPPROTO_UDP defined in src/unix/mod.rs
826 /// Multiplexing
827 pub const IPPROTO_MUX: ::c_int = 18;
828 /// DCN Measurement Subsystems
829 pub const IPPROTO_MEAS: ::c_int = 19;
830 /// Host Monitoring
831 pub const IPPROTO_HMP: ::c_int = 20;
832 /// Packet Radio Measurement
833 pub const IPPROTO_PRM: ::c_int = 21;
834 /// xns idp
835 pub const IPPROTO_IDP: ::c_int = 22;
836 /// Trunk-1
837 pub const IPPROTO_TRUNK1: ::c_int = 23;
838 /// Trunk-2
839 pub const IPPROTO_TRUNK2: ::c_int = 24;
840 /// Leaf-1
841 pub const IPPROTO_LEAF1: ::c_int = 25;
842 /// Leaf-2
843 pub const IPPROTO_LEAF2: ::c_int = 26;
844 /// Reliable Data
845 pub const IPPROTO_RDP: ::c_int = 27;
846 /// Reliable Transaction
847 pub const IPPROTO_IRTP: ::c_int = 28;
848 /// tp-4 w/ class negotiation
849 pub const IPPROTO_TP: ::c_int = 29;
850 /// Bulk Data Transfer
851 pub const IPPROTO_BLT: ::c_int = 30;
852 /// Network Services
853 pub const IPPROTO_NSP: ::c_int = 31;
854 /// Merit Internodal
855 pub const IPPROTO_INP: ::c_int = 32;
856 #[doc(hidden)]
857 #[deprecated(
858     since = "0.2.72",
859     note = "IPPROTO_SEP is deprecated. Use IPPROTO_DCCP instead"
860 )]
861 pub const IPPROTO_SEP: ::c_int = 33;
862 /// Datagram Congestion Control Protocol
863 pub const IPPROTO_DCCP: ::c_int = 33;
864 /// Third Party Connect
865 pub const IPPROTO_3PC: ::c_int = 34;
866 /// InterDomain Policy Routing
867 pub const IPPROTO_IDPR: ::c_int = 35;
868 /// XTP
869 pub const IPPROTO_XTP: ::c_int = 36;
870 /// Datagram Delivery
871 pub const IPPROTO_DDP: ::c_int = 37;
872 /// Control Message Transport
873 pub const IPPROTO_CMTP: ::c_int = 38;
874 /// TP++ Transport
875 pub const IPPROTO_TPXX: ::c_int = 39;
876 /// IL transport protocol
877 pub const IPPROTO_IL: ::c_int = 40;
878 // IPPROTO_IPV6 defined in src/unix/mod.rs
879 /// Source Demand Routing
880 pub const IPPROTO_SDRP: ::c_int = 42;
881 /// IP6 routing header
882 pub const IPPROTO_ROUTING: ::c_int = 43;
883 /// IP6 fragmentation header
884 pub const IPPROTO_FRAGMENT: ::c_int = 44;
885 /// InterDomain Routing
886 pub const IPPROTO_IDRP: ::c_int = 45;
887 /// resource reservation
888 pub const IPPROTO_RSVP: ::c_int = 46;
889 /// General Routing Encap.
890 pub const IPPROTO_GRE: ::c_int = 47;
891 /// Mobile Host Routing
892 pub const IPPROTO_MHRP: ::c_int = 48;
893 /// BHA
894 pub const IPPROTO_BHA: ::c_int = 49;
895 /// IP6 Encap Sec. Payload
896 pub const IPPROTO_ESP: ::c_int = 50;
897 /// IP6 Auth Header
898 pub const IPPROTO_AH: ::c_int = 51;
899 /// Integ. Net Layer Security
900 pub const IPPROTO_INLSP: ::c_int = 52;
901 /// IP with encryption
902 pub const IPPROTO_SWIPE: ::c_int = 53;
903 /// Next Hop Resolution
904 pub const IPPROTO_NHRP: ::c_int = 54;
905 /// IP Mobility
906 pub const IPPROTO_MOBILE: ::c_int = 55;
907 /// Transport Layer Security
908 pub const IPPROTO_TLSP: ::c_int = 56;
909 /// SKIP
910 pub const IPPROTO_SKIP: ::c_int = 57;
911 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
912 /// IP6 no next header
913 pub const IPPROTO_NONE: ::c_int = 59;
914 /// IP6 destination option
915 pub const IPPROTO_DSTOPTS: ::c_int = 60;
916 /// any host internal protocol
917 pub const IPPROTO_AHIP: ::c_int = 61;
918 /// CFTP
919 pub const IPPROTO_CFTP: ::c_int = 62;
920 /// "hello" routing protocol
921 pub const IPPROTO_HELLO: ::c_int = 63;
922 /// SATNET/Backroom EXPAK
923 pub const IPPROTO_SATEXPAK: ::c_int = 64;
924 /// Kryptolan
925 pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
926 /// Remote Virtual Disk
927 pub const IPPROTO_RVD: ::c_int = 66;
928 /// Pluribus Packet Core
929 pub const IPPROTO_IPPC: ::c_int = 67;
930 /// Any distributed FS
931 pub const IPPROTO_ADFS: ::c_int = 68;
932 /// Satnet Monitoring
933 pub const IPPROTO_SATMON: ::c_int = 69;
934 /// VISA Protocol
935 pub const IPPROTO_VISA: ::c_int = 70;
936 /// Packet Core Utility
937 pub const IPPROTO_IPCV: ::c_int = 71;
938 /// Comp. Prot. Net. Executive
939 pub const IPPROTO_CPNX: ::c_int = 72;
940 /// Comp. Prot. HeartBeat
941 pub const IPPROTO_CPHB: ::c_int = 73;
942 /// Wang Span Network
943 pub const IPPROTO_WSN: ::c_int = 74;
944 /// Packet Video Protocol
945 pub const IPPROTO_PVP: ::c_int = 75;
946 /// BackRoom SATNET Monitoring
947 pub const IPPROTO_BRSATMON: ::c_int = 76;
948 /// Sun net disk proto (temp.)
949 pub const IPPROTO_ND: ::c_int = 77;
950 /// WIDEBAND Monitoring
951 pub const IPPROTO_WBMON: ::c_int = 78;
952 /// WIDEBAND EXPAK
953 pub const IPPROTO_WBEXPAK: ::c_int = 79;
954 /// ISO cnlp
955 pub const IPPROTO_EON: ::c_int = 80;
956 /// VMTP
957 pub const IPPROTO_VMTP: ::c_int = 81;
958 /// Secure VMTP
959 pub const IPPROTO_SVMTP: ::c_int = 82;
960 /// Banyon VINES
961 pub const IPPROTO_VINES: ::c_int = 83;
962 /// TTP
963 pub const IPPROTO_TTP: ::c_int = 84;
964 /// NSFNET-IGP
965 pub const IPPROTO_IGP: ::c_int = 85;
966 /// dissimilar gateway prot.
967 pub const IPPROTO_DGP: ::c_int = 86;
968 /// TCF
969 pub const IPPROTO_TCF: ::c_int = 87;
970 /// Cisco/GXS IGRP
971 pub const IPPROTO_IGRP: ::c_int = 88;
972 /// OSPFIGP
973 pub const IPPROTO_OSPFIGP: ::c_int = 89;
974 /// Strite RPC protocol
975 pub const IPPROTO_SRPC: ::c_int = 90;
976 /// Locus Address Resoloution
977 pub const IPPROTO_LARP: ::c_int = 91;
978 /// Multicast Transport
979 pub const IPPROTO_MTP: ::c_int = 92;
980 /// AX.25 Frames
981 pub const IPPROTO_AX25: ::c_int = 93;
982 /// IP encapsulated in IP
983 pub const IPPROTO_IPEIP: ::c_int = 94;
984 /// Mobile Int.ing control
985 pub const IPPROTO_MICP: ::c_int = 95;
986 /// Semaphore Comm. security
987 pub const IPPROTO_SCCSP: ::c_int = 96;
988 /// Ethernet IP encapsulation
989 pub const IPPROTO_ETHERIP: ::c_int = 97;
990 /// encapsulation header
991 pub const IPPROTO_ENCAP: ::c_int = 98;
992 /// any private encr. scheme
993 pub const IPPROTO_APES: ::c_int = 99;
994 /// GMTP
995 pub const IPPROTO_GMTP: ::c_int = 100;
996 /// payload compression (IPComp)
997 pub const IPPROTO_IPCOMP: ::c_int = 108;
998 /// SCTP
999 pub const IPPROTO_SCTP: ::c_int = 132;
1000 /// IPv6 Mobility Header
1001 pub const IPPROTO_MH: ::c_int = 135;
1002 /// UDP-Lite
1003 pub const IPPROTO_UDPLITE: ::c_int = 136;
1004 /// IP6 Host Identity Protocol
1005 pub const IPPROTO_HIP: ::c_int = 139;
1006 /// IP6 Shim6 Protocol
1007 pub const IPPROTO_SHIM6: ::c_int = 140;
1008 
1009 /* 101-254: Partly Unassigned */
1010 /// Protocol Independent Mcast
1011 pub const IPPROTO_PIM: ::c_int = 103;
1012 /// CARP
1013 pub const IPPROTO_CARP: ::c_int = 112;
1014 /// PGM
1015 pub const IPPROTO_PGM: ::c_int = 113;
1016 /// MPLS-in-IP
1017 pub const IPPROTO_MPLS: ::c_int = 137;
1018 /// PFSYNC
1019 pub const IPPROTO_PFSYNC: ::c_int = 240;
1020 
1021 /* 255: Reserved */
1022 /* BSD Private, local use, namespace incursion, no longer used */
1023 /// OLD divert pseudo-proto
1024 pub const IPPROTO_OLD_DIVERT: ::c_int = 254;
1025 pub const IPPROTO_MAX: ::c_int = 256;
1026 /// last return value of *_input(), meaning "all job for this pkt is done".
1027 pub const IPPROTO_DONE: ::c_int = 257;
1028 
1029 /* Only used internally, so can be outside the range of valid IP protocols. */
1030 /// divert pseudo-protocol
1031 pub const IPPROTO_DIVERT: ::c_int = 258;
1032 /// SeND pseudo-protocol
1033 pub const IPPROTO_SEND: ::c_int = 259;
1034 
1035 // sys/netinet/TCP.h
1036 pub const TCP_MD5SIG: ::c_int = 16;
1037 pub const TCP_INFO: ::c_int = 32;
1038 pub const TCP_CONGESTION: ::c_int = 64;
1039 pub const TCP_CCALGOOPT: ::c_int = 65;
1040 pub const TCP_KEEPINIT: ::c_int = 128;
1041 pub const TCP_FASTOPEN: ::c_int = 1025;
1042 pub const TCP_PCAP_OUT: ::c_int = 2048;
1043 pub const TCP_PCAP_IN: ::c_int = 4096;
1044 
1045 pub const IP_BINDANY: ::c_int = 24;
1046 pub const IP_BINDMULTI: ::c_int = 25;
1047 pub const IP_RSS_LISTEN_BUCKET: ::c_int = 26;
1048 pub const IP_ORIGDSTADDR: ::c_int = 27;
1049 pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR;
1050 
1051 pub const IP_RECVTOS: ::c_int = 68;
1052 
1053 pub const IPV6_BINDANY: ::c_int = 64;
1054 pub const IPV6_ORIGDSTADDR: ::c_int = 72;
1055 pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR;
1056 
1057 pub const PF_SLOW: ::c_int = AF_SLOW;
1058 pub const PF_SCLUSTER: ::c_int = AF_SCLUSTER;
1059 pub const PF_ARP: ::c_int = AF_ARP;
1060 pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
1061 pub const PF_IEEE80211: ::c_int = AF_IEEE80211;
1062 pub const PF_INET_SDP: ::c_int = AF_INET_SDP;
1063 pub const PF_INET6_SDP: ::c_int = AF_INET6_SDP;
1064 
1065 pub const NET_RT_DUMP: ::c_int = 1;
1066 pub const NET_RT_FLAGS: ::c_int = 2;
1067 pub const NET_RT_IFLIST: ::c_int = 3;
1068 pub const NET_RT_IFMALIST: ::c_int = 4;
1069 pub const NET_RT_IFLISTL: ::c_int = 5;
1070 
1071 // System V IPC
1072 pub const IPC_PRIVATE: ::key_t = 0;
1073 pub const IPC_CREAT: ::c_int = 0o1000;
1074 pub const IPC_EXCL: ::c_int = 0o2000;
1075 pub const IPC_NOWAIT: ::c_int = 0o4000;
1076 pub const IPC_RMID: ::c_int = 0;
1077 pub const IPC_SET: ::c_int = 1;
1078 pub const IPC_STAT: ::c_int = 2;
1079 pub const IPC_INFO: ::c_int = 3;
1080 pub const IPC_R: ::c_int = 0o400;
1081 pub const IPC_W: ::c_int = 0o200;
1082 pub const IPC_M: ::c_int = 0o10000;
1083 pub const MSG_NOERROR: ::c_int = 0o10000;
1084 pub const SHM_RDONLY: ::c_int = 0o10000;
1085 pub const SHM_RND: ::c_int = 0o20000;
1086 pub const SHM_R: ::c_int = 0o400;
1087 pub const SHM_W: ::c_int = 0o200;
1088 pub const SHM_LOCK: ::c_int = 11;
1089 pub const SHM_UNLOCK: ::c_int = 12;
1090 pub const SHM_STAT: ::c_int = 13;
1091 pub const SHM_INFO: ::c_int = 14;
1092 pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char;
1093 
1094 // The *_MAXID constants never should've been used outside of the
1095 // FreeBSD base system.  And with the exception of CTL_P1003_1B_MAXID,
1096 // they were all removed in svn r262489.  They remain here for backwards
1097 // compatibility only, and are scheduled to be removed in libc 1.0.0.
1098 #[doc(hidden)]
1099 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
1100 pub const CTL_MAXID: ::c_int = 10;
1101 #[doc(hidden)]
1102 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
1103 pub const KERN_MAXID: ::c_int = 38;
1104 #[doc(hidden)]
1105 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
1106 pub const HW_MAXID: ::c_int = 13;
1107 #[doc(hidden)]
1108 #[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
1109 pub const USER_MAXID: ::c_int = 21;
1110 #[doc(hidden)]
1111 #[deprecated(since = "0.2.74", note = "Removed in FreeBSD 13")]
1112 pub const CTL_P1003_1B_MAXID: ::c_int = 26;
1113 
1114 pub const MSG_NOTIFICATION: ::c_int = 0x00002000;
1115 pub const MSG_NBIO: ::c_int = 0x00004000;
1116 pub const MSG_COMPAT: ::c_int = 0x00008000;
1117 pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00040000;
1118 pub const MSG_NOSIGNAL: ::c_int = 0x20000;
1119 
1120 // utmpx entry types
1121 pub const EMPTY: ::c_short = 0;
1122 pub const BOOT_TIME: ::c_short = 1;
1123 pub const OLD_TIME: ::c_short = 2;
1124 pub const NEW_TIME: ::c_short = 3;
1125 pub const USER_PROCESS: ::c_short = 4;
1126 pub const INIT_PROCESS: ::c_short = 5;
1127 pub const LOGIN_PROCESS: ::c_short = 6;
1128 pub const DEAD_PROCESS: ::c_short = 7;
1129 pub const SHUTDOWN_TIME: ::c_short = 8;
1130 // utmp database types
1131 pub const UTXDB_ACTIVE: ::c_int = 0;
1132 pub const UTXDB_LASTLOGIN: ::c_int = 1;
1133 pub const UTXDB_LOG: ::c_int = 2;
1134 
1135 pub const LC_COLLATE_MASK: ::c_int = 1 << 0;
1136 pub const LC_CTYPE_MASK: ::c_int = 1 << 1;
1137 pub const LC_MONETARY_MASK: ::c_int = 1 << 2;
1138 pub const LC_NUMERIC_MASK: ::c_int = 1 << 3;
1139 pub const LC_TIME_MASK: ::c_int = 1 << 4;
1140 pub const LC_MESSAGES_MASK: ::c_int = 1 << 5;
1141 pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
1142     | LC_CTYPE_MASK
1143     | LC_MESSAGES_MASK
1144     | LC_MONETARY_MASK
1145     | LC_NUMERIC_MASK
1146     | LC_TIME_MASK;
1147 
1148 pub const WSTOPPED: ::c_int = 2; // same as WUNTRACED
1149 pub const WCONTINUED: ::c_int = 4;
1150 pub const WNOWAIT: ::c_int = 8;
1151 pub const WEXITED: ::c_int = 16;
1152 pub const WTRAPPED: ::c_int = 32;
1153 
1154 // FreeBSD defines a great many more of these, we only expose the
1155 // standardized ones.
1156 pub const P_PID: idtype_t = 0;
1157 pub const P_PGID: idtype_t = 2;
1158 pub const P_ALL: idtype_t = 7;
1159 
1160 pub const UTIME_OMIT: c_long = -2;
1161 pub const UTIME_NOW: c_long = -1;
1162 
1163 pub const B460800: ::speed_t = 460800;
1164 pub const B921600: ::speed_t = 921600;
1165 
1166 pub const AT_FDCWD: ::c_int = -100;
1167 pub const AT_EACCESS: ::c_int = 0x100;
1168 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
1169 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
1170 pub const AT_REMOVEDIR: ::c_int = 0x800;
1171 
1172 pub const TABDLY: ::tcflag_t = 0x00000004;
1173 pub const TAB0: ::tcflag_t = 0x00000000;
1174 pub const TAB3: ::tcflag_t = 0x00000004;
1175 
1176 pub const _PC_ACL_NFS4: ::c_int = 64;
1177 
1178 pub const _SC_CPUSET_SIZE: ::c_int = 122;
1179 
1180 // Flags which can be passed to pdfork(2)
1181 pub const PD_DAEMON: ::c_int = 0x00000001;
1182 pub const PD_CLOEXEC: ::c_int = 0x00000002;
1183 pub const PD_ALLOWED_AT_FORK: ::c_int = PD_DAEMON | PD_CLOEXEC;
1184 
1185 // Values for struct rtprio (type_ field)
1186 pub const RTP_PRIO_REALTIME: ::c_ushort = 2;
1187 pub const RTP_PRIO_NORMAL: ::c_ushort = 3;
1188 pub const RTP_PRIO_IDLE: ::c_ushort = 4;
1189 
1190 pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
1191 pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
1192 pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04;
1193 pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08;
1194 pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
1195 pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
1196 
1197 // Flags for chflags(2)
1198 pub const UF_SYSTEM: ::c_ulong = 0x00000080;
1199 pub const UF_SPARSE: ::c_ulong = 0x00000100;
1200 pub const UF_OFFLINE: ::c_ulong = 0x00000200;
1201 pub const UF_REPARSE: ::c_ulong = 0x00000400;
1202 pub const UF_ARCHIVE: ::c_ulong = 0x00000800;
1203 pub const UF_READONLY: ::c_ulong = 0x00001000;
1204 pub const UF_HIDDEN: ::c_ulong = 0x00008000;
1205 pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
1206 
1207 pub const F_OGETLK: ::c_int = 7;
1208 pub const F_OSETLK: ::c_int = 8;
1209 pub const F_OSETLKW: ::c_int = 9;
1210 pub const F_DUP2FD: ::c_int = 10;
1211 pub const F_SETLK_REMOTE: ::c_int = 14;
1212 pub const F_READAHEAD: ::c_int = 15;
1213 pub const F_RDAHEAD: ::c_int = 16;
1214 pub const F_DUP2FD_CLOEXEC: ::c_int = 18;
1215 
1216 const_fn! {
1217     {const} fn _ALIGN(p: usize) -> usize {
1218         (p + _ALIGNBYTES) & !_ALIGNBYTES
1219     }
1220 }
1221 
1222 f! {
1223     pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
1224         (cmsg as *mut ::c_uchar)
1225             .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
1226     }
1227 
1228     pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
1229         _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
1230     }
1231 
1232     pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
1233         -> *mut ::cmsghdr
1234     {
1235         if cmsg.is_null() {
1236             return ::CMSG_FIRSTHDR(mhdr);
1237         };
1238         let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
1239             + _ALIGN(::mem::size_of::<::cmsghdr>());
1240         let max = (*mhdr).msg_control as usize
1241             + (*mhdr).msg_controllen as usize;
1242         if next > max {
1243             0 as *mut ::cmsghdr
1244         } else {
1245             (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize))
1246                 as *mut ::cmsghdr
1247         }
1248     }
1249 
1250     pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
1251         (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize))
1252             as ::c_uint
1253     }
1254 
1255     pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
1256         let ngrps = if ngrps > 0 {
1257             ngrps - 1
1258         } else {
1259             0
1260         };
1261         ::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps
1262     }
1263 
1264     pub fn uname(buf: *mut ::utsname) -> ::c_int {
1265         __xuname(256, buf as *mut ::c_void)
1266     }
1267 }
1268 
1269 safe_f! {
1270     pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
1271         (status & 0o177) != 0o177 && (status & 0o177) != 0 && status != 0x13
1272     }
1273 }
1274 
1275 extern "C" {
__error() -> *mut ::c_int1276     pub fn __error() -> *mut ::c_int;
1277 
aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int1278     pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
aio_error(aiocbp: *const aiocb) -> ::c_int1279     pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int1280     pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
aio_read(aiocbp: *mut aiocb) -> ::c_int1281     pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
aio_return(aiocbp: *mut aiocb) -> ::ssize_t1282     pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
aio_suspend( aiocb_list: *const *const aiocb, nitems: ::c_int, timeout: *const ::timespec, ) -> ::c_int1283     pub fn aio_suspend(
1284         aiocb_list: *const *const aiocb,
1285         nitems: ::c_int,
1286         timeout: *const ::timespec,
1287     ) -> ::c_int;
aio_write(aiocbp: *mut aiocb) -> ::c_int1288     pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
1289 
extattr_delete_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int1290     pub fn extattr_delete_fd(
1291         fd: ::c_int,
1292         attrnamespace: ::c_int,
1293         attrname: *const ::c_char,
1294     ) -> ::c_int;
extattr_delete_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int1295     pub fn extattr_delete_file(
1296         path: *const ::c_char,
1297         attrnamespace: ::c_int,
1298         attrname: *const ::c_char,
1299     ) -> ::c_int;
extattr_delete_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, ) -> ::c_int1300     pub fn extattr_delete_link(
1301         path: *const ::c_char,
1302         attrnamespace: ::c_int,
1303         attrname: *const ::c_char,
1304     ) -> ::c_int;
extattr_get_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1305     pub fn extattr_get_fd(
1306         fd: ::c_int,
1307         attrnamespace: ::c_int,
1308         attrname: *const ::c_char,
1309         data: *mut ::c_void,
1310         nbytes: ::size_t,
1311     ) -> ::ssize_t;
extattr_get_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1312     pub fn extattr_get_file(
1313         path: *const ::c_char,
1314         attrnamespace: ::c_int,
1315         attrname: *const ::c_char,
1316         data: *mut ::c_void,
1317         nbytes: ::size_t,
1318     ) -> ::ssize_t;
extattr_get_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1319     pub fn extattr_get_link(
1320         path: *const ::c_char,
1321         attrnamespace: ::c_int,
1322         attrname: *const ::c_char,
1323         data: *mut ::c_void,
1324         nbytes: ::size_t,
1325     ) -> ::ssize_t;
extattr_list_fd( fd: ::c_int, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1326     pub fn extattr_list_fd(
1327         fd: ::c_int,
1328         attrnamespace: ::c_int,
1329         data: *mut ::c_void,
1330         nbytes: ::size_t,
1331     ) -> ::ssize_t;
extattr_list_file( path: *const ::c_char, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1332     pub fn extattr_list_file(
1333         path: *const ::c_char,
1334         attrnamespace: ::c_int,
1335         data: *mut ::c_void,
1336         nbytes: ::size_t,
1337     ) -> ::ssize_t;
extattr_list_link( path: *const ::c_char, attrnamespace: ::c_int, data: *mut ::c_void, nbytes: ::size_t, ) -> ::ssize_t1338     pub fn extattr_list_link(
1339         path: *const ::c_char,
1340         attrnamespace: ::c_int,
1341         data: *mut ::c_void,
1342         nbytes: ::size_t,
1343     ) -> ::ssize_t;
extattr_set_fd( fd: ::c_int, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t1344     pub fn extattr_set_fd(
1345         fd: ::c_int,
1346         attrnamespace: ::c_int,
1347         attrname: *const ::c_char,
1348         data: *const ::c_void,
1349         nbytes: ::size_t,
1350     ) -> ::ssize_t;
extattr_set_file( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t1351     pub fn extattr_set_file(
1352         path: *const ::c_char,
1353         attrnamespace: ::c_int,
1354         attrname: *const ::c_char,
1355         data: *const ::c_void,
1356         nbytes: ::size_t,
1357     ) -> ::ssize_t;
extattr_set_link( path: *const ::c_char, attrnamespace: ::c_int, attrname: *const ::c_char, data: *const ::c_void, nbytes: ::size_t, ) -> ::ssize_t1358     pub fn extattr_set_link(
1359         path: *const ::c_char,
1360         attrnamespace: ::c_int,
1361         attrname: *const ::c_char,
1362         data: *const ::c_void,
1363         nbytes: ::size_t,
1364     ) -> ::ssize_t;
1365 
jail(jail: *mut ::jail) -> ::c_int1366     pub fn jail(jail: *mut ::jail) -> ::c_int;
jail_attach(jid: ::c_int) -> ::c_int1367     pub fn jail_attach(jid: ::c_int) -> ::c_int;
jail_remove(jid: ::c_int) -> ::c_int1368     pub fn jail_remove(jid: ::c_int) -> ::c_int;
jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int1369     pub fn jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int1370     pub fn jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
1371 
lio_listio( mode: ::c_int, aiocb_list: *const *mut aiocb, nitems: ::c_int, sevp: *mut sigevent, ) -> ::c_int1372     pub fn lio_listio(
1373         mode: ::c_int,
1374         aiocb_list: *const *mut aiocb,
1375         nitems: ::c_int,
1376         sevp: *mut sigevent,
1377     ) -> ::c_int;
1378 
posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int1379     pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int1380     pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int1381     pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int1382     pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
1383 
getutxuser(user: *const ::c_char) -> *mut utmpx1384     pub fn getutxuser(user: *const ::c_char) -> *mut utmpx;
setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int1385     pub fn setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int;
1386 
aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t1387     pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t;
mq_getfd_np(mqd: ::mqd_t) -> ::c_int1388     pub fn mq_getfd_np(mqd: ::mqd_t) -> ::c_int;
1389 
waitid( idtype: idtype_t, id: ::id_t, infop: *mut ::siginfo_t, options: ::c_int, ) -> ::c_int1390     pub fn waitid(
1391         idtype: idtype_t,
1392         id: ::id_t,
1393         infop: *mut ::siginfo_t,
1394         options: ::c_int,
1395     ) -> ::c_int;
1396 
ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t1397     pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int1398     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_void1399     pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
shmdt(shmaddr: *const ::c_void) -> ::c_int1400     pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int1401     pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int1402     pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int;
msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int1403     pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
msgsnd( msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t, msgflg: ::c_int, ) -> ::c_int1404     pub fn msgsnd(
1405         msqid: ::c_int,
1406         msgp: *const ::c_void,
1407         msgsz: ::size_t,
1408         msgflg: ::c_int,
1409     ) -> ::c_int;
cfmakesane(termios: *mut ::termios)1410     pub fn cfmakesane(termios: *mut ::termios);
fexecve( fd: ::c_int, argv: *const *const ::c_char, envp: *const *const ::c_char, ) -> ::c_int1411     pub fn fexecve(
1412         fd: ::c_int,
1413         argv: *const *const ::c_char,
1414         envp: *const *const ::c_char,
1415     ) -> ::c_int;
1416 
pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t1417     pub fn pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t;
pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int1418     pub fn pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int;
pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int1419     pub fn pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int;
1420 
rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int1421     pub fn rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int;
1422 
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_int1423     pub fn posix_spawn(
1424         pid: *mut ::pid_t,
1425         path: *const ::c_char,
1426         file_actions: *const ::posix_spawn_file_actions_t,
1427         attrp: *const ::posix_spawnattr_t,
1428         argv: *const *mut ::c_char,
1429         envp: *const *mut ::c_char,
1430     ) -> ::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_int1431     pub fn posix_spawnp(
1432         pid: *mut ::pid_t,
1433         file: *const ::c_char,
1434         file_actions: *const ::posix_spawn_file_actions_t,
1435         attrp: *const ::posix_spawnattr_t,
1436         argv: *const *mut ::c_char,
1437         envp: *const *mut ::c_char,
1438     ) -> ::c_int;
posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int1439     pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int1440     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_int1441     pub fn posix_spawnattr_getsigdefault(
1442         attr: *const posix_spawnattr_t,
1443         default: *mut ::sigset_t,
1444     ) -> ::c_int;
posix_spawnattr_setsigdefault( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int1445     pub fn posix_spawnattr_setsigdefault(
1446         attr: *mut posix_spawnattr_t,
1447         default: *const ::sigset_t,
1448     ) -> ::c_int;
posix_spawnattr_getsigmask( attr: *const posix_spawnattr_t, default: *mut ::sigset_t, ) -> ::c_int1449     pub fn posix_spawnattr_getsigmask(
1450         attr: *const posix_spawnattr_t,
1451         default: *mut ::sigset_t,
1452     ) -> ::c_int;
posix_spawnattr_setsigmask( attr: *mut posix_spawnattr_t, default: *const ::sigset_t, ) -> ::c_int1453     pub fn posix_spawnattr_setsigmask(
1454         attr: *mut posix_spawnattr_t,
1455         default: *const ::sigset_t,
1456     ) -> ::c_int;
posix_spawnattr_getflags( attr: *const posix_spawnattr_t, flags: *mut ::c_short, ) -> ::c_int1457     pub fn posix_spawnattr_getflags(
1458         attr: *const posix_spawnattr_t,
1459         flags: *mut ::c_short,
1460     ) -> ::c_int;
posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int1461     pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
posix_spawnattr_getpgroup( attr: *const posix_spawnattr_t, flags: *mut ::pid_t, ) -> ::c_int1462     pub fn posix_spawnattr_getpgroup(
1463         attr: *const posix_spawnattr_t,
1464         flags: *mut ::pid_t,
1465     ) -> ::c_int;
posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int1466     pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
posix_spawnattr_getschedpolicy( attr: *const posix_spawnattr_t, flags: *mut ::c_int, ) -> ::c_int1467     pub fn posix_spawnattr_getschedpolicy(
1468         attr: *const posix_spawnattr_t,
1469         flags: *mut ::c_int,
1470     ) -> ::c_int;
posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int1471     pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
posix_spawnattr_getschedparam( attr: *const posix_spawnattr_t, param: *mut ::sched_param, ) -> ::c_int1472     pub fn posix_spawnattr_getschedparam(
1473         attr: *const posix_spawnattr_t,
1474         param: *mut ::sched_param,
1475     ) -> ::c_int;
posix_spawnattr_setschedparam( attr: *mut posix_spawnattr_t, param: *const ::sched_param, ) -> ::c_int1476     pub fn posix_spawnattr_setschedparam(
1477         attr: *mut posix_spawnattr_t,
1478         param: *const ::sched_param,
1479     ) -> ::c_int;
1480 
posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int1481     pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int1482     pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::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_int1483     pub fn posix_spawn_file_actions_addopen(
1484         actions: *mut posix_spawn_file_actions_t,
1485         fd: ::c_int,
1486         path: *const ::c_char,
1487         oflag: ::c_int,
1488         mode: ::mode_t,
1489     ) -> ::c_int;
posix_spawn_file_actions_addclose( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, ) -> ::c_int1490     pub fn posix_spawn_file_actions_addclose(
1491         actions: *mut posix_spawn_file_actions_t,
1492         fd: ::c_int,
1493     ) -> ::c_int;
posix_spawn_file_actions_adddup2( actions: *mut posix_spawn_file_actions_t, fd: ::c_int, newfd: ::c_int, ) -> ::c_int1494     pub fn posix_spawn_file_actions_adddup2(
1495         actions: *mut posix_spawn_file_actions_t,
1496         fd: ::c_int,
1497         newfd: ::c_int,
1498     ) -> ::c_int;
1499 
1500     #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "statfs@FBSD_1.0")]
statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int1501     pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
1502     #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "fstatfs@FBSD_1.0")]
fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int1503     pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
1504 
dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int1505     pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
__xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int1506     pub fn __xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int;
1507 
sendmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, flags: ::c_int, ) -> ::ssize_t1508     pub fn sendmmsg(
1509         sockfd: ::c_int,
1510         msgvec: *mut ::mmsghdr,
1511         vlen: ::size_t,
1512         flags: ::c_int,
1513     ) -> ::ssize_t;
recvmmsg( sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::size_t, flags: ::c_int, timeout: *const ::timespec, ) -> ::ssize_t1514     pub fn recvmmsg(
1515         sockfd: ::c_int,
1516         msgvec: *mut ::mmsghdr,
1517         vlen: ::size_t,
1518         flags: ::c_int,
1519         timeout: *const ::timespec,
1520     ) -> ::ssize_t;
memmem( haystack: *const ::c_void, haystacklen: ::size_t, needle: *const ::c_void, needlelen: ::size_t, ) -> *mut ::c_void1521     pub fn memmem(
1522         haystack: *const ::c_void,
1523         haystacklen: ::size_t,
1524         needle: *const ::c_void,
1525         needlelen: ::size_t,
1526     ) -> *mut ::c_void;
1527 
nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int1528     pub fn nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
1529 }
1530 
1531 #[link(name = "util")]
1532 extern "C" {
extattr_namespace_to_string( attrnamespace: ::c_int, string: *mut *mut ::c_char, ) -> ::c_int1533     pub fn extattr_namespace_to_string(
1534         attrnamespace: ::c_int,
1535         string: *mut *mut ::c_char,
1536     ) -> ::c_int;
extattr_string_to_namespace( string: *const ::c_char, attrnamespace: *mut ::c_int, ) -> ::c_int1537     pub fn extattr_string_to_namespace(
1538         string: *const ::c_char,
1539         attrnamespace: *mut ::c_int,
1540     ) -> ::c_int;
1541 }
1542 
1543 cfg_if! {
1544     if #[cfg(freebsd13)] {
1545         mod freebsd13;
1546         pub use self::freebsd13::*;
1547     } else if #[cfg(freebsd12)] {
1548         mod freebsd12;
1549         pub use self::freebsd12::*;
1550     } else if #[cfg(any(freebsd10, freebsd11))] {
1551         mod freebsd11;
1552         pub use self::freebsd11::*;
1553     } else {
1554         // Unknown freebsd version
1555     }
1556 }
1557 
1558 cfg_if! {
1559     if #[cfg(target_arch = "x86")] {
1560         mod x86;
1561         pub use self::x86::*;
1562     } else if #[cfg(target_arch = "x86_64")] {
1563         mod x86_64;
1564         pub use self::x86_64::*;
1565     } else if #[cfg(target_arch = "aarch64")] {
1566         mod aarch64;
1567         pub use self::aarch64::*;
1568     } else if #[cfg(target_arch = "arm")] {
1569         mod arm;
1570         pub use self::arm::*;
1571     } else if #[cfg(target_arch = "powerpc64")] {
1572         mod powerpc64;
1573         pub use self::powerpc64::*;
1574     } else {
1575         // Unknown target_arch
1576     }
1577 }
1578