1 pub type clock_t
= ::c_uint
;
2 pub type suseconds_t
= ::c_int
;
4 pub type blksize_t
= ::int32_t
;
5 pub type fsblkcnt_t
= ::uint64_t
;
6 pub type fsfilcnt_t
= ::uint64_t
;
7 pub type idtype_t
= ::c_int
;
8 pub type mqd_t
= ::c_int
;
9 type __pthread_spin_t
= __cpu_simple_lock_nv_t
;
10 pub type vm_size_t
= ::uintptr_t
;
14 pub aio_offset
: ::off_t
,
15 pub aio_buf
: *mut ::c_void
,
16 pub aio_nbytes
: ::size_t
,
17 pub aio_fildes
: ::c_int
,
18 pub aio_lio_opcode
: ::c_int
,
19 pub aio_reqprio
: ::c_int
,
20 pub aio_sigevent
: ::sigevent
,
27 pub gl_pathc
: ::size_t
,
28 pub gl_matchc
: ::size_t
,
29 pub gl_offs
: ::size_t
,
30 pub gl_flags
: ::c_int
,
31 pub gl_pathv
: *mut *mut ::c_char
,
33 __unused3
: *mut ::c_void
,
35 __unused4
: *mut ::c_void
,
36 __unused5
: *mut ::c_void
,
37 __unused6
: *mut ::c_void
,
38 __unused7
: *mut ::c_void
,
39 __unused8
: *mut ::c_void
,
43 pub mq_flags
: ::c_long
,
44 pub mq_maxmsg
: ::c_long
,
45 pub mq_msgsize
: ::c_long
,
46 pub mq_curmsgs
: ::c_long
,
50 pub sigev_notify
: ::c_int
,
51 pub sigev_signo
: ::c_int
,
52 pub sigev_value
: ::sigval
,
53 __unused1
: *mut ::c_void
, //actually a function pointer
54 pub sigev_notify_attributes
: *mut ::c_void
63 pub st_mode
: ::mode_t
,
65 pub st_nlink
: ::nlink_t
,
69 pub st_atime
: ::time_t
,
70 pub st_atimensec
: ::c_long
,
71 pub st_mtime
: ::time_t
,
72 pub st_mtimensec
: ::c_long
,
73 pub st_ctime
: ::time_t
,
74 pub st_ctimensec
: ::c_long
,
75 pub st_birthtime
: ::time_t
,
76 pub st_birthtimensec
: ::c_long
,
78 pub st_blocks
: ::blkcnt_t
,
79 pub st_blksize
: ::blksize_t
,
80 pub st_flags
: ::uint32_t
,
81 pub st_gen
: ::uint32_t
,
82 pub st_spare
: [::uint32_t
; 2],
86 pub ai_flags
: ::c_int
,
87 pub ai_family
: ::c_int
,
88 pub ai_socktype
: ::c_int
,
89 pub ai_protocol
: ::c_int
,
90 pub ai_addrlen
: ::socklen_t
,
91 pub ai_canonname
: *mut ::c_char
,
92 pub ai_addr
: *mut ::sockaddr
,
93 pub ai_next
: *mut ::addrinfo
,
96 pub struct siginfo_t
{
97 pub si_signo
: ::c_int
,
99 pub si_errno
: ::c_int
,
101 pub si_addr
: *mut ::c_void
,
105 pub struct pthread_attr_t
{
108 pta_private
: *mut ::c_void
,
111 pub struct pthread_mutex_t
{
113 ptm_errorcheck
: __pthread_spin_t
,
114 #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
115 target_arch
= "x86", target_arch
= "x86_64"))]
117 // actually a union with a non-unused, 0-initialized field
118 ptm_unused
: __pthread_spin_t
,
119 #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
120 target_arch
= "x86", target_arch
= "x86_64"))]
122 ptm_owner
: ::pthread_t
,
123 ptm_waiters
: *mut u8,
124 ptm_recursed
: ::c_uint
,
125 ptm_spare2
: *mut ::c_void
,
128 pub struct pthread_mutexattr_t
{
129 ptma_magic
: ::c_uint
,
130 ptma_private
: *mut ::c_void
,
133 pub struct pthread_rwlockattr_t
{
134 ptra_magic
: ::c_uint
,
135 ptra_private
: *mut ::c_void
,
138 pub struct pthread_cond_t
{
140 ptc_lock
: __pthread_spin_t
,
141 ptc_waiters_first
: *mut u8,
142 ptc_waiters_last
: *mut u8,
143 ptc_mutex
: *mut ::pthread_mutex_t
,
144 ptc_private
: *mut ::c_void
,
147 pub struct pthread_condattr_t
{
148 ptca_magic
: ::c_uint
,
149 ptca_private
: *mut ::c_void
,
152 pub struct pthread_rwlock_t
{
154 ptr_interlock
: __pthread_spin_t
,
155 ptr_rblocked_first
: *mut u8,
156 ptr_rblocked_last
: *mut u8,
157 ptr_wblocked_first
: *mut u8,
158 ptr_wblocked_last
: *mut u8,
159 ptr_nreaders
: ::c_uint
,
160 ptr_owner
: ::pthread_t
,
161 ptr_private
: *mut ::c_void
,
165 pub ident
: ::uintptr_t
,
166 pub filter
: ::uint32_t
,
167 pub flags
: ::uint32_t
,
168 pub fflags
: ::uint32_t
,
170 pub udata
: ::intptr_t
,
174 pub dqb_bhardlimit
: ::uint32_t
,
175 pub dqb_bsoftlimit
: ::uint32_t
,
176 pub dqb_curblocks
: ::uint32_t
,
177 pub dqb_ihardlimit
: ::uint32_t
,
178 pub dqb_isoftlimit
: ::uint32_t
,
179 pub dqb_curinodes
: ::uint32_t
,
180 pub dqb_btime
: ::int32_t
,
181 pub dqb_itime
: ::int32_t
,
185 pub dli_fname
: *const ::c_char
,
186 pub dli_fbase
: *mut ::c_void
,
187 pub dli_sname
: *const ::c_char
,
188 pub dli_saddr
: *const ::c_void
,
192 pub decimal_point
: *mut ::c_char
,
193 pub thousands_sep
: *mut ::c_char
,
194 pub grouping
: *mut ::c_char
,
195 pub int_curr_symbol
: *mut ::c_char
,
196 pub currency_symbol
: *mut ::c_char
,
197 pub mon_decimal_point
: *mut ::c_char
,
198 pub mon_thousands_sep
: *mut ::c_char
,
199 pub mon_grouping
: *mut ::c_char
,
200 pub positive_sign
: *mut ::c_char
,
201 pub negative_sign
: *mut ::c_char
,
202 pub int_frac_digits
: ::c_char
,
203 pub frac_digits
: ::c_char
,
204 pub p_cs_precedes
: ::c_char
,
205 pub p_sep_by_space
: ::c_char
,
206 pub n_cs_precedes
: ::c_char
,
207 pub n_sep_by_space
: ::c_char
,
208 pub p_sign_posn
: ::c_char
,
209 pub n_sign_posn
: ::c_char
,
210 pub int_p_cs_precedes
: ::c_char
,
211 pub int_n_cs_precedes
: ::c_char
,
212 pub int_p_sep_by_space
: ::c_char
,
213 pub int_n_sep_by_space
: ::c_char
,
214 pub int_p_sign_posn
: ::c_char
,
215 pub int_n_sign_posn
: ::c_char
,
219 pub ifi_type
: ::c_uchar
,
220 pub ifi_addrlen
: ::c_uchar
,
221 pub ifi_hdrlen
: ::c_uchar
,
222 pub ifi_link_state
: ::c_int
,
225 pub ifi_baudrate
: u64,
226 pub ifi_ipackets
: u64,
227 pub ifi_ierrors
: u64,
228 pub ifi_opackets
: u64,
229 pub ifi_oerrors
: u64,
230 pub ifi_collisions
: u64,
233 pub ifi_imcasts
: u64,
234 pub ifi_omcasts
: u64,
235 pub ifi_iqdrops
: u64,
236 pub ifi_noproto
: u64,
237 pub ifi_lastchange
: ::timespec
,
240 pub struct if_msghdr
{
241 pub ifm_msglen
: ::c_ushort
,
242 pub ifm_version
: ::c_uchar
,
243 pub ifm_type
: ::c_uchar
,
244 pub ifm_addrs
: ::c_int
,
245 pub ifm_flags
: ::c_int
,
246 pub ifm_index
: ::c_ushort
,
247 pub ifm_data
: if_data
,
250 pub struct sockcred
{
253 pub sc_euid
: ::uid_t
,
255 pub sc_egid
: ::gid_t
,
256 pub sc_ngroups
: ::c_int
,
257 pub sc_groups
: [::gid_t
; 1],
260 pub struct sockaddr_dl
{
261 pub sdl_len
: ::c_uchar
,
262 pub sdl_family
: ::c_uchar
,
263 pub sdl_index
: ::c_ushort
,
264 pub sdl_type
: ::uint8_t
,
265 pub sdl_nlen
: ::uint8_t
,
266 pub sdl_alen
: ::uint8_t
,
267 pub sdl_slen
: ::uint8_t
,
268 pub sdl_data
: [::c_char
; 12],
272 pub msg_hdr
: ::msghdr
,
273 pub msg_len
: ::c_uint
,
278 pub struct in_pktinfo
{
279 pub ipi_addr
: ::in_addr
,
280 pub ipi_ifindex
: ::c_uint
,
294 pub s_addr
: ::in_addr_t
,
298 pub imr_multiaddr
: in_addr
,
299 pub imr_interface
: in_addr
,
302 pub struct sockaddr_in
{
304 pub sin_family
: ::sa_family_t
,
305 pub sin_port
: ::in_port_t
,
306 pub sin_addr
: ::in_addr
,
307 pub sin_zero
: [::int8_t
; 8],
311 pub d_fileno
: ::ino_t
,
315 pub d_name
: [::c_char
; 512],
319 pub f_flag
: ::c_ulong
,
320 pub f_bsize
: ::c_ulong
,
321 pub f_frsize
: ::c_ulong
,
322 pub f_iosize
: ::c_ulong
,
324 pub f_blocks
: ::fsblkcnt_t
,
325 pub f_bfree
: ::fsblkcnt_t
,
326 pub f_bavail
: ::fsblkcnt_t
,
327 pub f_bresvd
: ::fsblkcnt_t
,
329 pub f_files
: ::fsfilcnt_t
,
330 pub f_ffree
: ::fsfilcnt_t
,
331 pub f_favail
: ::fsfilcnt_t
,
332 pub f_fresvd
: ::fsfilcnt_t
,
334 pub f_syncreads
: ::uint64_t
,
335 pub f_syncwrites
: ::uint64_t
,
337 pub f_asyncreads
: ::uint64_t
,
338 pub f_asyncwrites
: ::uint64_t
,
340 pub f_fsidx
: ::fsid_t
,
341 pub f_fsid
: ::c_ulong
,
342 pub f_namemax
: ::c_ulong
,
343 pub f_owner
: ::uid_t
,
345 pub f_spare
: [::uint32_t
; 4],
347 pub f_fstypename
: [::c_char
; 32],
348 pub f_mntonname
: [::c_char
; 1024],
349 pub f_mntfromname
: [::c_char
; 1024],
352 pub struct sockaddr_storage
{
354 pub ss_family
: ::sa_family_t
,
357 __ss_pad3
: [u8; 112],
362 if #[cfg(feature = "extra_traits")] {
363 impl PartialEq
for in_pktinfo
{
364 fn eq(&self, other
: &in_pktinfo
) -> bool
{
365 self.ipi_addr
== other
.ipi_addr
366 && self.ipi_ifindex
== other
.ipi_ifindex
369 impl Eq
for in_pktinfo {}
370 impl ::fmt
::Debug
for in_pktinfo
{
371 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
372 f
.debug_struct("in_pktinfo")
373 .field("ipi_addr", &self.ipi_addr
)
374 .field("ipi_ifindex", &self.ipi_ifindex
)
378 impl ::hash
::Hash
for in_pktinfo
{
379 fn hash
<H
: ::hash
::Hasher
>(&self, state
: &mut H
) {
380 self.ipi_addr
.hash(state
);
381 self.ipi_ifindex
.hash(state
);
385 impl PartialEq
for arphdr
{
386 fn eq(&self, other
: &arphdr
) -> bool
{
387 self.ar_hrd
== other
.ar_hrd
388 && self.ar_pro
== other
.ar_pro
389 && self.ar_hln
== other
.ar_hln
390 && self.ar_pln
== other
.ar_pln
391 && self.ar_op
== other
.ar_op
394 impl Eq
for arphdr {}
395 impl ::fmt
::Debug
for arphdr
{
396 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
397 let ar_hrd
= self.ar_hrd
;
398 let ar_pro
= self.ar_pro
;
399 let ar_op
= self.ar_op
;
400 f
.debug_struct("arphdr")
401 .field("ar_hrd", &ar_hrd
)
402 .field("ar_pro", &ar_pro
)
403 .field("ar_hln", &self.ar_hln
)
404 .field("ar_pln", &self.ar_pln
)
405 .field("ar_op", &ar_op
)
409 impl ::hash
::Hash
for arphdr
{
410 fn hash
<H
: ::hash
::Hasher
>(&self, state
: &mut H
) {
411 let ar_hrd
= self.ar_hrd
;
412 let ar_pro
= self.ar_pro
;
413 let ar_op
= self.ar_op
;
416 self.ar_hln
.hash(state
);
417 self.ar_pln
.hash(state
);
422 impl PartialEq
for in_addr
{
423 fn eq(&self, other
: &in_addr
) -> bool
{
424 self.s_addr
== other
.s_addr
427 impl Eq
for in_addr {}
428 impl ::fmt
::Debug
for in_addr
{
429 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
430 let s_addr
= self.s_addr
;
431 f
.debug_struct("in_addr")
432 .field("s_addr", &s_addr
)
436 impl ::hash
::Hash
for in_addr
{
437 fn hash
<H
: ::hash
::Hasher
>(&self, state
: &mut H
) {
438 let s_addr
= self.s_addr
;
443 impl PartialEq
for ip_mreq
{
444 fn eq(&self, other
: &ip_mreq
) -> bool
{
445 self.imr_multiaddr
== other
.imr_multiaddr
446 && self.imr_interface
== other
.imr_interface
449 impl Eq
for ip_mreq {}
450 impl ::fmt
::Debug
for ip_mreq
{
451 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
452 f
.debug_struct("ip_mreq")
453 .field("imr_multiaddr", &self.imr_multiaddr
)
454 .field("imr_interface", &self.imr_interface
)
458 impl ::hash
::Hash
for ip_mreq
{
459 fn hash
<H
: ::hash
::Hasher
>(&self, state
: &mut H
) {
460 self.imr_multiaddr
.hash(state
);
461 self.imr_interface
.hash(state
);
465 impl PartialEq
for sockaddr_in
{
466 fn eq(&self, other
: &sockaddr_in
) -> bool
{
467 self.sin_len
== other
.sin_len
468 && self.sin_family
== other
.sin_family
469 && self.sin_port
== other
.sin_port
470 && self.sin_addr
== other
.sin_addr
471 && self.sin_zero
== other
.sin_zero
474 impl Eq
for sockaddr_in {}
475 impl ::fmt
::Debug
for sockaddr_in
{
476 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
477 f
.debug_struct("sockaddr_in")
478 .field("sin_len", &self.sin_len
)
479 .field("sin_family", &self.sin_family
)
480 .field("sin_port", &self.sin_port
)
481 .field("sin_addr", &self.sin_addr
)
482 .field("sin_zero", &self.sin_zero
)
486 impl ::hash
::Hash
for sockaddr_in
{
487 fn hash
<H
: ::hash
::Hasher
>(&self, state
: &mut H
) {
488 self.sin_len
.hash(state
);
489 self.sin_family
.hash(state
);
490 self.sin_port
.hash(state
);
491 self.sin_addr
.hash(state
);
492 self.sin_zero
.hash(state
);
496 impl PartialEq
for dirent
{
497 fn eq(&self, other
: &dirent
) -> bool
{
498 self.d_fileno
== other
.d_fileno
499 && self.d_reclen
== other
.d_reclen
500 && self.d_namlen
== other
.d_namlen
501 && self.d_type
== other
.d_type
505 .zip(other
.d_name
.iter())
509 impl Eq
for dirent {}
510 impl ::fmt
::Debug
for dirent
{
511 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
512 f
.debug_struct("dirent")
513 .field("d_fileno", &self.d_fileno
)
514 .field("d_reclen", &self.d_reclen
)
515 .field("d_namlen", &self.d_namlen
)
516 .field("d_type", &self.d_type
)
517 // FIXME: .field("d_name", &self.d_name)
521 impl ::hash
::Hash
for dirent
{
522 fn hash
<H
: ::hash
::Hasher
>(&self, state
: &mut H
) {
523 self.d_fileno
.hash(state
);
524 self.d_reclen
.hash(state
);
525 self.d_namlen
.hash(state
);
526 self.d_type
.hash(state
);
527 self.d_name
.hash(state
);
531 impl PartialEq
for statvfs
{
532 fn eq(&self, other
: &statvfs
) -> bool
{
533 self.f_flag
== other
.f_flag
534 && self.f_bsize
== other
.f_bsize
535 && self.f_frsize
== other
.f_frsize
536 && self.f_iosize
== other
.f_iosize
537 && self.f_blocks
== other
.f_blocks
538 && self.f_bfree
== other
.f_bfree
539 && self.f_bavail
== other
.f_bavail
540 && self.f_bresvd
== other
.f_bresvd
541 && self.f_files
== other
.f_files
542 && self.f_ffree
== other
.f_ffree
543 && self.f_favail
== other
.f_favail
544 && self.f_fresvd
== other
.f_fresvd
545 && self.f_syncreads
== other
.f_syncreads
546 && self.f_syncwrites
== other
.f_syncwrites
547 && self.f_asyncreads
== other
.f_asyncreads
548 && self.f_asyncwrites
== other
.f_asyncwrites
549 && self.f_fsidx
== other
.f_fsidx
550 && self.f_fsid
== other
.f_fsid
551 && self.f_namemax
== other
.f_namemax
552 && self.f_owner
== other
.f_owner
553 && self.f_spare
== other
.f_spare
554 && self.f_fstypename
== other
.f_fstypename
558 .zip(other
.f_mntonname
.iter())
563 .zip(other
.f_mntfromname
.iter())
567 impl Eq
for statvfs {}
568 impl ::fmt
::Debug
for statvfs
{
569 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
570 f
.debug_struct("statvfs")
571 .field("f_flag", &self.f_flag
)
572 .field("f_bsize", &self.f_bsize
)
573 .field("f_frsize", &self.f_frsize
)
574 .field("f_iosize", &self.f_iosize
)
575 .field("f_blocks", &self.f_blocks
)
576 .field("f_bfree", &self.f_bfree
)
577 .field("f_bavail", &self.f_bavail
)
578 .field("f_bresvd", &self.f_bresvd
)
579 .field("f_files", &self.f_files
)
580 .field("f_ffree", &self.f_ffree
)
581 .field("f_favail", &self.f_favail
)
582 .field("f_fresvd", &self.f_fresvd
)
583 .field("f_syncreads", &self.f_syncreads
)
584 .field("f_syncwrites", &self.f_syncwrites
)
585 .field("f_asyncreads", &self.f_asyncreads
)
586 .field("f_asyncwrites", &self.f_asyncwrites
)
587 .field("f_fsidx", &self.f_fsidx
)
588 .field("f_fsid", &self.f_fsid
)
589 .field("f_namemax", &self.f_namemax
)
590 .field("f_owner", &self.f_owner
)
591 .field("f_spare", &self.f_spare
)
592 .field("f_fstypename", &self.f_fstypename
)
593 // FIXME: .field("f_mntonname", &self.f_mntonname)
594 // FIXME: .field("f_mntfromname", &self.f_mntfromname)
598 impl ::hash
::Hash
for statvfs
{
599 fn hash
<H
: ::hash
::Hasher
>(&self, state
: &mut H
) {
600 self.f_flag
.hash(state
);
601 self.f_bsize
.hash(state
);
602 self.f_frsize
.hash(state
);
603 self.f_iosize
.hash(state
);
604 self.f_blocks
.hash(state
);
605 self.f_bfree
.hash(state
);
606 self.f_bavail
.hash(state
);
607 self.f_bresvd
.hash(state
);
608 self.f_files
.hash(state
);
609 self.f_ffree
.hash(state
);
610 self.f_favail
.hash(state
);
611 self.f_fresvd
.hash(state
);
612 self.f_syncreads
.hash(state
);
613 self.f_syncwrites
.hash(state
);
614 self.f_asyncreads
.hash(state
);
615 self.f_asyncwrites
.hash(state
);
616 self.f_fsidx
.hash(state
);
617 self.f_fsid
.hash(state
);
618 self.f_namemax
.hash(state
);
619 self.f_owner
.hash(state
);
620 self.f_spare
.hash(state
);
621 self.f_fstypename
.hash(state
);
622 self.f_mntonname
.hash(state
);
623 self.f_mntfromname
.hash(state
);
627 impl PartialEq
for sockaddr_storage
{
628 fn eq(&self, other
: &sockaddr_storage
) -> bool
{
629 self.ss_len
== other
.ss_len
630 && self.ss_family
== other
.ss_family
631 && self.__ss_pad1
== other
.__ss_pad1
632 && self.__ss_pad2
== other
.__ss_pad2
636 .zip(other
.__ss_pad3
.iter())
640 impl Eq
for sockaddr_storage {}
641 impl ::fmt
::Debug
for sockaddr_storage
{
642 fn fmt(&self, f
: &mut ::fmt
::Formatter
) -> ::fmt
::Result
{
643 f
.debug_struct("sockaddr_storage")
644 .field("ss_len", &self.ss_len
)
645 .field("ss_family", &self.ss_family
)
646 .field("__ss_pad1", &self.__ss_pad1
)
647 .field("__ss_pad2", &self.__ss_pad2
)
648 // FIXME: .field("__ss_pad3", &self.__ss_pad3)
652 impl ::hash
::Hash
for sockaddr_storage
{
653 fn hash
<H
: ::hash
::Hasher
>(&self, state
: &mut H
) {
654 self.ss_len
.hash(state
);
655 self.ss_family
.hash(state
);
656 self.__ss_pad1
.hash(state
);
657 self.__ss_pad2
.hash(state
);
658 self.__ss_pad3
.hash(state
);
664 pub const AT_FDCWD
: ::c_int
= -100;
665 pub const AT_EACCESS
: ::c_int
= 0x100;
666 pub const AT_SYMLINK_NOFOLLOW
: ::c_int
= 0x200;
667 pub const AT_SYMLINK_FOLLOW
: ::c_int
= 0x400;
668 pub const AT_REMOVEDIR
: ::c_int
= 0x800;
670 pub const EXTATTR_NAMESPACE_USER
: ::c_int
= 1;
671 pub const EXTATTR_NAMESPACE_SYSTEM
: ::c_int
= 2;
673 pub const LC_COLLATE_MASK
: ::c_int
= (1 << ::LC_COLLATE
);
674 pub const LC_CTYPE_MASK
: ::c_int
= (1 << ::LC_CTYPE
);
675 pub const LC_MONETARY_MASK
: ::c_int
= (1 << ::LC_MONETARY
);
676 pub const LC_NUMERIC_MASK
: ::c_int
= (1 << ::LC_NUMERIC
);
677 pub const LC_TIME_MASK
: ::c_int
= (1 << ::LC_TIME
);
678 pub const LC_MESSAGES_MASK
: ::c_int
= (1 << ::LC_MESSAGES
);
679 pub const LC_ALL_MASK
: ::c_int
= !0;
681 pub const ERA
: ::nl_item
= 52;
682 pub const ERA_D_FMT
: ::nl_item
= 53;
683 pub const ERA_D_T_FMT
: ::nl_item
= 54;
684 pub const ERA_T_FMT
: ::nl_item
= 55;
685 pub const ALT_DIGITS
: ::nl_item
= 56;
687 pub const O_CLOEXEC
: ::c_int
= 0x400000;
688 pub const O_ALT_IO
: ::c_int
= 0x40000;
689 pub const O_NOSIGPIPE
: ::c_int
= 0x1000000;
690 pub const O_SEARCH
: ::c_int
= 0x800000;
691 pub const O_DIRECTORY
: ::c_int
= 0x200000;
692 pub const O_DIRECT
: ::c_int
= 0x00080000;
693 pub const O_RSYNC
: ::c_int
= 0x00020000;
695 pub const MS_SYNC
: ::c_int
= 0x4;
696 pub const MS_INVALIDATE
: ::c_int
= 0x2;
698 pub const RLIM_NLIMITS
: ::c_int
= 12;
700 pub const EIDRM
: ::c_int
= 82;
701 pub const ENOMSG
: ::c_int
= 83;
702 pub const EOVERFLOW
: ::c_int
= 84;
703 pub const EILSEQ
: ::c_int
= 85;
704 pub const ENOTSUP
: ::c_int
= 86;
705 pub const ECANCELED
: ::c_int
= 87;
706 pub const EBADMSG
: ::c_int
= 88;
707 pub const ENODATA
: ::c_int
= 89;
708 pub const ENOSR
: ::c_int
= 90;
709 pub const ENOSTR
: ::c_int
= 91;
710 pub const ETIME
: ::c_int
= 92;
711 pub const ENOATTR
: ::c_int
= 93;
712 pub const EMULTIHOP
: ::c_int
= 94;
713 pub const ENOLINK
: ::c_int
= 95;
714 pub const EPROTO
: ::c_int
= 96;
715 pub const ELAST
: ::c_int
= 96;
717 pub const F_DUPFD_CLOEXEC
: ::c_int
= 12;
718 pub const F_CLOSEM
: ::c_int
= 10;
719 pub const F_GETNOSIGPIPE
: ::c_int
= 13;
720 pub const F_SETNOSIGPIPE
: ::c_int
= 14;
721 pub const F_MAXFD
: ::c_int
= 11;
723 pub const IP_RECVDSTADDR
: ::c_int
= 7;
724 pub const IP_SENDSRCADDR
: ::c_int
= IP_RECVDSTADDR
;
725 pub const IP_RECVIF
: ::c_int
= 20;
726 pub const IP_PKTINFO
: ::c_int
= 25;
727 pub const IP_RECVPKTINFO
: ::c_int
= 26;
728 pub const IPV6_JOIN_GROUP
: ::c_int
= 12;
729 pub const IPV6_LEAVE_GROUP
: ::c_int
= 13;
731 pub const TCP_KEEPIDLE
: ::c_int
= 3;
732 pub const TCP_KEEPINTVL
: ::c_int
= 5;
733 pub const TCP_KEEPCNT
: ::c_int
= 6;
734 pub const TCP_KEEPINIT
: ::c_int
= 7;
735 pub const TCP_INFO
: ::c_int
= 9;
736 pub const TCP_MD5SIG
: ::c_int
= 0x10;
737 pub const TCP_CONGCTL
: ::c_int
= 0x20;
739 pub const SOCK_CONN_DGRAM
: ::c_int
= 6;
740 pub const SOCK_DCCP
: ::c_int
= SOCK_CONN_DGRAM
;
741 pub const SOCK_NOSIGPIPE
: ::c_int
= 0x40000000;
742 pub const SOCK_FLAGS_MASK
: ::c_int
= 0xf0000000;
744 pub const SO_SNDTIMEO
: ::c_int
= 0x100b;
745 pub const SO_RCVTIMEO
: ::c_int
= 0x100c;
746 pub const SO_ACCEPTFILTER
: ::c_int
= 0x1000;
747 pub const SO_TIMESTAMP
: ::c_int
= 0x2000;
748 pub const SO_OVERFLOWED
: ::c_int
= 0x1009;
749 pub const SO_NOHEADER
: ::c_int
= 0x100a;
751 // https://github.com/NetBSD/src/blob/trunk/sys/net/if.h#L373
752 pub const IFF_UP
: ::c_int
= 0x0001; // interface is up
753 pub const IFF_BROADCAST
: ::c_int
= 0x0002; // broadcast address valid
754 pub const IFF_DEBUG
: ::c_int
= 0x0004; // turn on debugging
755 pub const IFF_LOOPBACK
: ::c_int
= 0x0008; // is a loopback net
756 pub const IFF_POINTOPOINT
: ::c_int
= 0x0010; // interface is point-to-point link
757 pub const IFF_NOTRAILERS
: ::c_int
= 0x0020; // avoid use of trailers
758 pub const IFF_RUNNING
: ::c_int
= 0x0040; // resources allocated
759 pub const IFF_NOARP
: ::c_int
= 0x0080; // no address resolution protocol
760 pub const IFF_PROMISC
: ::c_int
= 0x0100; // receive all packets
761 pub const IFF_ALLMULTI
: ::c_int
= 0x0200; // receive all multicast packets
762 pub const IFF_OACTIVE
: ::c_int
= 0x0400; // transmission in progress
763 pub const IFF_SIMPLEX
: ::c_int
= 0x0800; // can't hear own transmissions
764 pub const IFF_LINK0
: ::c_int
= 0x1000; // per link layer defined bit
765 pub const IFF_LINK1
: ::c_int
= 0x2000; // per link layer defined bit
766 pub const IFF_LINK2
: ::c_int
= 0x4000; // per link layer defined bit
767 pub const IFF_MULTICAST
: ::c_int
= 0x8000; // supports multicast
770 // Protocols (RFC 1700)
771 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
773 // IPPROTO_IP defined in src/unix/mod.rs
774 /// Hop-by-hop option header
775 pub const IPPROTO_HOPOPTS
: ::c_int
= 0;
776 // IPPROTO_ICMP defined in src/unix/mod.rs
777 /// group mgmt protocol
778 pub const IPPROTO_IGMP
: ::c_int
= 2;
779 /// gateway^2 (deprecated)
780 pub const IPPROTO_GGP
: ::c_int
= 3;
781 /// for compatibility
782 pub const IPPROTO_IPIP
: ::c_int
= 4;
783 // IPPROTO_TCP defined in src/unix/mod.rs
784 /// exterior gateway protocol
785 pub const IPPROTO_EGP
: ::c_int
= 8;
787 pub const IPPROTO_PUP
: ::c_int
= 12;
788 // IPPROTO_UDP defined in src/unix/mod.rs
790 pub const IPPROTO_IDP
: ::c_int
= 22;
791 /// tp-4 w/ class negotiation
792 pub const IPPROTO_TP
: ::c_int
= 29;
794 pub const IPPROTO_DCCP
: ::c_int
= 33;
795 // IPPROTO_IPV6 defined in src/unix/mod.rs
796 /// IP6 routing header
797 pub const IPPROTO_ROUTING
: ::c_int
= 43;
798 /// IP6 fragmentation header
799 pub const IPPROTO_FRAGMENT
: ::c_int
= 44;
800 /// resource reservation
801 pub const IPPROTO_RSVP
: ::c_int
= 46;
802 /// General Routing Encap.
803 pub const IPPROTO_GRE
: ::c_int
= 47;
804 /// IP6 Encap Sec. Payload
805 pub const IPPROTO_ESP
: ::c_int
= 50;
807 pub const IPPROTO_AH
: ::c_int
= 51;
808 /// IP Mobility RFC 2004
809 pub const IPPROTO_MOBILE
: ::c_int
= 55;
811 pub const IPPROTO_IPV6_ICMP
: ::c_int
= 58;
812 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
813 /// IP6 no next header
814 pub const IPPROTO_NONE
: ::c_int
= 59;
815 /// IP6 destination option
816 pub const IPPROTO_DSTOPTS
: ::c_int
= 60;
818 pub const IPPROTO_EON
: ::c_int
= 80;
820 pub const IPPROTO_ETHERIP
: ::c_int
= 97;
821 /// encapsulation header
822 pub const IPPROTO_ENCAP
: ::c_int
= 98;
823 /// Protocol indep. multicast
824 pub const IPPROTO_PIM
: ::c_int
= 103;
825 /// IP Payload Comp. Protocol
826 pub const IPPROTO_IPCOMP
: ::c_int
= 108;
828 pub const IPPROTO_VRRP
: ::c_int
= 112;
829 /// Common Address Resolution Protocol
830 pub const IPPROTO_CARP
: ::c_int
= 112;
832 // TEMP: Disabled for now; this constant was added to NetBSD on 2017-02-16,
833 // but isn't yet supported by the NetBSD rumprun kernel image used for
835 //pub const IPPROTO_L2TP: ::c_int = 115;
837 pub const IPPROTO_SCTP
: ::c_int
= 132;
839 pub const IPPROTO_PFSYNC
: ::c_int
= 240;
840 pub const IPPROTO_MAX
: ::c_int
= 256;
842 /// last return value of *_input(), meaning "all job for this pkt is done".
843 pub const IPPROTO_DONE
: ::c_int
= 257;
845 /// sysctl placeholder for (FAST_)IPSEC
846 pub const CTL_IPPROTO_IPSEC
: ::c_int
= 258;
848 pub const AF_OROUTE
: ::c_int
= 17;
849 pub const AF_ARP
: ::c_int
= 28;
850 pub const pseudo_AF_KEY
: ::c_int
= 29;
851 pub const pseudo_AF_HDRCMPLT
: ::c_int
= 30;
852 pub const AF_BLUETOOTH
: ::c_int
= 31;
853 pub const AF_IEEE80211
: ::c_int
= 32;
854 pub const AF_MPLS
: ::c_int
= 33;
855 pub const AF_ROUTE
: ::c_int
= 34;
856 pub const AF_MAX
: ::c_int
= 36;
858 pub const NET_MAXID
: ::c_int
= AF_MAX
;
859 pub const NET_RT_DUMP
: ::c_int
= 1;
860 pub const NET_RT_FLAGS
: ::c_int
= 2;
861 pub const NET_RT_OOOIFLIST
: ::c_int
= 3;
862 pub const NET_RT_OOIFLIST
: ::c_int
= 4;
863 pub const NET_RT_OIFLIST
: ::c_int
= 5;
864 pub const NET_RT_IFLIST
: ::c_int
= 6;
865 pub const NET_RT_MAXID
: ::c_int
= 7;
867 pub const PF_OROUTE
: ::c_int
= AF_OROUTE
;
868 pub const PF_ARP
: ::c_int
= AF_ARP
;
869 pub const PF_KEY
: ::c_int
= pseudo_AF_KEY
;
870 pub const PF_BLUETOOTH
: ::c_int
= AF_BLUETOOTH
;
871 pub const PF_MPLS
: ::c_int
= AF_MPLS
;
872 pub const PF_ROUTE
: ::c_int
= AF_ROUTE
;
873 pub const PF_MAX
: ::c_int
= AF_MAX
;
875 pub const MSG_NBIO
: ::c_int
= 0x1000;
876 pub const MSG_WAITFORONE
: ::c_int
= 0x2000;
877 pub const MSG_NOTIFICATION
: ::c_int
= 0x4000;
879 pub const SCM_TIMESTAMP
: ::c_int
= 0x08;
880 pub const SCM_CREDS
: ::c_int
= 0x10;
882 pub const O_DSYNC
: ::c_int
= 0x10000;
884 pub const MAP_RENAME
: ::c_int
= 0x20;
885 pub const MAP_NORESERVE
: ::c_int
= 0x40;
886 pub const MAP_HASSEMAPHORE
: ::c_int
= 0x200;
887 pub const MAP_WIRED
: ::c_int
= 0x800;
889 pub const DCCP_TYPE_REQUEST
: ::c_int
= 0;
890 pub const DCCP_TYPE_RESPONSE
: ::c_int
= 1;
891 pub const DCCP_TYPE_DATA
: ::c_int
= 2;
892 pub const DCCP_TYPE_ACK
: ::c_int
= 3;
893 pub const DCCP_TYPE_DATAACK
: ::c_int
= 4;
894 pub const DCCP_TYPE_CLOSEREQ
: ::c_int
= 5;
895 pub const DCCP_TYPE_CLOSE
: ::c_int
= 6;
896 pub const DCCP_TYPE_RESET
: ::c_int
= 7;
897 pub const DCCP_TYPE_MOVE
: ::c_int
= 8;
899 pub const DCCP_FEATURE_CC
: ::c_int
= 1;
900 pub const DCCP_FEATURE_ECN
: ::c_int
= 2;
901 pub const DCCP_FEATURE_ACKRATIO
: ::c_int
= 3;
902 pub const DCCP_FEATURE_ACKVECTOR
: ::c_int
= 4;
903 pub const DCCP_FEATURE_MOBILITY
: ::c_int
= 5;
904 pub const DCCP_FEATURE_LOSSWINDOW
: ::c_int
= 6;
905 pub const DCCP_FEATURE_CONN_NONCE
: ::c_int
= 8;
906 pub const DCCP_FEATURE_IDENTREG
: ::c_int
= 7;
908 pub const DCCP_OPT_PADDING
: ::c_int
= 0;
909 pub const DCCP_OPT_DATA_DISCARD
: ::c_int
= 1;
910 pub const DCCP_OPT_SLOW_RECV
: ::c_int
= 2;
911 pub const DCCP_OPT_BUF_CLOSED
: ::c_int
= 3;
912 pub const DCCP_OPT_CHANGE_L
: ::c_int
= 32;
913 pub const DCCP_OPT_CONFIRM_L
: ::c_int
= 33;
914 pub const DCCP_OPT_CHANGE_R
: ::c_int
= 34;
915 pub const DCCP_OPT_CONFIRM_R
: ::c_int
= 35;
916 pub const DCCP_OPT_INIT_COOKIE
: ::c_int
= 36;
917 pub const DCCP_OPT_NDP_COUNT
: ::c_int
= 37;
918 pub const DCCP_OPT_ACK_VECTOR0
: ::c_int
= 38;
919 pub const DCCP_OPT_ACK_VECTOR1
: ::c_int
= 39;
920 pub const DCCP_OPT_RECV_BUF_DROPS
: ::c_int
= 40;
921 pub const DCCP_OPT_TIMESTAMP
: ::c_int
= 41;
922 pub const DCCP_OPT_TIMESTAMP_ECHO
: ::c_int
= 42;
923 pub const DCCP_OPT_ELAPSEDTIME
: ::c_int
= 43;
924 pub const DCCP_OPT_DATACHECKSUM
: ::c_int
= 44;
926 pub const DCCP_REASON_UNSPEC
: ::c_int
= 0;
927 pub const DCCP_REASON_CLOSED
: ::c_int
= 1;
928 pub const DCCP_REASON_INVALID
: ::c_int
= 2;
929 pub const DCCP_REASON_OPTION_ERR
: ::c_int
= 3;
930 pub const DCCP_REASON_FEA_ERR
: ::c_int
= 4;
931 pub const DCCP_REASON_CONN_REF
: ::c_int
= 5;
932 pub const DCCP_REASON_BAD_SNAME
: ::c_int
= 6;
933 pub const DCCP_REASON_BAD_COOKIE
: ::c_int
= 7;
934 pub const DCCP_REASON_INV_MOVE
: ::c_int
= 8;
935 pub const DCCP_REASON_UNANSW_CH
: ::c_int
= 10;
936 pub const DCCP_REASON_FRUITLESS_NEG
: ::c_int
= 11;
938 pub const DCCP_CCID
: ::c_int
= 1;
939 pub const DCCP_CSLEN
: ::c_int
= 2;
940 pub const DCCP_MAXSEG
: ::c_int
= 4;
941 pub const DCCP_SERVICE
: ::c_int
= 8;
943 pub const DCCP_NDP_LIMIT
: ::c_int
= 16;
944 pub const DCCP_SEQ_NUM_LIMIT
: ::c_int
= 16777216;
945 pub const DCCP_MAX_OPTIONS
: ::c_int
= 32;
946 pub const DCCP_MAX_PKTS
: ::c_int
= 100;
948 pub const _PC_LINK_MAX
: ::c_int
= 1;
949 pub const _PC_MAX_CANON
: ::c_int
= 2;
950 pub const _PC_MAX_INPUT
: ::c_int
= 3;
951 pub const _PC_NAME_MAX
: ::c_int
= 4;
952 pub const _PC_PATH_MAX
: ::c_int
= 5;
953 pub const _PC_PIPE_BUF
: ::c_int
= 6;
954 pub const _PC_CHOWN_RESTRICTED
: ::c_int
= 7;
955 pub const _PC_NO_TRUNC
: ::c_int
= 8;
956 pub const _PC_VDISABLE
: ::c_int
= 9;
957 pub const _PC_SYNC_IO
: ::c_int
= 10;
958 pub const _PC_FILESIZEBITS
: ::c_int
= 11;
959 pub const _PC_SYMLINK_MAX
: ::c_int
= 12;
960 pub const _PC_2_SYMLINKS
: ::c_int
= 13;
961 pub const _PC_ACL_EXTENDED
: ::c_int
= 14;
962 pub const _PC_MIN_HOLE_SIZE
: ::c_int
= 15;
964 pub const _SC_SYNCHRONIZED_IO
: ::c_int
= 31;
965 pub const _SC_IOV_MAX
: ::c_int
= 32;
966 pub const _SC_MAPPED_FILES
: ::c_int
= 33;
967 pub const _SC_MEMLOCK
: ::c_int
= 34;
968 pub const _SC_MEMLOCK_RANGE
: ::c_int
= 35;
969 pub const _SC_MEMORY_PROTECTION
: ::c_int
= 36;
970 pub const _SC_LOGIN_NAME_MAX
: ::c_int
= 37;
971 pub const _SC_MONOTONIC_CLOCK
: ::c_int
= 38;
972 pub const _SC_CLK_TCK
: ::c_int
= 39;
973 pub const _SC_ATEXIT_MAX
: ::c_int
= 40;
974 pub const _SC_THREADS
: ::c_int
= 41;
975 pub const _SC_SEMAPHORES
: ::c_int
= 42;
976 pub const _SC_BARRIERS
: ::c_int
= 43;
977 pub const _SC_TIMERS
: ::c_int
= 44;
978 pub const _SC_SPIN_LOCKS
: ::c_int
= 45;
979 pub const _SC_READER_WRITER_LOCKS
: ::c_int
= 46;
980 pub const _SC_GETGR_R_SIZE_MAX
: ::c_int
= 47;
981 pub const _SC_GETPW_R_SIZE_MAX
: ::c_int
= 48;
982 pub const _SC_CLOCK_SELECTION
: ::c_int
= 49;
983 pub const _SC_ASYNCHRONOUS_IO
: ::c_int
= 50;
984 pub const _SC_AIO_LISTIO_MAX
: ::c_int
= 51;
985 pub const _SC_AIO_MAX
: ::c_int
= 52;
986 pub const _SC_MESSAGE_PASSING
: ::c_int
= 53;
987 pub const _SC_MQ_OPEN_MAX
: ::c_int
= 54;
988 pub const _SC_MQ_PRIO_MAX
: ::c_int
= 55;
989 pub const _SC_PRIORITY_SCHEDULING
: ::c_int
= 56;
990 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS
: ::c_int
= 57;
991 pub const _SC_THREAD_KEYS_MAX
: ::c_int
= 58;
992 pub const _SC_THREAD_STACK_MIN
: ::c_int
= 59;
993 pub const _SC_THREAD_THREADS_MAX
: ::c_int
= 60;
994 pub const _SC_THREAD_ATTR_STACKADDR
: ::c_int
= 61;
995 pub const _SC_THREAD_ATTR_STACKSIZE
: ::c_int
= 62;
996 pub const _SC_THREAD_PRIORITY_SCHEDULING
: ::c_int
= 63;
997 pub const _SC_THREAD_PRIO_INHERIT
: ::c_int
= 64;
998 pub const _SC_THREAD_PRIO_PROTECT
: ::c_int
= 65;
999 pub const _SC_THREAD_PROCESS_SHARED
: ::c_int
= 66;
1000 pub const _SC_THREAD_SAFE_FUNCTIONS
: ::c_int
= 67;
1001 pub const _SC_TTY_NAME_MAX
: ::c_int
= 68;
1002 pub const _SC_HOST_NAME_MAX
: ::c_int
= 69;
1003 pub const _SC_PASS_MAX
: ::c_int
= 70;
1004 pub const _SC_REGEXP
: ::c_int
= 71;
1005 pub const _SC_SHELL
: ::c_int
= 72;
1006 pub const _SC_SYMLOOP_MAX
: ::c_int
= 73;
1007 pub const _SC_V6_ILP32_OFF32
: ::c_int
= 74;
1008 pub const _SC_V6_ILP32_OFFBIG
: ::c_int
= 75;
1009 pub const _SC_V6_LP64_OFF64
: ::c_int
= 76;
1010 pub const _SC_V6_LPBIG_OFFBIG
: ::c_int
= 77;
1011 pub const _SC_2_PBS
: ::c_int
= 80;
1012 pub const _SC_2_PBS_ACCOUNTING
: ::c_int
= 81;
1013 pub const _SC_2_PBS_CHECKPOINT
: ::c_int
= 82;
1014 pub const _SC_2_PBS_LOCATE
: ::c_int
= 83;
1015 pub const _SC_2_PBS_MESSAGE
: ::c_int
= 84;
1016 pub const _SC_2_PBS_TRACK
: ::c_int
= 85;
1017 pub const _SC_SPAWN
: ::c_int
= 86;
1018 pub const _SC_SHARED_MEMORY_OBJECTS
: ::c_int
= 87;
1019 pub const _SC_TIMER_MAX
: ::c_int
= 88;
1020 pub const _SC_SEM_NSEMS_MAX
: ::c_int
= 89;
1021 pub const _SC_CPUTIME
: ::c_int
= 90;
1022 pub const _SC_THREAD_CPUTIME
: ::c_int
= 91;
1023 pub const _SC_DELAYTIMER_MAX
: ::c_int
= 92;
1024 // These two variables will be supported in NetBSD 8.0
1025 // pub const _SC_SIGQUEUE_MAX : ::c_int = 93;
1026 // pub const _SC_REALTIME_SIGNALS : ::c_int = 94;
1027 pub const _SC_PHYS_PAGES
: ::c_int
= 121;
1028 pub const _SC_NPROCESSORS_CONF
: ::c_int
= 1001;
1029 pub const _SC_NPROCESSORS_ONLN
: ::c_int
= 1002;
1030 pub const _SC_SCHED_RT_TS
: ::c_int
= 2001;
1031 pub const _SC_SCHED_PRI_MIN
: ::c_int
= 2002;
1032 pub const _SC_SCHED_PRI_MAX
: ::c_int
= 2003;
1034 pub const FD_SETSIZE
: usize = 0x100;
1036 pub const ST_NOSUID
: ::c_ulong
= 8;
1039 if #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
1040 target_arch
= "x86", target_arch
= "x86_64"))] {
1041 pub const PTHREAD_MUTEX_INITIALIZER
: pthread_mutex_t
= pthread_mutex_t
{
1042 ptm_magic
: 0x33330003,
1047 ptm_waiters
: 0 as *mut _
,
1050 ptm_spare2
: 0 as *mut _
,
1053 pub const PTHREAD_MUTEX_INITIALIZER
: pthread_mutex_t
= pthread_mutex_t
{
1054 ptm_magic
: 0x33330003,
1057 ptm_waiters
: 0 as *mut _
,
1060 ptm_spare2
: 0 as *mut _
,
1065 pub const PTHREAD_COND_INITIALIZER
: pthread_cond_t
= pthread_cond_t
{
1066 ptc_magic
: 0x55550005,
1068 ptc_waiters_first
: 0 as *mut _
,
1069 ptc_waiters_last
: 0 as *mut _
,
1070 ptc_mutex
: 0 as *mut _
,
1071 ptc_private
: 0 as *mut _
,
1073 pub const PTHREAD_RWLOCK_INITIALIZER
: pthread_rwlock_t
= pthread_rwlock_t
{
1074 ptr_magic
: 0x99990009,
1076 ptr_rblocked_first
: 0 as *mut _
,
1077 ptr_rblocked_last
: 0 as *mut _
,
1078 ptr_wblocked_first
: 0 as *mut _
,
1079 ptr_wblocked_last
: 0 as *mut _
,
1082 ptr_private
: 0 as *mut _
,
1084 pub const PTHREAD_MUTEX_NORMAL
: ::c_int
= 0;
1085 pub const PTHREAD_MUTEX_ERRORCHECK
: ::c_int
= 1;
1086 pub const PTHREAD_MUTEX_RECURSIVE
: ::c_int
= 2;
1087 pub const PTHREAD_MUTEX_DEFAULT
: ::c_int
= PTHREAD_MUTEX_NORMAL
;
1089 pub const EVFILT_AIO
: ::uint32_t
= 2;
1090 pub const EVFILT_PROC
: ::uint32_t
= 4;
1091 pub const EVFILT_READ
: ::uint32_t
= 0;
1092 pub const EVFILT_SIGNAL
: ::uint32_t
= 5;
1093 pub const EVFILT_TIMER
: ::uint32_t
= 6;
1094 pub const EVFILT_VNODE
: ::uint32_t
= 3;
1095 pub const EVFILT_WRITE
: ::uint32_t
= 1;
1097 pub const EV_ADD
: ::uint32_t
= 0x1;
1098 pub const EV_DELETE
: ::uint32_t
= 0x2;
1099 pub const EV_ENABLE
: ::uint32_t
= 0x4;
1100 pub const EV_DISABLE
: ::uint32_t
= 0x8;
1101 pub const EV_ONESHOT
: ::uint32_t
= 0x10;
1102 pub const EV_CLEAR
: ::uint32_t
= 0x20;
1103 pub const EV_RECEIPT
: ::uint32_t
= 0x40;
1104 pub const EV_DISPATCH
: ::uint32_t
= 0x80;
1105 pub const EV_FLAG1
: ::uint32_t
= 0x2000;
1106 pub const EV_ERROR
: ::uint32_t
= 0x4000;
1107 pub const EV_EOF
: ::uint32_t
= 0x8000;
1108 pub const EV_SYSFLAGS
: ::uint32_t
= 0xf000;
1110 pub const NOTE_LOWAT
: ::uint32_t
= 0x00000001;
1111 pub const NOTE_DELETE
: ::uint32_t
= 0x00000001;
1112 pub const NOTE_WRITE
: ::uint32_t
= 0x00000002;
1113 pub const NOTE_EXTEND
: ::uint32_t
= 0x00000004;
1114 pub const NOTE_ATTRIB
: ::uint32_t
= 0x00000008;
1115 pub const NOTE_LINK
: ::uint32_t
= 0x00000010;
1116 pub const NOTE_RENAME
: ::uint32_t
= 0x00000020;
1117 pub const NOTE_REVOKE
: ::uint32_t
= 0x00000040;
1118 pub const NOTE_EXIT
: ::uint32_t
= 0x80000000;
1119 pub const NOTE_FORK
: ::uint32_t
= 0x40000000;
1120 pub const NOTE_EXEC
: ::uint32_t
= 0x20000000;
1121 pub const NOTE_PDATAMASK
: ::uint32_t
= 0x000fffff;
1122 pub const NOTE_PCTRLMASK
: ::uint32_t
= 0xf0000000;
1123 pub const NOTE_TRACK
: ::uint32_t
= 0x00000001;
1124 pub const NOTE_TRACKERR
: ::uint32_t
= 0x00000002;
1125 pub const NOTE_CHILD
: ::uint32_t
= 0x00000004;
1127 pub const TMP_MAX
: ::c_uint
= 308915776;
1129 pub const NI_MAXHOST
: ::socklen_t
= 1025;
1131 pub const RTLD_NOLOAD
: ::c_int
= 0x2000;
1132 pub const RTLD_LOCAL
: ::c_int
= 0x200;
1134 pub const CTL_MAXNAME
: ::c_int
= 12;
1135 pub const SYSCTL_NAMELEN
: ::c_int
= 32;
1136 pub const SYSCTL_DEFSIZE
: ::c_int
= 8;
1137 pub const CTLTYPE_NODE
: ::c_int
= 1;
1138 pub const CTLTYPE_INT
: ::c_int
= 2;
1139 pub const CTLTYPE_STRING
: ::c_int
= 3;
1140 pub const CTLTYPE_QUAD
: ::c_int
= 4;
1141 pub const CTLTYPE_STRUCT
: ::c_int
= 5;
1142 pub const CTLTYPE_BOOL
: ::c_int
= 6;
1143 pub const CTLFLAG_READONLY
: ::c_int
= 0x00000000;
1144 pub const CTLFLAG_READWRITE
: ::c_int
= 0x00000070;
1145 pub const CTLFLAG_ANYWRITE
: ::c_int
= 0x00000080;
1146 pub const CTLFLAG_PRIVATE
: ::c_int
= 0x00000100;
1147 pub const CTLFLAG_PERMANENT
: ::c_int
= 0x00000200;
1148 pub const CTLFLAG_OWNDATA
: ::c_int
= 0x00000400;
1149 pub const CTLFLAG_IMMEDIATE
: ::c_int
= 0x00000800;
1150 pub const CTLFLAG_HEX
: ::c_int
= 0x00001000;
1151 pub const CTLFLAG_ROOT
: ::c_int
= 0x00002000;
1152 pub const CTLFLAG_ANYNUMBER
: ::c_int
= 0x00004000;
1153 pub const CTLFLAG_HIDDEN
: ::c_int
= 0x00008000;
1154 pub const CTLFLAG_ALIAS
: ::c_int
= 0x00010000;
1155 pub const CTLFLAG_MMAP
: ::c_int
= 0x00020000;
1156 pub const CTLFLAG_OWNDESC
: ::c_int
= 0x00040000;
1157 pub const CTLFLAG_UNSIGNED
: ::c_int
= 0x00080000;
1158 pub const SYSCTL_VERS_MASK
: ::c_int
= 0xff000000;
1159 pub const SYSCTL_VERS_0
: ::c_int
= 0x00000000;
1160 pub const SYSCTL_VERS_1
: ::c_int
= 0x01000000;
1161 pub const SYSCTL_VERSION
: ::c_int
= SYSCTL_VERS_1
;
1162 pub const CTL_EOL
: ::c_int
= -1;
1163 pub const CTL_QUERY
: ::c_int
= -2;
1164 pub const CTL_CREATE
: ::c_int
= -3;
1165 pub const CTL_CREATESYM
: ::c_int
= -4;
1166 pub const CTL_DESTROY
: ::c_int
= -5;
1167 pub const CTL_MMAP
: ::c_int
= -6;
1168 pub const CTL_DESCRIBE
: ::c_int
= -7;
1169 pub const CTL_UNSPEC
: ::c_int
= 0;
1170 pub const CTL_KERN
: ::c_int
= 1;
1171 pub const CTL_VM
: ::c_int
= 2;
1172 pub const CTL_VFS
: ::c_int
= 3;
1173 pub const CTL_NET
: ::c_int
= 4;
1174 pub const CTL_DEBUG
: ::c_int
= 5;
1175 pub const CTL_HW
: ::c_int
= 6;
1176 pub const CTL_MACHDEP
: ::c_int
= 7;
1177 pub const CTL_USER
: ::c_int
= 8;
1178 pub const CTL_DDB
: ::c_int
= 9;
1179 pub const CTL_PROC
: ::c_int
= 10;
1180 pub const CTL_VENDOR
: ::c_int
= 11;
1181 pub const CTL_EMUL
: ::c_int
= 12;
1182 pub const CTL_SECURITY
: ::c_int
= 13;
1183 pub const CTL_MAXID
: ::c_int
= 14;
1184 pub const KERN_OSTYPE
: ::c_int
= 1;
1185 pub const KERN_OSRELEASE
: ::c_int
= 2;
1186 pub const KERN_OSREV
: ::c_int
= 3;
1187 pub const KERN_VERSION
: ::c_int
= 4;
1188 pub const KERN_MAXVNODES
: ::c_int
= 5;
1189 pub const KERN_MAXPROC
: ::c_int
= 6;
1190 pub const KERN_MAXFILES
: ::c_int
= 7;
1191 pub const KERN_ARGMAX
: ::c_int
= 8;
1192 pub const KERN_SECURELVL
: ::c_int
= 9;
1193 pub const KERN_HOSTNAME
: ::c_int
= 10;
1194 pub const KERN_HOSTID
: ::c_int
= 11;
1195 pub const KERN_CLOCKRATE
: ::c_int
= 12;
1196 pub const KERN_VNODE
: ::c_int
= 13;
1197 pub const KERN_PROC
: ::c_int
= 14;
1198 pub const KERN_FILE
: ::c_int
= 15;
1199 pub const KERN_PROF
: ::c_int
= 16;
1200 pub const KERN_POSIX1
: ::c_int
= 17;
1201 pub const KERN_NGROUPS
: ::c_int
= 18;
1202 pub const KERN_JOB_CONTROL
: ::c_int
= 19;
1203 pub const KERN_SAVED_IDS
: ::c_int
= 20;
1204 pub const KERN_OBOOTTIME
: ::c_int
= 21;
1205 pub const KERN_DOMAINNAME
: ::c_int
= 22;
1206 pub const KERN_MAXPARTITIONS
: ::c_int
= 23;
1207 pub const KERN_RAWPARTITION
: ::c_int
= 24;
1208 pub const KERN_NTPTIME
: ::c_int
= 25;
1209 pub const KERN_TIMEX
: ::c_int
= 26;
1210 pub const KERN_AUTONICETIME
: ::c_int
= 27;
1211 pub const KERN_AUTONICEVAL
: ::c_int
= 28;
1212 pub const KERN_RTC_OFFSET
: ::c_int
= 29;
1213 pub const KERN_ROOT_DEVICE
: ::c_int
= 30;
1214 pub const KERN_MSGBUFSIZE
: ::c_int
= 31;
1215 pub const KERN_FSYNC
: ::c_int
= 32;
1216 pub const KERN_OLDSYSVMSG
: ::c_int
= 33;
1217 pub const KERN_OLDSYSVSEM
: ::c_int
= 34;
1218 pub const KERN_OLDSYSVSHM
: ::c_int
= 35;
1219 pub const KERN_OLDSHORTCORENAME
: ::c_int
= 36;
1220 pub const KERN_SYNCHRONIZED_IO
: ::c_int
= 37;
1221 pub const KERN_IOV_MAX
: ::c_int
= 38;
1222 pub const KERN_MBUF
: ::c_int
= 39;
1223 pub const KERN_MAPPED_FILES
: ::c_int
= 40;
1224 pub const KERN_MEMLOCK
: ::c_int
= 41;
1225 pub const KERN_MEMLOCK_RANGE
: ::c_int
= 42;
1226 pub const KERN_MEMORY_PROTECTION
: ::c_int
= 43;
1227 pub const KERN_LOGIN_NAME_MAX
: ::c_int
= 44;
1228 pub const KERN_DEFCORENAME
: ::c_int
= 45;
1229 pub const KERN_LOGSIGEXIT
: ::c_int
= 46;
1230 pub const KERN_PROC2
: ::c_int
= 47;
1231 pub const KERN_PROC_ARGS
: ::c_int
= 48;
1232 pub const KERN_FSCALE
: ::c_int
= 49;
1233 pub const KERN_CCPU
: ::c_int
= 50;
1234 pub const KERN_CP_TIME
: ::c_int
= 51;
1235 pub const KERN_OLDSYSVIPC_INFO
: ::c_int
= 52;
1236 pub const KERN_MSGBUF
: ::c_int
= 53;
1237 pub const KERN_CONSDEV
: ::c_int
= 54;
1238 pub const KERN_MAXPTYS
: ::c_int
= 55;
1239 pub const KERN_PIPE
: ::c_int
= 56;
1240 pub const KERN_MAXPHYS
: ::c_int
= 57;
1241 pub const KERN_SBMAX
: ::c_int
= 58;
1242 pub const KERN_TKSTAT
: ::c_int
= 59;
1243 pub const KERN_MONOTONIC_CLOCK
: ::c_int
= 60;
1244 pub const KERN_URND
: ::c_int
= 61;
1245 pub const KERN_LABELSECTOR
: ::c_int
= 62;
1246 pub const KERN_LABELOFFSET
: ::c_int
= 63;
1247 pub const KERN_LWP
: ::c_int
= 64;
1248 pub const KERN_FORKFSLEEP
: ::c_int
= 65;
1249 pub const KERN_POSIX_THREADS
: ::c_int
= 66;
1250 pub const KERN_POSIX_SEMAPHORES
: ::c_int
= 67;
1251 pub const KERN_POSIX_BARRIERS
: ::c_int
= 68;
1252 pub const KERN_POSIX_TIMERS
: ::c_int
= 69;
1253 pub const KERN_POSIX_SPIN_LOCKS
: ::c_int
= 70;
1254 pub const KERN_POSIX_READER_WRITER_LOCKS
: ::c_int
= 71;
1255 pub const KERN_DUMP_ON_PANIC
: ::c_int
= 72;
1256 pub const KERN_SOMAXKVA
: ::c_int
= 73;
1257 pub const KERN_ROOT_PARTITION
: ::c_int
= 74;
1258 pub const KERN_DRIVERS
: ::c_int
= 75;
1259 pub const KERN_BUF
: ::c_int
= 76;
1260 pub const KERN_FILE2
: ::c_int
= 77;
1261 pub const KERN_VERIEXEC
: ::c_int
= 78;
1262 pub const KERN_CP_ID
: ::c_int
= 79;
1263 pub const KERN_HARDCLOCK_TICKS
: ::c_int
= 80;
1264 pub const KERN_ARND
: ::c_int
= 81;
1265 pub const KERN_SYSVIPC
: ::c_int
= 82;
1266 pub const KERN_BOOTTIME
: ::c_int
= 83;
1267 pub const KERN_EVCNT
: ::c_int
= 84;
1268 pub const KERN_MAXID
: ::c_int
= 85;
1269 pub const KERN_PROC_ALL
: ::c_int
= 0;
1270 pub const KERN_PROC_PID
: ::c_int
= 1;
1271 pub const KERN_PROC_PGRP
: ::c_int
= 2;
1272 pub const KERN_PROC_SESSION
: ::c_int
= 3;
1273 pub const KERN_PROC_TTY
: ::c_int
= 4;
1274 pub const KERN_PROC_UID
: ::c_int
= 5;
1275 pub const KERN_PROC_RUID
: ::c_int
= 6;
1276 pub const KERN_PROC_GID
: ::c_int
= 7;
1277 pub const KERN_PROC_RGID
: ::c_int
= 8;
1278 pub const KERN_PROC_ARGV
: ::c_int
= 1;
1279 pub const KERN_PROC_NARGV
: ::c_int
= 2;
1280 pub const KERN_PROC_ENV
: ::c_int
= 3;
1281 pub const KERN_PROC_NENV
: ::c_int
= 4;
1282 pub const KERN_PROC_PATHNAME
: ::c_int
= 5;
1284 pub const EAI_AGAIN
: ::c_int
= 2;
1285 pub const EAI_BADFLAGS
: ::c_int
= 3;
1286 pub const EAI_FAIL
: ::c_int
= 4;
1287 pub const EAI_FAMILY
: ::c_int
= 5;
1288 pub const EAI_MEMORY
: ::c_int
= 6;
1289 pub const EAI_NODATA
: ::c_int
= 7;
1290 pub const EAI_NONAME
: ::c_int
= 8;
1291 pub const EAI_SERVICE
: ::c_int
= 9;
1292 pub const EAI_SOCKTYPE
: ::c_int
= 10;
1293 pub const EAI_SYSTEM
: ::c_int
= 11;
1294 pub const EAI_OVERFLOW
: ::c_int
= 14;
1296 pub const AIO_CANCELED
: ::c_int
= 1;
1297 pub const AIO_NOTCANCELED
: ::c_int
= 2;
1298 pub const AIO_ALLDONE
: ::c_int
= 3;
1299 pub const LIO_NOP
: ::c_int
= 0;
1300 pub const LIO_WRITE
: ::c_int
= 1;
1301 pub const LIO_READ
: ::c_int
= 2;
1302 pub const LIO_WAIT
: ::c_int
= 1;
1303 pub const LIO_NOWAIT
: ::c_int
= 0;
1305 pub const SIGEV_NONE
: ::c_int
= 0;
1306 pub const SIGEV_SIGNAL
: ::c_int
= 1;
1307 pub const SIGEV_THREAD
: ::c_int
= 2;
1309 pub const WSTOPPED
: ::c_int
= 0x00000002; // same as WUNTRACED
1310 pub const WCONTINUED
: ::c_int
= 0x00000010;
1311 pub const WEXITED
: ::c_int
= 0x000000020;
1312 pub const WNOWAIT
: ::c_int
= 0x00010000;
1314 pub const P_ALL
: idtype_t
= 0;
1315 pub const P_PID
: idtype_t
= 1;
1316 pub const P_PGID
: idtype_t
= 4;
1318 pub const B460800
: ::speed_t
= 460800;
1319 pub const B921600
: ::speed_t
= 921600;
1321 pub const ONOCR
: ::tcflag_t
= 0x20;
1322 pub const ONLRET
: ::tcflag_t
= 0x40;
1323 pub const CDTRCTS
: ::tcflag_t
= 0x00020000;
1324 pub const CHWFLOW
: ::tcflag_t
= ::MDMBUF
| ::CRTSCTS
| ::CDTRCTS
;
1326 pub const SOCK_CLOEXEC
: ::c_int
= 0x10000000;
1327 pub const SOCK_NONBLOCK
: ::c_int
= 0x20000000;
1329 pub const FIONCLEX
: ::c_ulong
= 0x20006602;
1330 // Uncomment on next NetBSD release
1331 // pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;
1332 // pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662;
1333 pub const FIONREAD
: ::c_ulong
= 0x4004667f;
1334 pub const FIOASYNC
: ::c_ulong
= 0x8004667d;
1335 pub const FIOSETOWN
: ::c_ulong
= 0x8004667c;
1336 pub const FIOGETOWN
: ::c_ulong
= 0x4004667b;
1337 pub const OFIOGETBMAP
: ::c_ulong
= 0xc004667a;
1338 pub const FIOGETBMAP
: ::c_ulong
= 0xc008667a;
1339 pub const FIONWRITE
: ::c_ulong
= 0x40046679;
1340 pub const FIONSPACE
: ::c_ulong
= 0x40046678;
1341 pub const FIBMAP
: ::c_ulong
= 0xc008667a;
1343 pub const SIGSTKSZ
: ::size_t
= 40960;
1345 pub const PT_DUMPCORE
: ::c_int
= 12;
1346 pub const PT_LWPINFO
: ::c_int
= 13;
1347 pub const PT_SYSCALL
: ::c_int
= 14;
1348 pub const PT_SYSCALLEMU
: ::c_int
= 15;
1349 pub const PT_SET_EVENT_MASK
: ::c_int
= 16;
1350 pub const PT_GET_EVENT_MASK
: ::c_int
= 17;
1351 pub const PT_GET_PROCESS_STATE
: ::c_int
= 18;
1352 pub const PT_FIRSTMACH
: ::c_int
= 32;
1354 // Flags for chflags(2)
1355 pub const SF_SNAPSHOT
: ::c_ulong
= 0x00200000;
1356 pub const SF_LOG
: ::c_ulong
= 0x00400000;
1357 pub const SF_SNAPINVAL
: ::c_ulong
= 0x00800000;
1359 fn _ALIGN(p
: usize) -> usize {
1360 (p
+ _ALIGNBYTES
) & !_ALIGNBYTES
1364 pub fn CMSG_DATA(cmsg
: *const ::cmsghdr
) -> *mut ::c_uchar
{
1365 (cmsg
as *mut ::c_uchar
)
1366 .offset(_ALIGN(::mem
::size_of
::<::cmsghdr
>()) as isize)
1369 pub fn CMSG_LEN(length
: ::c_uint
) -> ::c_uint
{
1370 _ALIGN(::mem
::size_of
::<::cmsghdr
>()) as ::c_uint
+ length
1373 pub fn CMSG_NXTHDR(mhdr
: *const ::msghdr
, cmsg
: *const ::cmsghdr
)
1377 return ::CMSG_FIRSTHDR(mhdr
);
1379 let next
= cmsg
as usize + _ALIGN((*cmsg
).cmsg_len
as usize)
1380 + _ALIGN(::mem
::size_of
::<::cmsghdr
>());
1381 let max
= (*mhdr
).msg_control
as usize
1382 + (*mhdr
).msg_controllen
as usize;
1386 (cmsg
as usize + _ALIGN((*cmsg
).cmsg_len
as usize))
1391 pub fn CMSG_SPACE(length
: ::c_uint
) -> ::c_uint
{
1392 (_ALIGN(::mem
::size_of
::<::cmsghdr
>()) + _ALIGN(length
as usize))
1396 pub fn WSTOPSIG(status
: ::c_int
) -> ::c_int
{
1400 pub fn WIFSIGNALED(status
: ::c_int
) -> bool
{
1401 (status
& 0o177) != 0o177 && (status
& 0o177) != 0
1404 pub fn WIFSTOPPED(status
: ::c_int
) -> bool
{
1405 (status
& 0o177) == 0o177
1408 // dirfd() is a macro on netbsd to access
1409 // the first field of the struct where dirp points to:
1410 // http://cvsweb.netbsd.org/bsdweb.cgi/src/include/dirent.h?rev=1.36
1411 pub fn dirfd(dirp
: *mut ::DIR
) -> ::c_int
{
1412 *(dirp
as *const ::c_int
)
1415 pub fn WIFCONTINUED(status
: ::c_int
) -> bool
{
1419 pub fn SOCKCREDSIZE(ngrps
: usize) -> usize {
1420 let ngrps
= if ngrps
> 0 {
1425 ::mem
::size_of
::<sockcred
>() + ::mem
::size_of
::<::gid_t
>() * ngrps
1429 #[link(name = "rt")]
1431 pub fn aio_read(aiocbp
: *mut aiocb
) -> ::c_int
;
1432 pub fn aio_write(aiocbp
: *mut aiocb
) -> ::c_int
;
1433 pub fn aio_fsync(op
: ::c_int
, aiocbp
: *mut aiocb
) -> ::c_int
;
1434 pub fn aio_error(aiocbp
: *const aiocb
) -> ::c_int
;
1435 pub fn aio_return(aiocbp
: *mut aiocb
) -> ::ssize_t
;
1436 #[link_name = "__aio_suspend50"]
1437 pub fn aio_suspend(aiocb_list
: *const *const aiocb
, nitems
: ::c_int
,
1438 timeout
: *const ::timespec
) -> ::c_int
;
1439 pub fn aio_cancel(fd
: ::c_int
, aiocbp
: *mut aiocb
) -> ::c_int
;
1440 pub fn lio_listio(mode
: ::c_int
, aiocb_list
: *const *mut aiocb
,
1441 nitems
: ::c_int
, sevp
: *mut sigevent
) -> ::c_int
;
1445 pub fn chflags(path
: *const ::c_char
, flags
: ::c_ulong
) -> ::c_int
;
1446 pub fn fchflags(fd
: ::c_int
, flags
: ::c_ulong
) -> ::c_int
;
1447 pub fn lchflags(path
: *const ::c_char
, flags
: ::c_ulong
) -> ::c_int
;
1449 pub fn extattr_delete_fd(fd
: ::c_int
,
1450 attrnamespace
: ::c_int
,
1451 attrname
: *const ::c_char
) -> ::c_int
;
1452 pub fn extattr_delete_file(path
: *const ::c_char
,
1453 attrnamespace
: ::c_int
,
1454 attrname
: *const ::c_char
) -> ::c_int
;
1455 pub fn extattr_delete_link(path
: *const ::c_char
,
1456 attrnamespace
: ::c_int
,
1457 attrname
: *const ::c_char
) -> ::c_int
;
1458 pub fn extattr_get_fd(fd
: ::c_int
,
1459 attrnamespace
: ::c_int
,
1460 attrname
: *const ::c_char
,
1461 data
: *mut ::c_void
,
1462 nbytes
: ::size_t
) -> ::ssize_t
;
1463 pub fn extattr_get_file(path
: *const ::c_char
,
1464 attrnamespace
: ::c_int
,
1465 attrname
: *const ::c_char
,
1466 data
: *mut ::c_void
,
1467 nbytes
: ::size_t
) -> ::ssize_t
;
1468 pub fn extattr_get_link(path
: *const ::c_char
,
1469 attrnamespace
: ::c_int
,
1470 attrname
: *const ::c_char
,
1471 data
: *mut ::c_void
,
1472 nbytes
: ::size_t
) -> ::ssize_t
;
1473 pub fn extattr_namespace_to_string(attrnamespace
: ::c_int
,
1474 string
: *mut *mut ::c_char
) -> ::c_int
;
1475 pub fn extattr_set_fd(fd
: ::c_int
,
1476 attrnamespace
: ::c_int
,
1477 attrname
: *const ::c_char
,
1478 data
: *const ::c_void
,
1479 nbytes
: ::size_t
) -> ::c_int
;
1480 pub fn extattr_set_file(path
: *const ::c_char
,
1481 attrnamespace
: ::c_int
,
1482 attrname
: *const ::c_char
,
1483 data
: *const ::c_void
,
1484 nbytes
: ::size_t
) -> ::c_int
;
1485 pub fn extattr_set_link(path
: *const ::c_char
,
1486 attrnamespace
: ::c_int
,
1487 attrname
: *const ::c_char
,
1488 data
: *const ::c_void
,
1489 nbytes
: ::size_t
) -> ::c_int
;
1490 pub fn extattr_string_to_namespace(string
: *const ::c_char
,
1491 attrnamespace
: *mut ::c_int
) -> ::c_int
;
1493 #[link_name = "__lutimes50"]
1494 pub fn lutimes(file
: *const ::c_char
, times
: *const ::timeval
) -> ::c_int
;
1495 pub fn getnameinfo(sa
: *const ::sockaddr
,
1497 host
: *mut ::c_char
,
1498 hostlen
: ::socklen_t
,
1499 serv
: *mut ::c_char
,
1500 sevlen
: ::socklen_t
,
1501 flags
: ::c_int
) -> ::c_int
;
1502 pub fn mprotect(addr
: *mut ::c_void
, len
: ::size_t
, prot
: ::c_int
)
1504 pub fn sysctl(name
: *const ::c_int
,
1506 oldp
: *mut ::c_void
,
1507 oldlenp
: *mut ::size_t
,
1508 newp
: *const ::c_void
,
1511 pub fn sysctlbyname(name
: *const ::c_char
,
1512 oldp
: *mut ::c_void
,
1513 oldlenp
: *mut ::size_t
,
1514 newp
: *const ::c_void
,
1517 #[link_name = "__kevent50"]
1518 pub fn kevent(kq
: ::c_int
,
1519 changelist
: *const ::kevent
,
1521 eventlist
: *mut ::kevent
,
1523 timeout
: *const ::timespec
) -> ::c_int
;
1524 #[link_name = "__mount50"]
1525 pub fn mount(src
: *const ::c_char
,
1526 target
: *const ::c_char
,
1528 data
: *mut ::c_void
,
1529 size
: ::size_t
) -> ::c_int
;
1530 pub fn mq_open(name
: *const ::c_char
, oflag
: ::c_int
, ...) -> ::mqd_t
;
1531 pub fn mq_close(mqd
: ::mqd_t
) -> ::c_int
;
1532 pub fn mq_getattr(mqd
: ::mqd_t
, attr
: *mut ::mq_attr
) -> ::c_int
;
1533 pub fn mq_notify(mqd
: ::mqd_t
, notification
: *const ::sigevent
) -> ::c_int
;
1534 pub fn mq_receive(mqd
: ::mqd_t
,
1535 msg_ptr
: *mut ::c_char
,
1537 msq_prio
: *mut ::c_uint
) -> ::ssize_t
;
1538 pub fn mq_send(mqd
: ::mqd_t
,
1539 msg_ptr
: *const ::c_char
,
1541 msq_prio
: ::c_uint
) -> ::c_int
;
1542 pub fn mq_setattr(mqd
: ::mqd_t
,
1543 newattr
: *const ::mq_attr
,
1544 oldattr
: *mut ::mq_attr
) -> ::c_int
;
1545 #[link_name = "__mq_timedreceive50"]
1546 pub fn mq_timedreceive(mqd
: ::mqd_t
,
1547 msg_ptr
: *mut ::c_char
,
1549 msq_prio
: *mut ::c_uint
,
1550 abs_timeout
: *const ::timespec
) -> ::ssize_t
;
1551 #[link_name = "__mq_timedsend50"]
1552 pub fn mq_timedsend(mqd
: ::mqd_t
,
1553 msg_ptr
: *const ::c_char
,
1556 abs_timeout
: *const ::timespec
) -> ::c_int
;
1557 pub fn mq_unlink(name
: *const ::c_char
) -> ::c_int
;
1558 pub fn ptrace(request
: ::c_int
,
1560 addr
: *mut ::c_void
,
1561 data
: ::c_int
) -> ::c_int
;
1562 pub fn pthread_setname_np(t
: ::pthread_t
,
1563 name
: *const ::c_char
,
1564 arg
: *mut ::c_void
) -> ::c_int
;
1565 pub fn pthread_getattr_np(native
: ::pthread_t
,
1566 attr
: *mut ::pthread_attr_t
) -> ::c_int
;
1567 pub fn pthread_attr_getguardsize(attr
: *const ::pthread_attr_t
,
1568 guardsize
: *mut ::size_t
) -> ::c_int
;
1569 pub fn pthread_attr_getstack(attr
: *const ::pthread_attr_t
,
1570 stackaddr
: *mut *mut ::c_void
,
1571 stacksize
: *mut ::size_t
) -> ::c_int
;
1572 #[link_name = "__sigtimedwait50"]
1573 pub fn sigtimedwait(set
: *const sigset_t
,
1574 info
: *mut siginfo_t
,
1575 timeout
: *const ::timespec
) -> ::c_int
;
1576 pub fn sigwaitinfo(set
: *const sigset_t
,
1577 info
: *mut siginfo_t
) -> ::c_int
;
1578 pub fn duplocale(base
: ::locale_t
) -> ::locale_t
;
1579 pub fn freelocale(loc
: ::locale_t
);
1580 pub fn localeconv_l(loc
: ::locale_t
) -> *mut lconv
;
1581 pub fn newlocale(mask
: ::c_int
,
1582 locale
: *const ::c_char
,
1583 base
: ::locale_t
) -> ::locale_t
;
1584 #[link_name = "__settimeofday50"]
1585 pub fn settimeofday(tv
: *const ::timeval
, tz
: *const ::c_void
) -> ::c_int
;
1587 pub fn dup3(src
: ::c_int
, dst
: ::c_int
, flags
: ::c_int
) -> ::c_int
;
1589 pub fn sendmmsg(sockfd
: ::c_int
, msgvec
: *mut ::mmsghdr
, vlen
: ::c_uint
,
1590 flags
: ::c_int
) -> ::c_int
;
1591 pub fn recvmmsg(sockfd
: ::c_int
, msgvec
: *mut ::mmsghdr
, vlen
: ::c_uint
,
1592 flags
: ::c_int
, timeout
: *mut ::timespec
) -> ::c_int
;
1595 #[link(name = "util")]
1597 #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
1598 pub fn getpwent_r(pwd
: *mut ::passwd
,
1601 result
: *mut *mut ::passwd
) -> ::c_int
;
1602 pub fn getgrent_r(grp
: *mut ::group
,
1605 result
: *mut *mut ::group
) -> ::c_int
;
1609 if #[cfg(target_arch = "aarch64")] {
1611 pub use self::aarch64
::*;
1612 } else if #[cfg(target_arch = "arm")] {
1614 pub use self::arm
::*;
1615 } else if #[cfg(target_arch = "powerpc")] {
1617 pub use self::powerpc
::*;
1618 } else if #[cfg(target_arch = "sparc64")] {
1620 pub use self::sparc64
::*;
1621 } else if #[cfg(target_arch = "x86_64")] {
1623 pub use self::x86_64
::*;
1624 } else if #[cfg(target_arch = "x86")] {
1626 pub use self::x86
::*;
1628 // Unknown target_arch