chore: add vendor dependencies for kauma build

This commit is contained in:
0xalivecow 2024-10-23 10:20:38 +02:00
parent 7c94e5d8fb
commit 067ef6141c
No known key found for this signature in database
1758 changed files with 398473 additions and 0 deletions

3363
vendor/libc/src/unix/aix/mod.rs vendored Normal file

File diff suppressed because it is too large Load diff

644
vendor/libc/src/unix/aix/powerpc64.rs vendored Normal file
View file

@ -0,0 +1,644 @@
pub type c_long = i64;
pub type c_ulong = u64;
s! {
pub struct sigset_t {
pub ss_set: [c_ulong; 4],
}
pub struct fd_set {
pub fds_bits: [c_long; 1024],
}
pub struct flock {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_sysid: ::c_uint,
pub l_pid: ::pid_t,
pub l_vfs: ::c_int,
pub l_start: ::off_t,
pub l_len: ::off_t,
}
pub struct statvfs {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_favail: ::fsfilcnt_t,
pub f_fsid: ::c_ulong,
pub f_basetype: [::c_char; 16],
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
pub f_fstr: [::c_char; 32],
pub f_filler: [::c_ulong; 16]
}
pub struct pthread_rwlock_t {
__rw_word: [::c_long; 10],
}
pub struct pthread_cond_t {
__cv_word: [::c_long; 6],
}
pub struct pthread_mutex_t {
__mt_word: [::c_long; 8],
}
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_flag: ::c_ushort,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_ssize: ::c_int,
pub st_atime: ::st_timespec,
pub st_mtime: ::st_timespec,
pub st_ctime: ::st_timespec,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt_t,
pub st_vfstype: ::c_int,
pub st_vfs: ::c_uint,
pub st_type: ::c_uint,
pub st_gen: ::c_uint,
pub st_reserved: [::c_uint; 9],
pub st_padto_ll: ::c_uint,
pub st_size: ::off_t,
}
pub struct statfs {
pub f_version: ::c_int,
pub f_type: ::c_int,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsblkcnt_t,
pub f_ffree: ::fsblkcnt_t,
pub f_fsid: ::fsid64_t,
pub f_vfstype: ::c_int,
pub f_fsize: ::c_ulong,
pub f_vfsnumber: ::c_int,
pub f_vfsoff: ::c_int,
pub f_vfslen: ::c_int,
pub f_vfsvers: ::c_int,
pub f_fname: [::c_char; 32],
pub f_fpack: [::c_char; 32],
pub f_name_max: ::c_int,
}
pub struct aiocb {
pub aio_lio_opcode: ::c_int,
pub aio_fildes: ::c_int,
pub aio_word1: ::c_int,
pub aio_offset: ::off_t,
pub aio_buf: *mut ::c_void,
pub aio_return: ::ssize_t,
pub aio_errno: ::c_int,
pub aio_nbytes: ::size_t,
pub aio_reqprio: ::c_int,
pub aio_sigevent: ::sigevent,
pub aio_word2: ::c_int,
pub aio_fp: ::c_int,
pub aio_handle: *mut aiocb,
pub aio_reserved: [::c_uint; 2],
pub aio_sigev_tid: c_long,
}
pub struct ucontext_t {
pub __sc_onstack: ::c_int,
pub uc_sigmask: ::sigset_t,
pub __sc_uerror: ::c_int,
pub uc_mcontext: ::mcontext_t,
pub uc_link: *mut ucontext_t,
pub uc_stack: ::stack_t,
// Should be pointer to __extctx_t
pub __extctx: *mut ::c_void,
pub __extctx_magic: ::c_int,
pub __pad: [::c_int; 1],
}
pub struct mcontext_t {
pub gpr: [::c_ulonglong; 32],
pub msr: ::c_ulonglong,
pub iar: ::c_ulonglong,
pub lr: ::c_ulonglong,
pub ctr: ::c_ulonglong,
pub cr: ::c_uint,
pub xer: ::c_uint,
pub fpscr: ::c_uint,
pub fpscrx: ::c_uint,
pub except: [::c_ulonglong; 1],
// Should be array of double type
pub fpr: [::uint64_t; 32],
pub fpeu: ::c_char,
pub fpinfo: ::c_char,
pub fpscr24_31: ::c_char,
pub pad: [::c_char; 1],
pub excp_type: ::c_int,
}
pub struct utmpx {
pub ut_user: [::c_char; 256],
pub ut_id: [::c_char; 14],
pub ut_line: [::c_char; 64],
pub ut_pid: ::pid_t,
pub ut_type: ::c_short,
pub ut_tv: ::timeval,
pub ut_host: [::c_char; 256],
pub __dbl_word_pad: ::c_int,
pub __reservedA: [::c_int; 2],
pub __reservedV: [::c_int; 6],
}
pub struct pthread_spinlock_t {
pub __sp_word: [::c_long; 3],
}
pub struct pthread_barrier_t {
pub __br_word: [::c_long; 5],
}
pub struct msqid_ds {
pub msg_perm: ::ipc_perm,
pub msg_first: ::c_uint,
pub msg_last: ::c_uint,
pub msg_cbytes: ::c_uint,
pub msg_qnum: ::c_uint,
pub msg_qbytes: ::c_ulong,
pub msg_lspid: ::pid_t,
pub msg_lrpid: ::pid_t,
pub msg_stime: ::time_t,
pub msg_rtime: ::time_t,
pub msg_ctime: ::time_t,
pub msg_rwait: ::c_int,
pub msg_wwait: ::c_int,
pub msg_reqevents: ::c_ushort,
}
}
s_no_extra_traits! {
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
pub si_code: ::c_int,
pub si_pid: ::pid_t,
pub si_uid: ::uid_t,
pub si_status: ::c_int,
pub si_addr: *mut ::c_void,
pub si_band: ::c_long,
pub si_value: ::sigval,
pub __si_flags: ::c_int,
pub __pad: [::c_int; 3],
}
#[cfg(libc_union)]
pub union _kernel_simple_lock {
pub _slock: ::c_long,
// Should be pointer to 'lock_data_instrumented'
pub _slockp: *mut ::c_void,
}
pub struct fileops_t {
pub fo_rw: extern fn(file: *mut file, rw: ::uio_rw, io: *mut ::c_void, ext: ::c_long,
secattr: *mut ::c_void) -> ::c_int,
pub fo_ioctl: extern fn(file: *mut file, a: ::c_long, b: ::caddr_t, c: ::c_long,
d: ::c_long) -> ::c_int,
pub fo_select: extern fn(file: *mut file, a: ::c_int, b: *mut ::c_ushort,
c: extern fn()) -> ::c_int,
pub fo_close: extern fn(file: *mut file) -> ::c_int,
pub fo_fstat: extern fn(file: *mut file, sstat: *mut ::stat) -> ::c_int,
}
pub struct file {
pub f_flag: ::c_long,
pub f_count: ::c_int,
pub f_options: ::c_short,
pub f_type: ::c_short,
// Should be pointer to 'vnode'
pub f_data: *mut ::c_void,
pub f_offset: ::c_longlong,
pub f_dir_off: ::c_long,
// Should be pointer to 'cred'
pub f_cred: *mut ::c_void,
#[cfg(libc_union)]
pub f_lock: _kernel_simple_lock,
#[cfg(libc_union)]
pub f_offset_lock: _kernel_simple_lock,
pub f_vinfo: ::caddr_t,
pub f_ops: *mut fileops_t,
pub f_parentp: ::caddr_t,
pub f_fnamep: ::caddr_t,
pub f_fdata: [::c_char; 160],
}
#[cfg(libc_union)]
pub union __ld_info_file {
pub _ldinfo_fd: ::c_int,
pub _ldinfo_fp: *mut file,
pub _core_offset: ::c_long,
}
pub struct ld_info {
pub ldinfo_next: ::c_uint,
pub ldinfo_flags: ::c_uint,
#[cfg(libc_union)]
pub _file: __ld_info_file,
pub ldinfo_textorg: *mut ::c_void,
pub ldinfo_textsize: ::c_ulong,
pub ldinfo_dataorg: *mut ::c_void,
pub ldinfo_datasize: ::c_ulong,
pub ldinfo_filename: [::c_char; 2],
}
#[cfg(libc_union)]
pub union __pollfd_ext_u {
pub addr: *mut ::c_void,
pub data32: u32,
pub data: u64,
}
pub struct pollfd_ext {
pub fd: ::c_int,
pub events: ::c_ushort,
pub revents: ::c_ushort,
#[cfg(libc_union)]
pub data: __pollfd_ext_u,
}
}
impl siginfo_t {
pub unsafe fn si_addr(&self) -> *mut ::c_void {
self.si_addr
}
pub unsafe fn si_value(&self) -> ::sigval {
self.si_value
}
pub unsafe fn si_pid(&self) -> ::pid_t {
self.si_pid
}
pub unsafe fn si_uid(&self) -> ::uid_t {
self.si_uid
}
pub unsafe fn si_status(&self) -> ::c_int {
self.si_status
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for siginfo_t {
fn eq(&self, other: &siginfo_t) -> bool {
#[cfg(libc_union)]
let value_eq = self.si_value == other.si_value;
#[cfg(not(libc_union))]
let value_eq = true;
self.si_signo == other.si_signo
&& self.si_errno == other.si_errno
&& self.si_code == other.si_code
&& self.si_pid == other.si_pid
&& self.si_uid == other.si_uid
&& self.si_status == other.si_status
&& self.si_addr == other.si_addr
&& self.si_band == other.si_band
&& self.__si_flags == other.__si_flags
&& value_eq
}
}
impl Eq for siginfo_t {}
impl ::fmt::Debug for siginfo_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let mut struct_formatter = f.debug_struct("siginfo_t");
struct_formatter.field("si_signo", &self.si_signo);
struct_formatter.field("si_errno", &self.si_errno);
struct_formatter.field("si_code", &self.si_code);
struct_formatter.field("si_pid", &self.si_pid);
struct_formatter.field("si_uid", &self.si_uid);
struct_formatter.field("si_status", &self.si_status);
struct_formatter.field("si_addr", &self.si_addr);
struct_formatter.field("si_band", &self.si_band);
#[cfg(libc_union)]
struct_formatter.field("si_value", &self.si_value);
struct_formatter.field("__si_flags", &self.__si_flags);
struct_formatter.finish()
}
}
impl ::hash::Hash for siginfo_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.si_signo.hash(state);
self.si_errno.hash(state);
self.si_code.hash(state);
self.si_pid.hash(state);
self.si_uid.hash(state);
self.si_status.hash(state);
self.si_addr.hash(state);
self.si_band.hash(state);
#[cfg(libc_union)]
self.si_value.hash(state);
self.__si_flags.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for _kernel_simple_lock {
fn eq(&self, other: &_kernel_simple_lock) -> bool {
unsafe {
self._slock == other._slock
&& self._slockp == other._slockp
}
}
}
#[cfg(libc_union)]
impl Eq for _kernel_simple_lock {}
#[cfg(libc_union)]
impl ::fmt::Debug for _kernel_simple_lock {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("_kernel_simple_lock")
.field("_slock", unsafe { &self._slock })
.field("_slockp", unsafe { &self._slockp })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for _kernel_simple_lock {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
unsafe {
self._slock.hash(state);
self._slockp.hash(state);
}
}
}
impl PartialEq for fileops_t {
fn eq(&self, other: &fileops_t) -> bool {
self.fo_rw == other.fo_rw
&& self.fo_ioctl == other.fo_ioctl
&& self.fo_select == other.fo_select
&& self.fo_close == other.fo_close
&& self.fo_fstat == other.fo_fstat
}
}
impl Eq for fileops_t {}
impl ::fmt::Debug for fileops_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let mut struct_formatter = f.debug_struct("fileops_t");
struct_formatter.field("fo_rw", &self.fo_rw);
struct_formatter.field("fo_ioctl", &self.fo_ioctl);
struct_formatter.field("fo_select", &self.fo_select);
struct_formatter.field("fo_close", &self.fo_close);
struct_formatter.field("fo_fstat", &self.fo_fstat);
struct_formatter.finish()
}
}
impl ::hash::Hash for fileops_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.fo_rw.hash(state);
self.fo_ioctl.hash(state);
self.fo_select.hash(state);
self.fo_close.hash(state);
self.fo_fstat.hash(state);
}
}
impl PartialEq for file {
fn eq(&self, other: &file) -> bool {
#[cfg(libc_union)]
let lock_eq = self.f_lock == other.f_lock
&& self.f_offset_lock == other.f_offset_lock;
#[cfg(not(libc_union))]
let lock_eq = true;
self.f_flag == other.f_flag
&& self.f_count == other.f_count
&& self.f_options == other.f_options
&& self.f_type == other.f_type
&& self.f_data == other.f_data
&& self.f_offset == other.f_offset
&& self.f_dir_off == other.f_dir_off
&& self.f_cred == other.f_cred
&& self.f_vinfo == other.f_vinfo
&& self.f_ops == other.f_ops
&& self.f_parentp == other.f_parentp
&& self.f_fnamep == other.f_fnamep
&& self.f_fdata == other.f_fdata
&& lock_eq
}
}
impl Eq for file {}
impl ::fmt::Debug for file {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let mut struct_formatter = f.debug_struct("file");
struct_formatter.field("f_flag", &self.f_flag);
struct_formatter.field("f_count", &self.f_count);
struct_formatter.field("f_options", &self.f_options);
struct_formatter.field("f_type", &self.f_type);
struct_formatter.field("f_data", &self.f_data);
struct_formatter.field("f_offset", &self.f_offset);
struct_formatter.field("f_dir_off", &self.f_dir_off);
struct_formatter.field("f_cred", &self.f_cred);
#[cfg(libc_union)]
struct_formatter.field("f_lock", &self.f_lock);
#[cfg(libc_union)]
struct_formatter.field("f_offset_lock", &self.f_offset_lock);
struct_formatter.field("f_vinfo", &self.f_vinfo);
struct_formatter.field("f_ops", &self.f_ops);
struct_formatter.field("f_parentp", &self.f_parentp);
struct_formatter.field("f_fnamep", &self.f_fnamep);
struct_formatter.field("f_fdata", &self.f_fdata);
struct_formatter.finish()
}
}
impl ::hash::Hash for file {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.f_flag.hash(state);
self.f_count.hash(state);
self.f_options.hash(state);
self.f_type.hash(state);
self.f_data.hash(state);
self.f_offset.hash(state);
self.f_dir_off.hash(state);
self.f_cred.hash(state);
#[cfg(libc_union)]
self.f_lock.hash(state);
#[cfg(libc_union)]
self.f_offset_lock.hash(state);
self.f_vinfo.hash(state);
self.f_ops.hash(state);
self.f_parentp.hash(state);
self.f_fnamep.hash(state);
self.f_fdata.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for __ld_info_file {
fn eq(&self, other: &__ld_info_file) -> bool {
unsafe {
self._ldinfo_fd == other._ldinfo_fd
&& self._ldinfo_fp == other._ldinfo_fp
&& self._core_offset == other._core_offset
}
}
}
#[cfg(libc_union)]
impl Eq for __ld_info_file {}
#[cfg(libc_union)]
impl ::fmt::Debug for __ld_info_file {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("__ld_info_file")
.field("_ldinfo_fd", unsafe { &self._ldinfo_fd })
.field("_ldinfo_fp", unsafe { &self._ldinfo_fp })
.field("_core_offset", unsafe { &self._core_offset })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __ld_info_file {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
unsafe {
self._ldinfo_fd.hash(state);
self._ldinfo_fp.hash(state);
self._core_offset.hash(state);
}
}
}
impl PartialEq for ld_info {
fn eq(&self, other: &ld_info) -> bool {
#[cfg(libc_union)]
let file_eq = self._file == other._file;
#[cfg(not(libc_union))]
let file_eq = true;
self.ldinfo_next == other.ldinfo_next
&& self.ldinfo_flags == other.ldinfo_flags
&& self.ldinfo_textorg == other.ldinfo_textorg
&& self.ldinfo_textsize == other.ldinfo_textsize
&& self.ldinfo_dataorg == other.ldinfo_dataorg
&& self.ldinfo_datasize == other.ldinfo_datasize
&& self.ldinfo_filename == other.ldinfo_filename
&& file_eq
}
}
impl Eq for ld_info {}
impl ::fmt::Debug for ld_info {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let mut struct_formatter = f.debug_struct("ld_info");
struct_formatter.field("ldinfo_next", &self.ldinfo_next);
struct_formatter.field("ldinfo_flags", &self.ldinfo_flags);
struct_formatter.field("ldinfo_textorg", &self.ldinfo_textorg);
struct_formatter.field("ldinfo_textsize", &self.ldinfo_textsize);
struct_formatter.field("ldinfo_dataorg", &self.ldinfo_dataorg);
struct_formatter.field("ldinfo_datasize", &self.ldinfo_datasize);
struct_formatter.field("ldinfo_filename", &self.ldinfo_filename);
#[cfg(libc_union)]
struct_formatter.field("_file", &self._file);
struct_formatter.finish()
}
}
impl ::hash::Hash for ld_info {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.ldinfo_next.hash(state);
self.ldinfo_flags.hash(state);
self.ldinfo_textorg.hash(state);
self.ldinfo_textsize.hash(state);
self.ldinfo_dataorg.hash(state);
self.ldinfo_datasize.hash(state);
self.ldinfo_filename.hash(state);
#[cfg(libc_union)]
self._file.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for __pollfd_ext_u {
fn eq(&self, other: &__pollfd_ext_u) -> bool {
unsafe {
self.addr == other.addr
&& self.data32 == other.data32
&& self.data == other.data
}
}
}
#[cfg(libc_union)]
impl Eq for __pollfd_ext_u {}
#[cfg(libc_union)]
impl ::fmt::Debug for __pollfd_ext_u {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("__pollfd_ext_u")
.field("addr", unsafe { &self.addr })
.field("data32", unsafe { &self.data32 })
.field("data", unsafe { &self.data })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __pollfd_ext_u {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
unsafe {
self.addr.hash(state);
self.data.hash(state);
self.data32.hash(state);
}
}
}
impl PartialEq for pollfd_ext {
fn eq(&self, other: &pollfd_ext) -> bool {
#[cfg(libc_union)]
let data_eq = self.data == other.data;
#[cfg(not(libc_union))]
let data_eq = true;
self.fd == other.fd
&& self.events == other.events
&& self.revents == other.revents
&& data_eq
}
}
impl Eq for pollfd_ext {}
impl ::fmt::Debug for pollfd_ext {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let mut struct_formatter = f.debug_struct("pollfd_ext");
struct_formatter.field("fd", &self.fd);
struct_formatter.field("events", &self.events);
struct_formatter.field("revents", &self.revents);
#[cfg(libc_union)]
struct_formatter.field("data", &self.data);
struct_formatter.finish()
}
}
impl ::hash::Hash for pollfd_ext {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.fd.hash(state);
self.events.hash(state);
self.revents.hash(state);
#[cfg(libc_union)]
self.data.hash(state);
}
}
}
}
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
__mt_word: [0, 2, 0, 0, 0, 0, 0, 0],
};
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
__cv_word: [0, 0, 0, 0, 2, 0],
};
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
__rw_word: [2, 0, 0, 0, 0, 0, 0, 0, 0, 0],
};
pub const RLIM_INFINITY: ::c_ulong = 0x7fffffffffffffff;
extern "C" {
pub fn getsystemcfg(label: ::c_int) -> ::c_ulong;
}

14
vendor/libc/src/unix/align.rs vendored Normal file
View file

@ -0,0 +1,14 @@
s! {
#[repr(align(4))]
pub struct in6_addr {
pub s6_addr: [u8; 16],
}
}
pub const IN6ADDR_LOOPBACK_INIT: in6_addr = in6_addr {
s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
};
pub const IN6ADDR_ANY_INIT: in6_addr = in6_addr {
s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
};

View file

@ -0,0 +1,7 @@
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 2]
}
}

View file

@ -0,0 +1,154 @@
//! 32-bit specific Apple (ios/darwin) definitions
pub type c_long = i32;
pub type c_ulong = u32;
pub type boolean_t = ::c_int;
s! {
pub struct if_data {
pub ifi_type: ::c_uchar,
pub ifi_typelen: ::c_uchar,
pub ifi_physical: ::c_uchar,
pub ifi_addrlen: ::c_uchar,
pub ifi_hdrlen: ::c_uchar,
pub ifi_recvquota: ::c_uchar,
pub ifi_xmitquota: ::c_uchar,
pub ifi_unused1: ::c_uchar,
pub ifi_mtu: u32,
pub ifi_metric: u32,
pub ifi_baudrate: u32,
pub ifi_ipackets: u32,
pub ifi_ierrors: u32,
pub ifi_opackets: u32,
pub ifi_oerrors: u32,
pub ifi_collisions: u32,
pub ifi_ibytes: u32,
pub ifi_obytes: u32,
pub ifi_imcasts: u32,
pub ifi_omcasts: u32,
pub ifi_iqdrops: u32,
pub ifi_noproto: u32,
pub ifi_recvtiming: u32,
pub ifi_xmittiming: u32,
pub ifi_lastchange: ::timeval,
pub ifi_unused2: u32,
pub ifi_hwassist: u32,
pub ifi_reserved1: u32,
pub ifi_reserved2: u32,
}
pub struct bpf_hdr {
pub bh_tstamp: ::timeval,
pub bh_caplen: u32,
pub bh_datalen: u32,
pub bh_hdrlen: ::c_ushort,
}
pub struct malloc_zone_t {
__private: [::uintptr_t; 18], // FIXME: keeping private for now
}
}
s_no_extra_traits! {
pub struct pthread_attr_t {
__sig: c_long,
__opaque: [::c_char; 36]
}
pub struct pthread_once_t {
__sig: c_long,
__opaque: [::c_char; ::__PTHREAD_ONCE_SIZE__],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for pthread_attr_t {
fn eq(&self, other: &pthread_attr_t) -> bool {
self.__sig == other.__sig
&& self.__opaque
.iter()
.zip(other.__opaque.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_attr_t {}
impl ::fmt::Debug for pthread_attr_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_attr_t")
.field("__sig", &self.__sig)
// FIXME: .field("__opaque", &self.__opaque)
.finish()
}
}
impl ::hash::Hash for pthread_attr_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.__sig.hash(state);
self.__opaque.hash(state);
}
}
impl PartialEq for pthread_once_t {
fn eq(&self, other: &pthread_once_t) -> bool {
self.__sig == other.__sig
&& self.__opaque
.iter()
.zip(other.__opaque.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_once_t {}
impl ::fmt::Debug for pthread_once_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_once_t")
.field("__sig", &self.__sig)
.finish()
}
}
impl ::hash::Hash for pthread_once_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.__sig.hash(state);
self.__opaque.hash(state);
}
}
}
}
#[doc(hidden)]
#[deprecated(since = "0.2.55")]
pub const NET_RT_MAXID: ::c_int = 10;
pub const __PTHREAD_MUTEX_SIZE__: usize = 40;
pub const __PTHREAD_COND_SIZE__: usize = 24;
pub const __PTHREAD_CONDATTR_SIZE__: usize = 4;
pub const __PTHREAD_ONCE_SIZE__: usize = 4;
pub const __PTHREAD_RWLOCK_SIZE__: usize = 124;
pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 12;
pub const TIOCTIMESTAMP: ::c_ulong = 0x40087459;
pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40087458;
pub const BIOCSETF: ::c_ulong = 0x80084267;
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8008426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4008426e;
pub const BIOCSETFNR: ::c_ulong = 0x8008427e;
const _PTHREAD_ONCE_SIG_INIT: c_long = 0x30B1BCBA;
pub const PTHREAD_ONCE_INIT: ::pthread_once_t = ::pthread_once_t {
__sig: _PTHREAD_ONCE_SIG_INIT,
__opaque: [0; 4],
};
extern "C" {
pub fn exchangedata(
path1: *const ::c_char,
path2: *const ::c_char,
options: ::c_ulong,
) -> ::c_int;
}
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}

View file

@ -0,0 +1,55 @@
pub type mcontext_t = *mut __darwin_mcontext64;
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
pub struct max_align_t {
priv_: f64
}
}
s! {
pub struct ucontext_t {
pub uc_onstack: ::c_int,
pub uc_sigmask: ::sigset_t,
pub uc_stack: ::stack_t,
pub uc_link: *mut ::ucontext_t,
pub uc_mcsize: usize,
pub uc_mcontext: mcontext_t,
}
pub struct __darwin_mcontext64 {
pub __es: __darwin_arm_exception_state64,
pub __ss: __darwin_arm_thread_state64,
pub __ns: __darwin_arm_neon_state64,
}
pub struct __darwin_arm_exception_state64 {
pub __far: u64,
pub __esr: u32,
pub __exception: u32,
}
pub struct __darwin_arm_thread_state64 {
pub __x: [u64; 29],
pub __fp: u64,
pub __lr: u64,
pub __sp: u64,
pub __pc: u64,
pub __cpsr: u32,
pub __pad: u32,
}
// This type natively uses a uint128, but for a while we hacked
// it in with repr(align) and `[u64; 2]`. uint128 isn't available
// all the way back to our earliest supported versions so we
// preserver the old shim.
#[cfg_attr(not(libc_int128), repr(align(16)))]
pub struct __darwin_arm_neon_state64 {
#[cfg(libc_int128)]
pub __v: [::__uint128_t; 32],
#[cfg(not(libc_int128))]
pub __v: [[u64; 2]; 32],
pub __fpsr: u32,
pub __fpcr: u32,
}
}

View file

@ -0,0 +1,14 @@
pub type boolean_t = ::c_int;
s! {
pub struct malloc_zone_t {
__private: [::uintptr_t; 18], // FIXME: needs arm64 auth pointers support
}
}
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}

View file

@ -0,0 +1,7 @@
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 2]
}
}

View file

@ -0,0 +1,159 @@
//! 64-bit specific Apple (ios/darwin) definitions
pub type c_long = i64;
pub type c_ulong = u64;
s! {
pub struct timeval32 {
pub tv_sec: i32,
pub tv_usec: i32,
}
pub struct if_data {
pub ifi_type: ::c_uchar,
pub ifi_typelen: ::c_uchar,
pub ifi_physical: ::c_uchar,
pub ifi_addrlen: ::c_uchar,
pub ifi_hdrlen: ::c_uchar,
pub ifi_recvquota: ::c_uchar,
pub ifi_xmitquota: ::c_uchar,
pub ifi_unused1: ::c_uchar,
pub ifi_mtu: u32,
pub ifi_metric: u32,
pub ifi_baudrate: u32,
pub ifi_ipackets: u32,
pub ifi_ierrors: u32,
pub ifi_opackets: u32,
pub ifi_oerrors: u32,
pub ifi_collisions: u32,
pub ifi_ibytes: u32,
pub ifi_obytes: u32,
pub ifi_imcasts: u32,
pub ifi_omcasts: u32,
pub ifi_iqdrops: u32,
pub ifi_noproto: u32,
pub ifi_recvtiming: u32,
pub ifi_xmittiming: u32,
pub ifi_lastchange: timeval32,
pub ifi_unused2: u32,
pub ifi_hwassist: u32,
pub ifi_reserved1: u32,
pub ifi_reserved2: u32,
}
pub struct bpf_hdr {
pub bh_tstamp: ::timeval32,
pub bh_caplen: u32,
pub bh_datalen: u32,
pub bh_hdrlen: ::c_ushort,
}
}
s_no_extra_traits! {
pub struct pthread_attr_t {
__sig: c_long,
__opaque: [::c_char; 56]
}
pub struct pthread_once_t {
__sig: c_long,
__opaque: [::c_char; __PTHREAD_ONCE_SIZE__],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for pthread_attr_t {
fn eq(&self, other: &pthread_attr_t) -> bool {
self.__sig == other.__sig
&& self.__opaque
.iter()
.zip(other.__opaque.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_attr_t {}
impl ::fmt::Debug for pthread_attr_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_attr_t")
.field("__sig", &self.__sig)
// FIXME: .field("__opaque", &self.__opaque)
.finish()
}
}
impl ::hash::Hash for pthread_attr_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.__sig.hash(state);
self.__opaque.hash(state);
}
}
impl PartialEq for pthread_once_t {
fn eq(&self, other: &pthread_once_t) -> bool {
self.__sig == other.__sig
&& self.__opaque
.iter()
.zip(other.__opaque.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_once_t {}
impl ::fmt::Debug for pthread_once_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_once_t")
.field("__sig", &self.__sig)
.finish()
}
}
impl ::hash::Hash for pthread_once_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.__sig.hash(state);
self.__opaque.hash(state);
}
}
}
}
#[doc(hidden)]
#[deprecated(since = "0.2.55")]
pub const NET_RT_MAXID: ::c_int = 11;
pub const __PTHREAD_MUTEX_SIZE__: usize = 56;
pub const __PTHREAD_COND_SIZE__: usize = 40;
pub const __PTHREAD_CONDATTR_SIZE__: usize = 8;
pub const __PTHREAD_ONCE_SIZE__: usize = 8;
pub const __PTHREAD_RWLOCK_SIZE__: usize = 192;
pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 16;
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40107458;
pub const BIOCSETF: ::c_ulong = 0x80104267;
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
pub const BIOCSETFNR: ::c_ulong = 0x8010427e;
const _PTHREAD_ONCE_SIG_INIT: c_long = 0x30B1BCBA;
pub const PTHREAD_ONCE_INIT: ::pthread_once_t = ::pthread_once_t {
__sig: _PTHREAD_ONCE_SIG_INIT,
__opaque: [0; 8],
};
extern "C" {
pub fn exchangedata(
path1: *const ::c_char,
path2: *const ::c_char,
options: ::c_uint,
) -> ::c_int;
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
} else if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else {
// Unknown target_arch
}
}

View file

@ -0,0 +1,7 @@
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 2]
}
}

View file

@ -0,0 +1,180 @@
pub type boolean_t = ::c_uint;
pub type mcontext_t = *mut __darwin_mcontext64;
s! {
pub struct ucontext_t {
pub uc_onstack: ::c_int,
pub uc_sigmask: ::sigset_t,
pub uc_stack: ::stack_t,
pub uc_link: *mut ::ucontext_t,
pub uc_mcsize: usize,
pub uc_mcontext: mcontext_t,
}
pub struct __darwin_mcontext64 {
pub __es: __darwin_x86_exception_state64,
pub __ss: __darwin_x86_thread_state64,
pub __fs: __darwin_x86_float_state64,
}
pub struct __darwin_x86_exception_state64 {
pub __trapno: u16,
pub __cpu: u16,
pub __err: u32,
pub __faultvaddr: u64,
}
pub struct __darwin_x86_thread_state64 {
pub __rax: u64,
pub __rbx: u64,
pub __rcx: u64,
pub __rdx: u64,
pub __rdi: u64,
pub __rsi: u64,
pub __rbp: u64,
pub __rsp: u64,
pub __r8: u64,
pub __r9: u64,
pub __r10: u64,
pub __r11: u64,
pub __r12: u64,
pub __r13: u64,
pub __r14: u64,
pub __r15: u64,
pub __rip: u64,
pub __rflags: u64,
pub __cs: u64,
pub __fs: u64,
pub __gs: u64,
}
pub struct __darwin_x86_float_state64 {
pub __fpu_reserved: [::c_int; 2],
__fpu_fcw: ::c_short,
__fpu_fsw: ::c_short,
pub __fpu_ftw: u8,
pub __fpu_rsrv1: u8,
pub __fpu_fop: u16,
pub __fpu_ip: u32,
pub __fpu_cs: u16,
pub __fpu_rsrv2: u16,
pub __fpu_dp: u32,
pub __fpu_ds: u16,
pub __fpu_rsrv3: u16,
pub __fpu_mxcsr: u32,
pub __fpu_mxcsrmask: u32,
pub __fpu_stmm0: __darwin_mmst_reg,
pub __fpu_stmm1: __darwin_mmst_reg,
pub __fpu_stmm2: __darwin_mmst_reg,
pub __fpu_stmm3: __darwin_mmst_reg,
pub __fpu_stmm4: __darwin_mmst_reg,
pub __fpu_stmm5: __darwin_mmst_reg,
pub __fpu_stmm6: __darwin_mmst_reg,
pub __fpu_stmm7: __darwin_mmst_reg,
pub __fpu_xmm0: __darwin_xmm_reg,
pub __fpu_xmm1: __darwin_xmm_reg,
pub __fpu_xmm2: __darwin_xmm_reg,
pub __fpu_xmm3: __darwin_xmm_reg,
pub __fpu_xmm4: __darwin_xmm_reg,
pub __fpu_xmm5: __darwin_xmm_reg,
pub __fpu_xmm6: __darwin_xmm_reg,
pub __fpu_xmm7: __darwin_xmm_reg,
pub __fpu_xmm8: __darwin_xmm_reg,
pub __fpu_xmm9: __darwin_xmm_reg,
pub __fpu_xmm10: __darwin_xmm_reg,
pub __fpu_xmm11: __darwin_xmm_reg,
pub __fpu_xmm12: __darwin_xmm_reg,
pub __fpu_xmm13: __darwin_xmm_reg,
pub __fpu_xmm14: __darwin_xmm_reg,
pub __fpu_xmm15: __darwin_xmm_reg,
// this field is actually [u8; 96], but defining it with a bigger type
// allows us to auto-implement traits for it since the length of the
// array is less than 32
__fpu_rsrv4: [u32; 24],
pub __fpu_reserved1: ::c_int,
}
pub struct __darwin_mmst_reg {
pub __mmst_reg: [::c_char; 10],
pub __mmst_rsrv: [::c_char; 6],
}
pub struct __darwin_xmm_reg {
pub __xmm_reg: [::c_char; 16],
}
pub struct malloc_introspection_t {
_private: [::uintptr_t; 16], // FIXME: keeping private for now
}
pub struct malloc_zone_t {
_reserved1: *mut ::c_void,
_reserved2: *mut ::c_void,
pub size: ::Option<unsafe extern "C" fn(
zone: *mut malloc_zone_t,
ptr: *const ::c_void,
) -> ::size_t>,
pub malloc: ::Option<unsafe extern "C" fn(
zone: *mut malloc_zone_t,
size: ::size_t,
) -> *mut ::c_void>,
pub calloc: ::Option<unsafe extern "C" fn(
zone: *mut malloc_zone_t,
num_items: ::size_t,
size: ::size_t,
) -> *mut ::c_void>,
pub valloc: ::Option<unsafe extern "C" fn(
zone: *mut malloc_zone_t,
size: ::size_t
) -> *mut ::c_void>,
pub free: ::Option<unsafe extern "C" fn(
zone: *mut malloc_zone_t,
ptr: *mut ::c_void
)>,
pub realloc: ::Option<unsafe extern "C" fn(
zone: *mut malloc_zone_t,
ptr: *mut ::c_void,
size: ::size_t,
) -> *mut ::c_void>,
pub destroy: ::Option<unsafe extern "C" fn(zone: *mut malloc_zone_t)>,
pub zone_name: *const ::c_char,
pub batch_malloc: ::Option<unsafe extern "C" fn(
zone: *mut malloc_zone_t,
size: ::size_t,
results: *mut *mut ::c_void,
num_requested: ::c_uint,
) -> ::c_uint>,
pub batch_free: ::Option<unsafe extern "C" fn(
zone: *mut malloc_zone_t,
to_be_freed: *mut *mut ::c_void,
num_to_be_freed: ::c_uint,
)>,
pub introspect: *mut malloc_introspection_t,
pub version: ::c_uint,
pub memalign: ::Option<unsafe extern "C" fn(
zone: *mut malloc_zone_t,
alignment: ::size_t,
size: ::size_t,
) -> *mut ::c_void>,
pub free_definite_size: ::Option<unsafe extern "C" fn(
zone: *mut malloc_zone_t,
ptr: *mut ::c_void,
size: ::size_t
)>,
pub pressure_relief: ::Option<unsafe extern "C" fn(
zone: *mut malloc_zone_t,
goal: ::size_t,
) -> ::size_t>,
pub claimed_address: ::Option<unsafe extern "C" fn(
zone: *mut malloc_zone_t,
ptr: *mut ::c_void,
) -> ::boolean_t>,
}
}
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}

View file

@ -0,0 +1,8 @@
s! {
pub struct ctl_info {
pub ctl_id: u32,
pub ctl_name: [::c_char; MAX_KCTL_NAME],
}
}
pub const MAX_KCTL_NAME: usize = 96;

6630
vendor/libc/src/unix/bsd/apple/mod.rs vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
// DragonFlyBSD's __error function is declared with "static inline", so it must
// be implemented in the libc crate, as a pointer to a static thread_local.
f! {
#[deprecated(since = "0.2.77", note = "Use `__errno_location()` instead")]
pub fn __error() -> *mut ::c_int {
&mut errno
}
}
extern "C" {
#[thread_local]
pub static mut errno: ::c_int;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,146 @@
pub type c_char = u8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type wchar_t = u32;
pub type time_t = i64;
pub type suseconds_t = i64;
pub type register_t = i64;
s_no_extra_traits! {
pub struct gpregs {
pub gp_x: [::register_t; 30],
pub gp_lr: ::register_t,
pub gp_sp: ::register_t,
pub gp_elr: ::register_t,
pub gp_spsr: u32,
pub gp_pad: ::c_int,
}
pub struct fpregs {
pub fp_q: u128,
pub fp_sr: u32,
pub fp_cr: u32,
pub fp_flags: ::c_int,
pub fp_pad: ::c_int,
}
pub struct mcontext_t {
pub mc_gpregs: gpregs,
pub mc_fpregs: fpregs,
pub mc_flags: ::c_int,
pub mc_pad: ::c_int,
pub mc_spare: [u64; 8],
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for gpregs {
fn eq(&self, other: &gpregs) -> bool {
self.gp_x.iter().zip(other.gp_x.iter()).all(|(a, b)| a == b) &&
self.gp_lr == other.gp_lr &&
self.gp_sp == other.gp_sp &&
self.gp_elr == other.gp_elr &&
self.gp_spsr == other.gp_spsr &&
self.gp_pad == other.gp_pad
}
}
impl Eq for gpregs {}
impl ::fmt::Debug for gpregs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("gpregs")
.field("gp_x", &self.gp_x)
.field("gp_lr", &self.gp_lr)
.field("gp_sp", &self.gp_sp)
.field("gp_elr", &self.gp_elr)
.field("gp_spsr", &self.gp_spsr)
.field("gp_pad", &self.gp_pad)
.finish()
}
}
impl ::hash::Hash for gpregs {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.gp_x.hash(state);
self.gp_lr.hash(state);
self.gp_sp.hash(state);
self.gp_elr.hash(state);
self.gp_spsr.hash(state);
self.gp_pad.hash(state);
}
}
impl PartialEq for fpregs {
fn eq(&self, other: &fpregs) -> bool {
self.fp_q == other.fp_q &&
self.fp_sr == other.fp_sr &&
self.fp_cr == other.fp_cr &&
self.fp_flags == other.fp_flags &&
self.fp_pad == other.fp_pad
}
}
impl Eq for fpregs {}
impl ::fmt::Debug for fpregs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("fpregs")
.field("fp_q", &self.fp_q)
.field("fp_sr", &self.fp_sr)
.field("fp_cr", &self.fp_cr)
.field("fp_flags", &self.fp_flags)
.field("fp_pad", &self.fp_pad)
.finish()
}
}
impl ::hash::Hash for fpregs {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.fp_q.hash(state);
self.fp_sr.hash(state);
self.fp_cr.hash(state);
self.fp_flags.hash(state);
self.fp_pad.hash(state);
}
}
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.mc_gpregs == other.mc_gpregs &&
self.mc_fpregs == other.mc_fpregs &&
self.mc_flags == other.mc_flags &&
self.mc_pad == other.mc_pad &&
self.mc_spare.iter().zip(other.mc_spare.iter()).all(|(a, b)| a == b)
}
}
impl Eq for mcontext_t {}
impl ::fmt::Debug for mcontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("mcontext_t")
.field("mc_gpregs", &self.mc_gpregs)
.field("mc_fpregs", &self.mc_fpregs)
.field("mc_flags", &self.mc_flags)
.field("mc_pad", &self.mc_pad)
.field("mc_spare", &self.mc_spare)
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.mc_gpregs.hash(state);
self.mc_fpregs.hash(state);
self.mc_flags.hash(state);
self.mc_pad.hash(state);
self.mc_spare.hash(state);
}
}
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4

View file

@ -0,0 +1,20 @@
pub type c_char = u8;
pub type c_long = i32;
pub type c_ulong = u32;
pub type wchar_t = u32;
pub type time_t = i64;
pub type suseconds_t = i32;
pub type register_t = i32;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 4 - 1;
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4

View file

@ -0,0 +1,33 @@
#[repr(C)]
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u32,
pub st_lspare: i32,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
__unused: [u8; 8],
}
impl ::Copy for ::stat {}
impl ::Clone for ::stat {
fn clone(&self) -> ::stat {
*self
}
}

View file

@ -0,0 +1,32 @@
#[repr(C)]
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u32,
pub st_lspare: i32,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
}
impl ::Copy for ::stat {}
impl ::Clone for ::stat {
fn clone(&self) -> ::stat {
*self
}
}

View file

@ -0,0 +1,489 @@
// APIs that were changed after FreeBSD 11
// The type of `nlink_t` changed from `u16` to `u64` in FreeBSD 12:
pub type nlink_t = u16;
// Type of `dev_t` changed from `u32` to `u64` in FreeBSD 12:
pub type dev_t = u32;
// Type of `ino_t` changed from `__uint32_t` to `__uint64_t` in FreeBSD 12:
pub type ino_t = u32;
s! {
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
pub data: ::intptr_t,
pub udata: *mut ::c_void,
}
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
// Type of shm_nattc changed from `int` to `shmatt_t` (aka `unsigned
// int`) in FreeBSD 12:
pub shm_nattch: ::c_int,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
}
pub struct kinfo_proc {
/// Size of this structure.
pub ki_structsize: ::c_int,
/// Reserved: layout identifier.
pub ki_layout: ::c_int,
/// Address of command arguments.
pub ki_args: *mut ::pargs,
// This is normally "struct proc".
/// Address of proc.
pub ki_paddr: *mut ::c_void,
// This is normally "struct user".
/// Kernel virtual address of u-area.
pub ki_addr: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to trace file.
pub ki_tracep: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut ::c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut ::c_void,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut ::c_void,
/// Sleep address.
pub ki_wchan: *mut ::c_void,
/// Process identifier.
pub ki_pid: ::pid_t,
/// Parent process ID.
pub ki_ppid: ::pid_t,
/// Process group ID.
pub ki_pgid: ::pid_t,
/// tty process group ID.
pub ki_tpgid: ::pid_t,
/// Process session ID.
pub ki_sid: ::pid_t,
/// Terminal session ID.
pub ki_tsid: ::pid_t,
/// Job control counter.
pub ki_jobc: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short1: ::c_short,
/// Controlling tty dev.
pub ki_tdev: ::dev_t,
/// Signals arrived but not delivered.
pub ki_siglist: ::sigset_t,
/// Current signal mask.
pub ki_sigmask: ::sigset_t,
/// Signals being ignored.
pub ki_sigignore: ::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: ::sigset_t,
/// Effective user ID.
pub ki_uid: ::uid_t,
/// Real user ID.
pub ki_ruid: ::uid_t,
/// Saved effective user ID.
pub ki_svuid: ::uid_t,
/// Real group ID.
pub ki_rgid: ::gid_t,
/// Saved effective group ID.
pub ki_svgid: ::gid_t,
/// Number of groups.
pub ki_ngroups: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short2: ::c_short,
/// Groups.
pub ki_groups: [::gid_t; ::KI_NGROUPS],
/// Virtual size.
pub ki_size: ::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: ::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: ::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: ::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: ::segsz_t,
/// Stack size (pages).
pub ki_ssize: ::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: ::u_short,
/// Accounting flags.
pub ki_acflag: ::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: ::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: ::u_int,
/// Time since last blocked.
pub ki_slptime: ::u_int,
/// Time swapped in or out.
pub ki_swtime: ::u_int,
/// Number of copy-on-write faults.
pub ki_cow: ::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: ::timeval,
/// Time used by process children.
pub ki_childtime: ::timeval,
/// P_* flags.
pub ki_flag: ::c_long,
/// KI_* flags (below).
pub ki_kiflag: ::c_long,
/// Kernel trace points.
pub ki_traceflag: ::c_int,
/// S* process status.
pub ki_stat: ::c_char,
/// Process "nice" value.
pub ki_nice: i8, // signed char
/// Process lock (prevent swap) count.
pub ki_lock: ::c_char,
/// Run queue index.
pub ki_rqindex: ::c_char,
/// Which cpu we are on.
pub ki_oncpu_old: ::c_uchar,
/// Last cpu we were on.
pub ki_lastcpu_old: ::c_uchar,
/// Thread name.
pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [::c_char; ::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [::c_char; ::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
/// Spare string space.
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.
pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
/// Which cpu we are on.
pub ki_oncpu: ::c_int,
/// Last cpu we were on.
pub ki_lastcpu: ::c_int,
/// PID of tracing process.
pub ki_tracer: ::c_int,
/// P2_* flags.
pub ki_flag2: ::c_int,
/// Default FIB number.
pub ki_fibnum: ::c_int,
/// Credential flags.
pub ki_cr_flags: ::u_int,
/// Process jail ID.
pub ki_jid: ::c_int,
/// Number of threads in total.
pub ki_numthreads: ::c_int,
/// Thread ID.
pub ki_tid: ::lwpid_t,
/// Process priority.
pub ki_pri: ::priority,
/// Process rusage statistics.
pub ki_rusage: ::rusage,
/// rusage of children processes.
pub ki_rusage_ch: ::rusage,
// This is normally "struct pcb".
/// Kernel virtual addr of pcb.
pub ki_pcb: *mut ::c_void,
/// Kernel virtual addr of stack.
pub ki_kstack: *mut ::c_void,
/// User convenience pointer.
pub ki_udata: *mut ::c_void,
// This is normally "struct thread".
pub ki_tdaddr: *mut ::c_void,
pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: ::c_long,
/// kthread flag.
pub ki_tdflags: ::c_long,
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_reclen: u16,
pub d_type: u8,
// Type of `d_namlen` changed from `char` to `u16` in FreeBSD 12:
pub d_namlen: u8,
pub d_name: [::c_char; 256],
}
pub struct statfs {
pub f_version: u32,
pub f_type: u32,
pub f_flags: u64,
pub f_bsize: u64,
pub f_iosize: u64,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: i64,
pub f_files: u64,
pub f_ffree: i64,
pub f_syncwrites: u64,
pub f_asyncwrites: u64,
pub f_syncreads: u64,
pub f_asyncreads: u64,
f_spare: [u64; 10],
pub f_namemax: u32,
pub f_owner: ::uid_t,
pub f_fsid: ::fsid_t,
f_charspare: [::c_char; 80],
pub f_fstypename: [::c_char; 16],
// Array length changed from 88 to 1024 in FreeBSD 12:
pub f_mntfromname: [::c_char; 88],
// Array length changed from 88 to 1024 in FreeBSD 12:
pub f_mntonname: [::c_char; 88],
}
pub struct vnstat {
pub vn_fileid: u64,
pub vn_size: u64,
pub vn_mntdir: *mut ::c_char,
pub vn_dev: u32,
pub vn_fsid: u32,
pub vn_type: ::c_int,
pub vn_mode: u16,
pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for statfs {
fn eq(&self, other: &statfs) -> bool {
self.f_version == other.f_version
&& self.f_type == other.f_type
&& self.f_flags == other.f_flags
&& self.f_bsize == other.f_bsize
&& self.f_iosize == other.f_iosize
&& self.f_blocks == other.f_blocks
&& self.f_bfree == other.f_bfree
&& self.f_bavail == other.f_bavail
&& self.f_files == other.f_files
&& self.f_ffree == other.f_ffree
&& self.f_syncwrites == other.f_syncwrites
&& self.f_asyncwrites == other.f_asyncwrites
&& self.f_syncreads == other.f_syncreads
&& self.f_asyncreads == other.f_asyncreads
&& self.f_namemax == other.f_namemax
&& self.f_owner == other.f_owner
&& self.f_fsid == other.f_fsid
&& self.f_fstypename == other.f_fstypename
&& self
.f_mntfromname
.iter()
.zip(other.f_mntfromname.iter())
.all(|(a,b)| a == b)
&& self
.f_mntonname
.iter()
.zip(other.f_mntonname.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for statfs {}
impl ::fmt::Debug for statfs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("statfs")
.field("f_bsize", &self.f_bsize)
.field("f_iosize", &self.f_iosize)
.field("f_blocks", &self.f_blocks)
.field("f_bfree", &self.f_bfree)
.field("f_bavail", &self.f_bavail)
.field("f_files", &self.f_files)
.field("f_ffree", &self.f_ffree)
.field("f_syncwrites", &self.f_syncwrites)
.field("f_asyncwrites", &self.f_asyncwrites)
.field("f_syncreads", &self.f_syncreads)
.field("f_asyncreads", &self.f_asyncreads)
.field("f_namemax", &self.f_namemax)
.field("f_owner", &self.f_owner)
.field("f_fsid", &self.f_fsid)
.field("f_fstypename", &self.f_fstypename)
.field("f_mntfromname", &&self.f_mntfromname[..])
.field("f_mntonname", &&self.f_mntonname[..])
.finish()
}
}
impl ::hash::Hash for statfs {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.f_version.hash(state);
self.f_type.hash(state);
self.f_flags.hash(state);
self.f_bsize.hash(state);
self.f_iosize.hash(state);
self.f_blocks.hash(state);
self.f_bfree.hash(state);
self.f_bavail.hash(state);
self.f_files.hash(state);
self.f_ffree.hash(state);
self.f_syncwrites.hash(state);
self.f_asyncwrites.hash(state);
self.f_syncreads.hash(state);
self.f_asyncreads.hash(state);
self.f_namemax.hash(state);
self.f_owner.hash(state);
self.f_fsid.hash(state);
self.f_fstypename.hash(state);
self.f_mntfromname.hash(state);
self.f_mntonname.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_fileno == other.d_fileno
&& self.d_reclen == other.d_reclen
&& self.d_type == other.d_type
&& self.d_namlen == other.d_namlen
&& self
.d_name[..self.d_namlen as _]
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_fileno", &self.d_fileno)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
.field("d_namlen", &self.d_namlen)
.field("d_name", &&self.d_name[..self.d_namlen as _])
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.d_fileno.hash(state);
self.d_reclen.hash(state);
self.d_type.hash(state);
self.d_namlen.hash(state);
self.d_name[..self.d_namlen as _].hash(state);
}
}
impl PartialEq for vnstat {
fn eq(&self, other: &vnstat) -> bool {
let self_vn_devname: &[::c_char] = &self.vn_devname;
let other_vn_devname: &[::c_char] = &other.vn_devname;
self.vn_fileid == other.vn_fileid &&
self.vn_size == other.vn_size &&
self.vn_mntdir == other.vn_mntdir &&
self.vn_dev == other.vn_dev &&
self.vn_fsid == other.vn_fsid &&
self.vn_type == other.vn_type &&
self.vn_mode == other.vn_mode &&
self_vn_devname == other_vn_devname
}
}
impl Eq for vnstat {}
impl ::fmt::Debug for vnstat {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let self_vn_devname: &[::c_char] = &self.vn_devname;
f.debug_struct("vnstat")
.field("vn_fileid", &self.vn_fileid)
.field("vn_size", &self.vn_size)
.field("vn_mntdir", &self.vn_mntdir)
.field("vn_dev", &self.vn_dev)
.field("vn_fsid", &self.vn_fsid)
.field("vn_type", &self.vn_type)
.field("vn_mode", &self.vn_mode)
.field("vn_devname", &self_vn_devname)
.finish()
}
}
impl ::hash::Hash for vnstat {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
let self_vn_devname: &[::c_char] = &self.vn_devname;
self.vn_fileid.hash(state);
self.vn_size.hash(state);
self.vn_mntdir.hash(state);
self.vn_dev.hash(state);
self.vn_fsid.hash(state);
self.vn_type.hash(state);
self.vn_mode.hash(state);
self_vn_devname.hash(state);
}
}
}
}
pub const ELAST: ::c_int = 96;
pub const RAND_MAX: ::c_int = 0x7fff_fffd;
pub const KI_NSPARE_PTR: usize = 6;
pub const MINCORE_SUPER: ::c_int = 0x20;
/// max length of devicename
pub const SPECNAMELEN: ::c_int = 63;
safe_f! {
pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
(major << 8) | minor
}
}
f! {
pub fn major(dev: ::dev_t) -> ::c_int {
((dev >> 8) & 0xff) as ::c_int
}
pub fn minor(dev: ::dev_t) -> ::c_int {
(dev & 0xffff00ff) as ::c_int
}
}
extern "C" {
// Return type ::c_int was removed in FreeBSD 12
pub fn setgrent() -> ::c_int;
// Type of `addr` argument changed from `const void*` to `void*`
// in FreeBSD 12
pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
// Return type ::c_int was removed in FreeBSD 12
pub fn freelocale(loc: ::locale_t) -> ::c_int;
// Return type ::c_int changed to ::ssize_t in FreeBSD 12:
pub fn msgrcv(
msqid: ::c_int,
msgp: *mut ::c_void,
msgsz: ::size_t,
msgtyp: ::c_long,
msgflg: ::c_int,
) -> ::c_int;
// Type of `path` argument changed from `const void*` to `void*`
// in FreeBSD 12
pub fn dirname(path: *const ::c_char) -> *mut ::c_char;
pub fn basename(path: *const ::c_char) -> *mut ::c_char;
}
cfg_if! {
if #[cfg(target_pointer_width = "64")] {
mod b64;
pub use self::b64::*;
} else {
mod b32;
pub use self::b32::*;
}
}

View file

@ -0,0 +1,530 @@
// APIs in FreeBSD 12 that have changed since 11.
pub type nlink_t = u64;
pub type dev_t = u64;
pub type ino_t = u64;
pub type shmatt_t = ::c_uint;
s! {
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
}
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
pub data: i64,
pub udata: *mut ::c_void,
pub ext: [u64; 4],
}
pub struct kvm_page {
pub version: ::c_uint,
pub paddr: ::c_ulong,
pub kmap_vaddr: ::c_ulong,
pub dmap_vaddr: ::c_ulong,
pub prot: ::vm_prot_t,
pub offset: ::u_long,
pub len: ::size_t,
}
pub struct kinfo_proc {
/// Size of this structure.
pub ki_structsize: ::c_int,
/// Reserved: layout identifier.
pub ki_layout: ::c_int,
/// Address of command arguments.
pub ki_args: *mut ::pargs,
// This is normally "struct proc".
/// Address of proc.
pub ki_paddr: *mut ::c_void,
// This is normally "struct user".
/// Kernel virtual address of u-area.
pub ki_addr: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to trace file.
pub ki_tracep: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut ::c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut ::c_void,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut ::c_void,
/// Sleep address.
pub ki_wchan: *mut ::c_void,
/// Process identifier.
pub ki_pid: ::pid_t,
/// Parent process ID.
pub ki_ppid: ::pid_t,
/// Process group ID.
pub ki_pgid: ::pid_t,
/// tty process group ID.
pub ki_tpgid: ::pid_t,
/// Process session ID.
pub ki_sid: ::pid_t,
/// Terminal session ID.
pub ki_tsid: ::pid_t,
/// Job control counter.
pub ki_jobc: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short1: ::c_short,
/// Controlling tty dev.
pub ki_tdev_freebsd11: u32,
/// Signals arrived but not delivered.
pub ki_siglist: ::sigset_t,
/// Current signal mask.
pub ki_sigmask: ::sigset_t,
/// Signals being ignored.
pub ki_sigignore: ::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: ::sigset_t,
/// Effective user ID.
pub ki_uid: ::uid_t,
/// Real user ID.
pub ki_ruid: ::uid_t,
/// Saved effective user ID.
pub ki_svuid: ::uid_t,
/// Real group ID.
pub ki_rgid: ::gid_t,
/// Saved effective group ID.
pub ki_svgid: ::gid_t,
/// Number of groups.
pub ki_ngroups: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short2: ::c_short,
/// Groups.
pub ki_groups: [::gid_t; ::KI_NGROUPS],
/// Virtual size.
pub ki_size: ::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: ::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: ::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: ::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: ::segsz_t,
/// Stack size (pages).
pub ki_ssize: ::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: ::u_short,
/// Accounting flags.
pub ki_acflag: ::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: ::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: ::u_int,
/// Time since last blocked.
pub ki_slptime: ::u_int,
/// Time swapped in or out.
pub ki_swtime: ::u_int,
/// Number of copy-on-write faults.
pub ki_cow: ::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: ::timeval,
/// Time used by process children.
pub ki_childtime: ::timeval,
/// P_* flags.
pub ki_flag: ::c_long,
/// KI_* flags (below).
pub ki_kiflag: ::c_long,
/// Kernel trace points.
pub ki_traceflag: ::c_int,
/// S* process status.
pub ki_stat: ::c_char,
/// Process "nice" value.
pub ki_nice: i8, // signed char
/// Process lock (prevent swap) count.
pub ki_lock: ::c_char,
/// Run queue index.
pub ki_rqindex: ::c_char,
/// Which cpu we are on.
pub ki_oncpu_old: ::c_uchar,
/// Last cpu we were on.
pub ki_lastcpu_old: ::c_uchar,
/// Thread name.
pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [::c_char; ::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [::c_char; ::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
/// Spare string space.
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.
pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
/// Controlling tty dev.
pub ki_tdev: ::dev_t,
/// Which cpu we are on.
pub ki_oncpu: ::c_int,
/// Last cpu we were on.
pub ki_lastcpu: ::c_int,
/// PID of tracing process.
pub ki_tracer: ::c_int,
/// P2_* flags.
pub ki_flag2: ::c_int,
/// Default FIB number.
pub ki_fibnum: ::c_int,
/// Credential flags.
pub ki_cr_flags: ::u_int,
/// Process jail ID.
pub ki_jid: ::c_int,
/// Number of threads in total.
pub ki_numthreads: ::c_int,
/// Thread ID.
pub ki_tid: ::lwpid_t,
/// Process priority.
pub ki_pri: ::priority,
/// Process rusage statistics.
pub ki_rusage: ::rusage,
/// rusage of children processes.
pub ki_rusage_ch: ::rusage,
// This is normally "struct pcb".
/// Kernel virtual addr of pcb.
pub ki_pcb: *mut ::c_void,
/// Kernel virtual addr of stack.
pub ki_kstack: *mut ::c_void,
/// User convenience pointer.
pub ki_udata: *mut ::c_void,
// This is normally "struct thread".
pub ki_tdaddr: *mut ::c_void,
pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: ::c_long,
/// kthread flag.
pub ki_tdflags: ::c_long,
}
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
st_padding0: i16,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
st_padding1: i32,
pub st_rdev: ::dev_t,
#[cfg(target_arch = "x86")]
st_atim_ext: i32,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
#[cfg(target_arch = "x86")]
st_mtim_ext: i32,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
#[cfg(target_arch = "x86")]
st_ctim_ext: i32,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
#[cfg(target_arch = "x86")]
st_btim_ext: i32,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u64,
pub st_spare: [u64; 10],
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_off: ::off_t,
pub d_reclen: u16,
pub d_type: u8,
d_pad0: u8,
pub d_namlen: u16,
d_pad1: u16,
pub d_name: [::c_char; 256],
}
pub struct statfs {
pub f_version: u32,
pub f_type: u32,
pub f_flags: u64,
pub f_bsize: u64,
pub f_iosize: u64,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: i64,
pub f_files: u64,
pub f_ffree: i64,
pub f_syncwrites: u64,
pub f_asyncwrites: u64,
pub f_syncreads: u64,
pub f_asyncreads: u64,
f_spare: [u64; 10],
pub f_namemax: u32,
pub f_owner: ::uid_t,
pub f_fsid: ::fsid_t,
f_charspare: [::c_char; 80],
pub f_fstypename: [::c_char; 16],
pub f_mntfromname: [::c_char; 1024],
pub f_mntonname: [::c_char; 1024],
}
pub struct vnstat {
pub vn_fileid: u64,
pub vn_size: u64,
pub vn_dev: u64,
pub vn_fsid: u64,
pub vn_mntdir: *mut ::c_char,
pub vn_type: ::c_int,
pub vn_mode: u16,
pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for statfs {
fn eq(&self, other: &statfs) -> bool {
self.f_version == other.f_version
&& self.f_type == other.f_type
&& self.f_flags == other.f_flags
&& self.f_bsize == other.f_bsize
&& self.f_iosize == other.f_iosize
&& self.f_blocks == other.f_blocks
&& self.f_bfree == other.f_bfree
&& self.f_bavail == other.f_bavail
&& self.f_files == other.f_files
&& self.f_ffree == other.f_ffree
&& self.f_syncwrites == other.f_syncwrites
&& self.f_asyncwrites == other.f_asyncwrites
&& self.f_syncreads == other.f_syncreads
&& self.f_asyncreads == other.f_asyncreads
&& self.f_namemax == other.f_namemax
&& self.f_owner == other.f_owner
&& self.f_fsid == other.f_fsid
&& self.f_fstypename == other.f_fstypename
&& self
.f_mntfromname
.iter()
.zip(other.f_mntfromname.iter())
.all(|(a,b)| a == b)
&& self
.f_mntonname
.iter()
.zip(other.f_mntonname.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for statfs {}
impl ::fmt::Debug for statfs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("statfs")
.field("f_bsize", &self.f_bsize)
.field("f_iosize", &self.f_iosize)
.field("f_blocks", &self.f_blocks)
.field("f_bfree", &self.f_bfree)
.field("f_bavail", &self.f_bavail)
.field("f_files", &self.f_files)
.field("f_ffree", &self.f_ffree)
.field("f_syncwrites", &self.f_syncwrites)
.field("f_asyncwrites", &self.f_asyncwrites)
.field("f_syncreads", &self.f_syncreads)
.field("f_asyncreads", &self.f_asyncreads)
.field("f_namemax", &self.f_namemax)
.field("f_owner", &self.f_owner)
.field("f_fsid", &self.f_fsid)
.field("f_fstypename", &self.f_fstypename)
.field("f_mntfromname", &&self.f_mntfromname[..])
.field("f_mntonname", &&self.f_mntonname[..])
.finish()
}
}
impl ::hash::Hash for statfs {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.f_version.hash(state);
self.f_type.hash(state);
self.f_flags.hash(state);
self.f_bsize.hash(state);
self.f_iosize.hash(state);
self.f_blocks.hash(state);
self.f_bfree.hash(state);
self.f_bavail.hash(state);
self.f_files.hash(state);
self.f_ffree.hash(state);
self.f_syncwrites.hash(state);
self.f_asyncwrites.hash(state);
self.f_syncreads.hash(state);
self.f_asyncreads.hash(state);
self.f_namemax.hash(state);
self.f_owner.hash(state);
self.f_fsid.hash(state);
self.f_charspare.hash(state);
self.f_fstypename.hash(state);
self.f_mntfromname.hash(state);
self.f_mntonname.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_fileno == other.d_fileno
&& self.d_off == other.d_off
&& self.d_reclen == other.d_reclen
&& self.d_type == other.d_type
&& self.d_namlen == other.d_namlen
&& self
.d_name[..self.d_namlen as _]
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_fileno", &self.d_fileno)
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
.field("d_namlen", &self.d_namlen)
.field("d_name", &&self.d_name[..self.d_namlen as _])
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.d_fileno.hash(state);
self.d_off.hash(state);
self.d_reclen.hash(state);
self.d_type.hash(state);
self.d_namlen.hash(state);
self.d_name[..self.d_namlen as _].hash(state);
}
}
impl PartialEq for vnstat {
fn eq(&self, other: &vnstat) -> bool {
let self_vn_devname: &[::c_char] = &self.vn_devname;
let other_vn_devname: &[::c_char] = &other.vn_devname;
self.vn_fileid == other.vn_fileid &&
self.vn_size == other.vn_size &&
self.vn_dev == other.vn_dev &&
self.vn_fsid == other.vn_fsid &&
self.vn_mntdir == other.vn_mntdir &&
self.vn_type == other.vn_type &&
self.vn_mode == other.vn_mode &&
self_vn_devname == other_vn_devname
}
}
impl Eq for vnstat {}
impl ::fmt::Debug for vnstat {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let self_vn_devname: &[::c_char] = &self.vn_devname;
f.debug_struct("vnstat")
.field("vn_fileid", &self.vn_fileid)
.field("vn_size", &self.vn_size)
.field("vn_dev", &self.vn_dev)
.field("vn_fsid", &self.vn_fsid)
.field("vn_mntdir", &self.vn_mntdir)
.field("vn_type", &self.vn_type)
.field("vn_mode", &self.vn_mode)
.field("vn_devname", &self_vn_devname)
.finish()
}
}
impl ::hash::Hash for vnstat {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
let self_vn_devname: &[::c_char] = &self.vn_devname;
self.vn_fileid.hash(state);
self.vn_size.hash(state);
self.vn_dev.hash(state);
self.vn_fsid.hash(state);
self.vn_mntdir.hash(state);
self.vn_type.hash(state);
self.vn_mode.hash(state);
self_vn_devname.hash(state);
}
}
}
}
pub const RAND_MAX: ::c_int = 0x7fff_fffd;
pub const ELAST: ::c_int = 97;
/// max length of devicename
pub const SPECNAMELEN: ::c_int = 63;
pub const KI_NSPARE_PTR: usize = 6;
pub const MINCORE_SUPER: ::c_int = 0x20;
safe_f! {
pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
let mut dev = 0;
dev |= ((major & 0xffffff00) as dev_t) << 32;
dev |= ((major & 0x000000ff) as dev_t) << 8;
dev |= ((minor & 0x0000ff00) as dev_t) << 24;
dev |= ((minor & 0xffff00ff) as dev_t) << 0;
dev
}
}
f! {
pub fn major(dev: ::dev_t) -> ::c_int {
(((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
}
pub fn minor(dev: ::dev_t) -> ::c_int {
(((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
}
}
extern "C" {
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn freelocale(loc: ::locale_t);
pub fn msgrcv(
msqid: ::c_int,
msgp: *mut ::c_void,
msgsz: ::size_t,
msgtyp: ::c_long,
msgflg: ::c_int,
) -> ::ssize_t;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
}
}

View file

@ -0,0 +1,5 @@
pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;

View file

@ -0,0 +1,571 @@
// APIs in FreeBSD 13 that have changed since 11.
pub type nlink_t = u64;
pub type dev_t = u64;
pub type ino_t = u64;
pub type shmatt_t = ::c_uint;
pub type kpaddr_t = u64;
pub type kssize_t = i64;
pub type domainset_t = __c_anonymous_domainset;
s! {
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
}
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
pub data: i64,
pub udata: *mut ::c_void,
pub ext: [u64; 4],
}
pub struct kvm_page {
pub kp_version: ::u_int,
pub kp_paddr: ::kpaddr_t,
pub kp_kmap_vaddr: ::kvaddr_t,
pub kp_dmap_vaddr: ::kvaddr_t,
pub kp_prot: ::vm_prot_t,
pub kp_offset: ::off_t,
pub kp_len: ::size_t,
}
pub struct __c_anonymous_domainset {
_priv: [::uintptr_t; 4],
}
pub struct kinfo_proc {
/// Size of this structure.
pub ki_structsize: ::c_int,
/// Reserved: layout identifier.
pub ki_layout: ::c_int,
/// Address of command arguments.
pub ki_args: *mut ::pargs,
// This is normally "struct proc".
/// Address of proc.
pub ki_paddr: *mut ::c_void,
// This is normally "struct user".
/// Kernel virtual address of u-area.
pub ki_addr: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to trace file.
pub ki_tracep: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut ::c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut ::c_void,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut ::c_void,
/// Sleep address.
pub ki_wchan: *const ::c_void,
/// Process identifier.
pub ki_pid: ::pid_t,
/// Parent process ID.
pub ki_ppid: ::pid_t,
/// Process group ID.
pub ki_pgid: ::pid_t,
/// tty process group ID.
pub ki_tpgid: ::pid_t,
/// Process session ID.
pub ki_sid: ::pid_t,
/// Terminal session ID.
pub ki_tsid: ::pid_t,
/// Job control counter.
pub ki_jobc: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short1: ::c_short,
/// Controlling tty dev.
pub ki_tdev_freebsd11: u32,
/// Signals arrived but not delivered.
pub ki_siglist: ::sigset_t,
/// Current signal mask.
pub ki_sigmask: ::sigset_t,
/// Signals being ignored.
pub ki_sigignore: ::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: ::sigset_t,
/// Effective user ID.
pub ki_uid: ::uid_t,
/// Real user ID.
pub ki_ruid: ::uid_t,
/// Saved effective user ID.
pub ki_svuid: ::uid_t,
/// Real group ID.
pub ki_rgid: ::gid_t,
/// Saved effective group ID.
pub ki_svgid: ::gid_t,
/// Number of groups.
pub ki_ngroups: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short2: ::c_short,
/// Groups.
pub ki_groups: [::gid_t; ::KI_NGROUPS],
/// Virtual size.
pub ki_size: ::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: ::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: ::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: ::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: ::segsz_t,
/// Stack size (pages).
pub ki_ssize: ::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: ::u_short,
/// Accounting flags.
pub ki_acflag: ::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: ::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: ::u_int,
/// Time since last blocked.
pub ki_slptime: ::u_int,
/// Time swapped in or out.
pub ki_swtime: ::u_int,
/// Number of copy-on-write faults.
pub ki_cow: ::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: ::timeval,
/// Time used by process children.
pub ki_childtime: ::timeval,
/// P_* flags.
pub ki_flag: ::c_long,
/// KI_* flags (below).
pub ki_kiflag: ::c_long,
/// Kernel trace points.
pub ki_traceflag: ::c_int,
/// S* process status.
pub ki_stat: ::c_char,
/// Process "nice" value.
pub ki_nice: i8, // signed char
/// Process lock (prevent swap) count.
pub ki_lock: ::c_char,
/// Run queue index.
pub ki_rqindex: ::c_char,
/// Which cpu we are on.
pub ki_oncpu_old: ::c_uchar,
/// Last cpu we were on.
pub ki_lastcpu_old: ::c_uchar,
/// Thread name.
pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [::c_char; ::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [::c_char; ::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
/// Spare string space.
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.
pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
/// Controlling tty dev.
pub ki_tdev: u64,
/// Which cpu we are on.
pub ki_oncpu: ::c_int,
/// Last cpu we were on.
pub ki_lastcpu: ::c_int,
/// PID of tracing process.
pub ki_tracer: ::c_int,
/// P2_* flags.
pub ki_flag2: ::c_int,
/// Default FIB number.
pub ki_fibnum: ::c_int,
/// Credential flags.
pub ki_cr_flags: ::u_int,
/// Process jail ID.
pub ki_jid: ::c_int,
/// Number of threads in total.
pub ki_numthreads: ::c_int,
/// Thread ID.
pub ki_tid: ::lwpid_t,
/// Process priority.
pub ki_pri: ::priority,
/// Process rusage statistics.
pub ki_rusage: ::rusage,
/// rusage of children processes.
pub ki_rusage_ch: ::rusage,
// This is normally "struct pcb".
/// Kernel virtual addr of pcb.
pub ki_pcb: *mut ::c_void,
/// Kernel virtual addr of stack.
pub ki_kstack: *mut ::c_void,
/// User convenience pointer.
pub ki_udata: *mut ::c_void,
// This is normally "struct thread".
pub ki_tdaddr: *mut ::c_void,
// This is normally "struct pwddesc".
/// Pointer to process paths info.
pub ki_pd: *mut ::c_void,
pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: ::c_long,
/// kthread flag.
pub ki_tdflags: ::c_long,
}
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
st_padding0: i16,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
st_padding1: i32,
pub st_rdev: ::dev_t,
#[cfg(target_arch = "x86")]
st_atim_ext: i32,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
#[cfg(target_arch = "x86")]
st_mtim_ext: i32,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
#[cfg(target_arch = "x86")]
st_ctim_ext: i32,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
#[cfg(target_arch = "x86")]
st_btim_ext: i32,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u64,
pub st_spare: [u64; 10],
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_off: ::off_t,
pub d_reclen: u16,
pub d_type: u8,
d_pad0: u8,
pub d_namlen: u16,
d_pad1: u16,
pub d_name: [::c_char; 256],
}
pub struct statfs {
pub f_version: u32,
pub f_type: u32,
pub f_flags: u64,
pub f_bsize: u64,
pub f_iosize: u64,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: i64,
pub f_files: u64,
pub f_ffree: i64,
pub f_syncwrites: u64,
pub f_asyncwrites: u64,
pub f_syncreads: u64,
pub f_asyncreads: u64,
f_spare: [u64; 10],
pub f_namemax: u32,
pub f_owner: ::uid_t,
pub f_fsid: ::fsid_t,
f_charspare: [::c_char; 80],
pub f_fstypename: [::c_char; 16],
pub f_mntfromname: [::c_char; 1024],
pub f_mntonname: [::c_char; 1024],
}
pub struct vnstat {
pub vn_fileid: u64,
pub vn_size: u64,
pub vn_dev: u64,
pub vn_fsid: u64,
pub vn_mntdir: *mut ::c_char,
pub vn_type: ::c_int,
pub vn_mode: u16,
pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for statfs {
fn eq(&self, other: &statfs) -> bool {
self.f_version == other.f_version
&& self.f_type == other.f_type
&& self.f_flags == other.f_flags
&& self.f_bsize == other.f_bsize
&& self.f_iosize == other.f_iosize
&& self.f_blocks == other.f_blocks
&& self.f_bfree == other.f_bfree
&& self.f_bavail == other.f_bavail
&& self.f_files == other.f_files
&& self.f_ffree == other.f_ffree
&& self.f_syncwrites == other.f_syncwrites
&& self.f_asyncwrites == other.f_asyncwrites
&& self.f_syncreads == other.f_syncreads
&& self.f_asyncreads == other.f_asyncreads
&& self.f_namemax == other.f_namemax
&& self.f_owner == other.f_owner
&& self.f_fsid == other.f_fsid
&& self.f_fstypename == other.f_fstypename
&& self
.f_mntfromname
.iter()
.zip(other.f_mntfromname.iter())
.all(|(a,b)| a == b)
&& self
.f_mntonname
.iter()
.zip(other.f_mntonname.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for statfs {}
impl ::fmt::Debug for statfs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("statfs")
.field("f_bsize", &self.f_bsize)
.field("f_iosize", &self.f_iosize)
.field("f_blocks", &self.f_blocks)
.field("f_bfree", &self.f_bfree)
.field("f_bavail", &self.f_bavail)
.field("f_files", &self.f_files)
.field("f_ffree", &self.f_ffree)
.field("f_syncwrites", &self.f_syncwrites)
.field("f_asyncwrites", &self.f_asyncwrites)
.field("f_syncreads", &self.f_syncreads)
.field("f_asyncreads", &self.f_asyncreads)
.field("f_namemax", &self.f_namemax)
.field("f_owner", &self.f_owner)
.field("f_fsid", &self.f_fsid)
.field("f_fstypename", &self.f_fstypename)
.field("f_mntfromname", &&self.f_mntfromname[..])
.field("f_mntonname", &&self.f_mntonname[..])
.finish()
}
}
impl ::hash::Hash for statfs {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.f_version.hash(state);
self.f_type.hash(state);
self.f_flags.hash(state);
self.f_bsize.hash(state);
self.f_iosize.hash(state);
self.f_blocks.hash(state);
self.f_bfree.hash(state);
self.f_bavail.hash(state);
self.f_files.hash(state);
self.f_ffree.hash(state);
self.f_syncwrites.hash(state);
self.f_asyncwrites.hash(state);
self.f_syncreads.hash(state);
self.f_asyncreads.hash(state);
self.f_namemax.hash(state);
self.f_owner.hash(state);
self.f_fsid.hash(state);
self.f_charspare.hash(state);
self.f_fstypename.hash(state);
self.f_mntfromname.hash(state);
self.f_mntonname.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_fileno == other.d_fileno
&& self.d_off == other.d_off
&& self.d_reclen == other.d_reclen
&& self.d_type == other.d_type
&& self.d_namlen == other.d_namlen
&& self
.d_name[..self.d_namlen as _]
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_fileno", &self.d_fileno)
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
.field("d_namlen", &self.d_namlen)
.field("d_name", &&self.d_name[..self.d_namlen as _])
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.d_fileno.hash(state);
self.d_off.hash(state);
self.d_reclen.hash(state);
self.d_type.hash(state);
self.d_namlen.hash(state);
self.d_name[..self.d_namlen as _].hash(state);
}
}
impl PartialEq for vnstat {
fn eq(&self, other: &vnstat) -> bool {
let self_vn_devname: &[::c_char] = &self.vn_devname;
let other_vn_devname: &[::c_char] = &other.vn_devname;
self.vn_fileid == other.vn_fileid &&
self.vn_size == other.vn_size &&
self.vn_dev == other.vn_dev &&
self.vn_fsid == other.vn_fsid &&
self.vn_mntdir == other.vn_mntdir &&
self.vn_type == other.vn_type &&
self.vn_mode == other.vn_mode &&
self_vn_devname == other_vn_devname
}
}
impl Eq for vnstat {}
impl ::fmt::Debug for vnstat {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let self_vn_devname: &[::c_char] = &self.vn_devname;
f.debug_struct("vnstat")
.field("vn_fileid", &self.vn_fileid)
.field("vn_size", &self.vn_size)
.field("vn_dev", &self.vn_dev)
.field("vn_fsid", &self.vn_fsid)
.field("vn_mntdir", &self.vn_mntdir)
.field("vn_type", &self.vn_type)
.field("vn_mode", &self.vn_mode)
.field("vn_devname", &self_vn_devname)
.finish()
}
}
impl ::hash::Hash for vnstat {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
let self_vn_devname: &[::c_char] = &self.vn_devname;
self.vn_fileid.hash(state);
self.vn_size.hash(state);
self.vn_dev.hash(state);
self.vn_fsid.hash(state);
self.vn_mntdir.hash(state);
self.vn_type.hash(state);
self.vn_mode.hash(state);
self_vn_devname.hash(state);
}
}
}
}
pub const RAND_MAX: ::c_int = 0x7fff_ffff;
pub const ELAST: ::c_int = 97;
pub const KF_TYPE_EVENTFD: ::c_int = 13;
/// max length of devicename
pub const SPECNAMELEN: ::c_int = 255;
pub const KI_NSPARE_PTR: usize = 5;
/// domainset policies
pub const DOMAINSET_POLICY_INVALID: ::c_int = 0;
pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1;
pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
pub const MINCORE_SUPER: ::c_int = 0x20;
safe_f! {
pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
let mut dev = 0;
dev |= ((major & 0xffffff00) as dev_t) << 32;
dev |= ((major & 0x000000ff) as dev_t) << 8;
dev |= ((minor & 0x0000ff00) as dev_t) << 24;
dev |= ((minor & 0xffff00ff) as dev_t) << 0;
dev
}
}
f! {
pub fn major(dev: ::dev_t) -> ::c_int {
(((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
}
pub fn minor(dev: ::dev_t) -> ::c_int {
(((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
}
}
extern "C" {
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn freelocale(loc: ::locale_t);
pub fn msgrcv(
msqid: ::c_int,
msgp: *mut ::c_void,
msgsz: ::size_t,
msgtyp: ::c_long,
msgflg: ::c_int,
) -> ::ssize_t;
pub fn cpuset_getdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *mut ::domainset_t,
policy: *mut ::c_int,
) -> ::c_int;
pub fn cpuset_setdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *const ::domainset_t,
policy: ::c_int,
) -> ::c_int;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
#[link(name = "kvm")]
extern "C" {
pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
}
}

View file

@ -0,0 +1,5 @@
pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;

View file

@ -0,0 +1,571 @@
// APIs in FreeBSD 14 that have changed since 11.
pub type nlink_t = u64;
pub type dev_t = u64;
pub type ino_t = u64;
pub type shmatt_t = ::c_uint;
pub type kpaddr_t = u64;
pub type kssize_t = i64;
pub type domainset_t = __c_anonymous_domainset;
s! {
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
}
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
pub data: i64,
pub udata: *mut ::c_void,
pub ext: [u64; 4],
}
pub struct kvm_page {
pub kp_version: ::u_int,
pub kp_paddr: ::kpaddr_t,
pub kp_kmap_vaddr: ::kvaddr_t,
pub kp_dmap_vaddr: ::kvaddr_t,
pub kp_prot: ::vm_prot_t,
pub kp_offset: ::off_t,
pub kp_len: ::size_t,
}
pub struct __c_anonymous_domainset {
_priv: [::uintptr_t; 4],
}
pub struct kinfo_proc {
/// Size of this structure.
pub ki_structsize: ::c_int,
/// Reserved: layout identifier.
pub ki_layout: ::c_int,
/// Address of command arguments.
pub ki_args: *mut ::pargs,
// This is normally "struct proc".
/// Address of proc.
pub ki_paddr: *mut ::c_void,
// This is normally "struct user".
/// Kernel virtual address of u-area.
pub ki_addr: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to trace file.
pub ki_tracep: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut ::c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut ::c_void,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut ::c_void,
/// Sleep address.
pub ki_wchan: *const ::c_void,
/// Process identifier.
pub ki_pid: ::pid_t,
/// Parent process ID.
pub ki_ppid: ::pid_t,
/// Process group ID.
pub ki_pgid: ::pid_t,
/// tty process group ID.
pub ki_tpgid: ::pid_t,
/// Process session ID.
pub ki_sid: ::pid_t,
/// Terminal session ID.
pub ki_tsid: ::pid_t,
/// Job control counter.
pub ki_jobc: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short1: ::c_short,
/// Controlling tty dev.
pub ki_tdev_freebsd11: u32,
/// Signals arrived but not delivered.
pub ki_siglist: ::sigset_t,
/// Current signal mask.
pub ki_sigmask: ::sigset_t,
/// Signals being ignored.
pub ki_sigignore: ::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: ::sigset_t,
/// Effective user ID.
pub ki_uid: ::uid_t,
/// Real user ID.
pub ki_ruid: ::uid_t,
/// Saved effective user ID.
pub ki_svuid: ::uid_t,
/// Real group ID.
pub ki_rgid: ::gid_t,
/// Saved effective group ID.
pub ki_svgid: ::gid_t,
/// Number of groups.
pub ki_ngroups: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short2: ::c_short,
/// Groups.
pub ki_groups: [::gid_t; ::KI_NGROUPS],
/// Virtual size.
pub ki_size: ::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: ::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: ::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: ::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: ::segsz_t,
/// Stack size (pages).
pub ki_ssize: ::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: ::u_short,
/// Accounting flags.
pub ki_acflag: ::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: ::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: ::u_int,
/// Time since last blocked.
pub ki_slptime: ::u_int,
/// Time swapped in or out.
pub ki_swtime: ::u_int,
/// Number of copy-on-write faults.
pub ki_cow: ::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: ::timeval,
/// Time used by process children.
pub ki_childtime: ::timeval,
/// P_* flags.
pub ki_flag: ::c_long,
/// KI_* flags (below).
pub ki_kiflag: ::c_long,
/// Kernel trace points.
pub ki_traceflag: ::c_int,
/// S* process status.
pub ki_stat: ::c_char,
/// Process "nice" value.
pub ki_nice: i8, // signed char
/// Process lock (prevent swap) count.
pub ki_lock: ::c_char,
/// Run queue index.
pub ki_rqindex: ::c_char,
/// Which cpu we are on.
pub ki_oncpu_old: ::c_uchar,
/// Last cpu we were on.
pub ki_lastcpu_old: ::c_uchar,
/// Thread name.
pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [::c_char; ::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [::c_char; ::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
/// Spare string space.
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.
pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
/// Controlling tty dev.
pub ki_tdev: u64,
/// Which cpu we are on.
pub ki_oncpu: ::c_int,
/// Last cpu we were on.
pub ki_lastcpu: ::c_int,
/// PID of tracing process.
pub ki_tracer: ::c_int,
/// P2_* flags.
pub ki_flag2: ::c_int,
/// Default FIB number.
pub ki_fibnum: ::c_int,
/// Credential flags.
pub ki_cr_flags: ::u_int,
/// Process jail ID.
pub ki_jid: ::c_int,
/// Number of threads in total.
pub ki_numthreads: ::c_int,
/// Thread ID.
pub ki_tid: ::lwpid_t,
/// Process priority.
pub ki_pri: ::priority,
/// Process rusage statistics.
pub ki_rusage: ::rusage,
/// rusage of children processes.
pub ki_rusage_ch: ::rusage,
// This is normally "struct pcb".
/// Kernel virtual addr of pcb.
pub ki_pcb: *mut ::c_void,
/// Kernel virtual addr of stack.
pub ki_kstack: *mut ::c_void,
/// User convenience pointer.
pub ki_udata: *mut ::c_void,
// This is normally "struct thread".
pub ki_tdaddr: *mut ::c_void,
// This is normally "struct pwddesc".
/// Pointer to process paths info.
pub ki_pd: *mut ::c_void,
pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: ::c_long,
/// kthread flag.
pub ki_tdflags: ::c_long,
}
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
st_padding0: i16,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
st_padding1: i32,
pub st_rdev: ::dev_t,
#[cfg(target_arch = "x86")]
st_atim_ext: i32,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
#[cfg(target_arch = "x86")]
st_mtim_ext: i32,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
#[cfg(target_arch = "x86")]
st_ctim_ext: i32,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
#[cfg(target_arch = "x86")]
st_btim_ext: i32,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u64,
pub st_spare: [u64; 10],
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_off: ::off_t,
pub d_reclen: u16,
pub d_type: u8,
d_pad0: u8,
pub d_namlen: u16,
d_pad1: u16,
pub d_name: [::c_char; 256],
}
pub struct statfs {
pub f_version: u32,
pub f_type: u32,
pub f_flags: u64,
pub f_bsize: u64,
pub f_iosize: u64,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: i64,
pub f_files: u64,
pub f_ffree: i64,
pub f_syncwrites: u64,
pub f_asyncwrites: u64,
pub f_syncreads: u64,
pub f_asyncreads: u64,
f_spare: [u64; 10],
pub f_namemax: u32,
pub f_owner: ::uid_t,
pub f_fsid: ::fsid_t,
f_charspare: [::c_char; 80],
pub f_fstypename: [::c_char; 16],
pub f_mntfromname: [::c_char; 1024],
pub f_mntonname: [::c_char; 1024],
}
pub struct vnstat {
pub vn_fileid: u64,
pub vn_size: u64,
pub vn_dev: u64,
pub vn_fsid: u64,
pub vn_mntdir: *mut ::c_char,
pub vn_type: ::c_int,
pub vn_mode: u16,
pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for statfs {
fn eq(&self, other: &statfs) -> bool {
self.f_version == other.f_version
&& self.f_type == other.f_type
&& self.f_flags == other.f_flags
&& self.f_bsize == other.f_bsize
&& self.f_iosize == other.f_iosize
&& self.f_blocks == other.f_blocks
&& self.f_bfree == other.f_bfree
&& self.f_bavail == other.f_bavail
&& self.f_files == other.f_files
&& self.f_ffree == other.f_ffree
&& self.f_syncwrites == other.f_syncwrites
&& self.f_asyncwrites == other.f_asyncwrites
&& self.f_syncreads == other.f_syncreads
&& self.f_asyncreads == other.f_asyncreads
&& self.f_namemax == other.f_namemax
&& self.f_owner == other.f_owner
&& self.f_fsid == other.f_fsid
&& self.f_fstypename == other.f_fstypename
&& self
.f_mntfromname
.iter()
.zip(other.f_mntfromname.iter())
.all(|(a,b)| a == b)
&& self
.f_mntonname
.iter()
.zip(other.f_mntonname.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for statfs {}
impl ::fmt::Debug for statfs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("statfs")
.field("f_bsize", &self.f_bsize)
.field("f_iosize", &self.f_iosize)
.field("f_blocks", &self.f_blocks)
.field("f_bfree", &self.f_bfree)
.field("f_bavail", &self.f_bavail)
.field("f_files", &self.f_files)
.field("f_ffree", &self.f_ffree)
.field("f_syncwrites", &self.f_syncwrites)
.field("f_asyncwrites", &self.f_asyncwrites)
.field("f_syncreads", &self.f_syncreads)
.field("f_asyncreads", &self.f_asyncreads)
.field("f_namemax", &self.f_namemax)
.field("f_owner", &self.f_owner)
.field("f_fsid", &self.f_fsid)
.field("f_fstypename", &self.f_fstypename)
.field("f_mntfromname", &&self.f_mntfromname[..])
.field("f_mntonname", &&self.f_mntonname[..])
.finish()
}
}
impl ::hash::Hash for statfs {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.f_version.hash(state);
self.f_type.hash(state);
self.f_flags.hash(state);
self.f_bsize.hash(state);
self.f_iosize.hash(state);
self.f_blocks.hash(state);
self.f_bfree.hash(state);
self.f_bavail.hash(state);
self.f_files.hash(state);
self.f_ffree.hash(state);
self.f_syncwrites.hash(state);
self.f_asyncwrites.hash(state);
self.f_syncreads.hash(state);
self.f_asyncreads.hash(state);
self.f_namemax.hash(state);
self.f_owner.hash(state);
self.f_fsid.hash(state);
self.f_charspare.hash(state);
self.f_fstypename.hash(state);
self.f_mntfromname.hash(state);
self.f_mntonname.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_fileno == other.d_fileno
&& self.d_off == other.d_off
&& self.d_reclen == other.d_reclen
&& self.d_type == other.d_type
&& self.d_namlen == other.d_namlen
&& self
.d_name[..self.d_namlen as _]
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_fileno", &self.d_fileno)
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
.field("d_namlen", &self.d_namlen)
.field("d_name", &&self.d_name[..self.d_namlen as _])
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.d_fileno.hash(state);
self.d_off.hash(state);
self.d_reclen.hash(state);
self.d_type.hash(state);
self.d_namlen.hash(state);
self.d_name[..self.d_namlen as _].hash(state);
}
}
impl PartialEq for vnstat {
fn eq(&self, other: &vnstat) -> bool {
let self_vn_devname: &[::c_char] = &self.vn_devname;
let other_vn_devname: &[::c_char] = &other.vn_devname;
self.vn_fileid == other.vn_fileid &&
self.vn_size == other.vn_size &&
self.vn_dev == other.vn_dev &&
self.vn_fsid == other.vn_fsid &&
self.vn_mntdir == other.vn_mntdir &&
self.vn_type == other.vn_type &&
self.vn_mode == other.vn_mode &&
self_vn_devname == other_vn_devname
}
}
impl Eq for vnstat {}
impl ::fmt::Debug for vnstat {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let self_vn_devname: &[::c_char] = &self.vn_devname;
f.debug_struct("vnstat")
.field("vn_fileid", &self.vn_fileid)
.field("vn_size", &self.vn_size)
.field("vn_dev", &self.vn_dev)
.field("vn_fsid", &self.vn_fsid)
.field("vn_mntdir", &self.vn_mntdir)
.field("vn_type", &self.vn_type)
.field("vn_mode", &self.vn_mode)
.field("vn_devname", &self_vn_devname)
.finish()
}
}
impl ::hash::Hash for vnstat {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
let self_vn_devname: &[::c_char] = &self.vn_devname;
self.vn_fileid.hash(state);
self.vn_size.hash(state);
self.vn_dev.hash(state);
self.vn_fsid.hash(state);
self.vn_mntdir.hash(state);
self.vn_type.hash(state);
self.vn_mode.hash(state);
self_vn_devname.hash(state);
}
}
}
}
pub const RAND_MAX: ::c_int = 0x7fff_ffff;
pub const ELAST: ::c_int = 97;
pub const KF_TYPE_EVENTFD: ::c_int = 13;
/// max length of devicename
pub const SPECNAMELEN: ::c_int = 255;
pub const KI_NSPARE_PTR: usize = 5;
/// domainset policies
pub const DOMAINSET_POLICY_INVALID: ::c_int = 0;
pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1;
pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
pub const MINCORE_SUPER: ::c_int = 0x60;
safe_f! {
pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
let mut dev = 0;
dev |= ((major & 0xffffff00) as dev_t) << 32;
dev |= ((major & 0x000000ff) as dev_t) << 8;
dev |= ((minor & 0x0000ff00) as dev_t) << 24;
dev |= ((minor & 0xffff00ff) as dev_t) << 0;
dev
}
}
f! {
pub fn major(dev: ::dev_t) -> ::c_int {
(((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
}
pub fn minor(dev: ::dev_t) -> ::c_int {
(((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
}
}
extern "C" {
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn freelocale(loc: ::locale_t);
pub fn msgrcv(
msqid: ::c_int,
msgp: *mut ::c_void,
msgsz: ::size_t,
msgtyp: ::c_long,
msgflg: ::c_int,
) -> ::ssize_t;
pub fn cpuset_getdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *mut ::domainset_t,
policy: *mut ::c_int,
) -> ::c_int;
pub fn cpuset_setdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *const ::domainset_t,
policy: ::c_int,
) -> ::c_int;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
#[link(name = "kvm")]
extern "C" {
pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
}
}

View file

@ -0,0 +1,12 @@
pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
pub const PROC_LA_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN + 2;
pub const PROC_LA_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 3;
pub const PROC_LA_CTL_LA48_ON_EXEC: ::c_int = 1;
pub const PROC_LA_CTL_LA57_ON_EXEC: ::c_int = 2;
pub const PROC_LA_CTL_DEFAULT_ON_EXEC: ::c_int = 3;
pub const PROC_LA_STATUS_LA48: ::c_int = 0x01000000;
pub const PROC_LA_STATUS_LA57: ::c_int = 0x02000000;

View file

@ -0,0 +1,571 @@
// APIs in FreeBSD 15 that have changed since 11.
pub type nlink_t = u64;
pub type dev_t = u64;
pub type ino_t = u64;
pub type shmatt_t = ::c_uint;
pub type kpaddr_t = u64;
pub type kssize_t = i64;
pub type domainset_t = __c_anonymous_domainset;
s! {
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
}
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
pub data: i64,
pub udata: *mut ::c_void,
pub ext: [u64; 4],
}
pub struct kvm_page {
pub kp_version: ::u_int,
pub kp_paddr: ::kpaddr_t,
pub kp_kmap_vaddr: ::kvaddr_t,
pub kp_dmap_vaddr: ::kvaddr_t,
pub kp_prot: ::vm_prot_t,
pub kp_offset: ::off_t,
pub kp_len: ::size_t,
}
pub struct __c_anonymous_domainset {
_priv: [::uintptr_t; 4],
}
pub struct kinfo_proc {
/// Size of this structure.
pub ki_structsize: ::c_int,
/// Reserved: layout identifier.
pub ki_layout: ::c_int,
/// Address of command arguments.
pub ki_args: *mut ::pargs,
// This is normally "struct proc".
/// Address of proc.
pub ki_paddr: *mut ::c_void,
// This is normally "struct user".
/// Kernel virtual address of u-area.
pub ki_addr: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to trace file.
pub ki_tracep: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut ::c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut ::c_void,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut ::c_void,
/// Sleep address.
pub ki_wchan: *const ::c_void,
/// Process identifier.
pub ki_pid: ::pid_t,
/// Parent process ID.
pub ki_ppid: ::pid_t,
/// Process group ID.
pub ki_pgid: ::pid_t,
/// tty process group ID.
pub ki_tpgid: ::pid_t,
/// Process session ID.
pub ki_sid: ::pid_t,
/// Terminal session ID.
pub ki_tsid: ::pid_t,
/// Job control counter.
pub ki_jobc: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short1: ::c_short,
/// Controlling tty dev.
pub ki_tdev_freebsd11: u32,
/// Signals arrived but not delivered.
pub ki_siglist: ::sigset_t,
/// Current signal mask.
pub ki_sigmask: ::sigset_t,
/// Signals being ignored.
pub ki_sigignore: ::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: ::sigset_t,
/// Effective user ID.
pub ki_uid: ::uid_t,
/// Real user ID.
pub ki_ruid: ::uid_t,
/// Saved effective user ID.
pub ki_svuid: ::uid_t,
/// Real group ID.
pub ki_rgid: ::gid_t,
/// Saved effective group ID.
pub ki_svgid: ::gid_t,
/// Number of groups.
pub ki_ngroups: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short2: ::c_short,
/// Groups.
pub ki_groups: [::gid_t; ::KI_NGROUPS],
/// Virtual size.
pub ki_size: ::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: ::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: ::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: ::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: ::segsz_t,
/// Stack size (pages).
pub ki_ssize: ::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: ::u_short,
/// Accounting flags.
pub ki_acflag: ::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: ::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: ::u_int,
/// Time since last blocked.
pub ki_slptime: ::u_int,
/// Time swapped in or out.
pub ki_swtime: ::u_int,
/// Number of copy-on-write faults.
pub ki_cow: ::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: ::timeval,
/// Time used by process children.
pub ki_childtime: ::timeval,
/// P_* flags.
pub ki_flag: ::c_long,
/// KI_* flags (below).
pub ki_kiflag: ::c_long,
/// Kernel trace points.
pub ki_traceflag: ::c_int,
/// S* process status.
pub ki_stat: ::c_char,
/// Process "nice" value.
pub ki_nice: i8, // signed char
/// Process lock (prevent swap) count.
pub ki_lock: ::c_char,
/// Run queue index.
pub ki_rqindex: ::c_char,
/// Which cpu we are on.
pub ki_oncpu_old: ::c_uchar,
/// Last cpu we were on.
pub ki_lastcpu_old: ::c_uchar,
/// Thread name.
pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [::c_char; ::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [::c_char; ::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
/// Spare string space.
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.
pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
/// Controlling tty dev.
pub ki_tdev: u64,
/// Which cpu we are on.
pub ki_oncpu: ::c_int,
/// Last cpu we were on.
pub ki_lastcpu: ::c_int,
/// PID of tracing process.
pub ki_tracer: ::c_int,
/// P2_* flags.
pub ki_flag2: ::c_int,
/// Default FIB number.
pub ki_fibnum: ::c_int,
/// Credential flags.
pub ki_cr_flags: ::u_int,
/// Process jail ID.
pub ki_jid: ::c_int,
/// Number of threads in total.
pub ki_numthreads: ::c_int,
/// Thread ID.
pub ki_tid: ::lwpid_t,
/// Process priority.
pub ki_pri: ::priority,
/// Process rusage statistics.
pub ki_rusage: ::rusage,
/// rusage of children processes.
pub ki_rusage_ch: ::rusage,
// This is normally "struct pcb".
/// Kernel virtual addr of pcb.
pub ki_pcb: *mut ::c_void,
/// Kernel virtual addr of stack.
pub ki_kstack: *mut ::c_void,
/// User convenience pointer.
pub ki_udata: *mut ::c_void,
// This is normally "struct thread".
pub ki_tdaddr: *mut ::c_void,
// This is normally "struct pwddesc".
/// Pointer to process paths info.
pub ki_pd: *mut ::c_void,
pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: ::c_long,
/// kthread flag.
pub ki_tdflags: ::c_long,
}
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
st_padding0: i16,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
st_padding1: i32,
pub st_rdev: ::dev_t,
#[cfg(target_arch = "x86")]
st_atim_ext: i32,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
#[cfg(target_arch = "x86")]
st_mtim_ext: i32,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
#[cfg(target_arch = "x86")]
st_ctim_ext: i32,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
#[cfg(target_arch = "x86")]
st_btim_ext: i32,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u64,
pub st_spare: [u64; 10],
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_off: ::off_t,
pub d_reclen: u16,
pub d_type: u8,
d_pad0: u8,
pub d_namlen: u16,
d_pad1: u16,
pub d_name: [::c_char; 256],
}
pub struct statfs {
pub f_version: u32,
pub f_type: u32,
pub f_flags: u64,
pub f_bsize: u64,
pub f_iosize: u64,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: i64,
pub f_files: u64,
pub f_ffree: i64,
pub f_syncwrites: u64,
pub f_asyncwrites: u64,
pub f_syncreads: u64,
pub f_asyncreads: u64,
f_spare: [u64; 10],
pub f_namemax: u32,
pub f_owner: ::uid_t,
pub f_fsid: ::fsid_t,
f_charspare: [::c_char; 80],
pub f_fstypename: [::c_char; 16],
pub f_mntfromname: [::c_char; 1024],
pub f_mntonname: [::c_char; 1024],
}
pub struct vnstat {
pub vn_fileid: u64,
pub vn_size: u64,
pub vn_dev: u64,
pub vn_fsid: u64,
pub vn_mntdir: *mut ::c_char,
pub vn_type: ::c_int,
pub vn_mode: u16,
pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for statfs {
fn eq(&self, other: &statfs) -> bool {
self.f_version == other.f_version
&& self.f_type == other.f_type
&& self.f_flags == other.f_flags
&& self.f_bsize == other.f_bsize
&& self.f_iosize == other.f_iosize
&& self.f_blocks == other.f_blocks
&& self.f_bfree == other.f_bfree
&& self.f_bavail == other.f_bavail
&& self.f_files == other.f_files
&& self.f_ffree == other.f_ffree
&& self.f_syncwrites == other.f_syncwrites
&& self.f_asyncwrites == other.f_asyncwrites
&& self.f_syncreads == other.f_syncreads
&& self.f_asyncreads == other.f_asyncreads
&& self.f_namemax == other.f_namemax
&& self.f_owner == other.f_owner
&& self.f_fsid == other.f_fsid
&& self.f_fstypename == other.f_fstypename
&& self
.f_mntfromname
.iter()
.zip(other.f_mntfromname.iter())
.all(|(a,b)| a == b)
&& self
.f_mntonname
.iter()
.zip(other.f_mntonname.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for statfs {}
impl ::fmt::Debug for statfs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("statfs")
.field("f_bsize", &self.f_bsize)
.field("f_iosize", &self.f_iosize)
.field("f_blocks", &self.f_blocks)
.field("f_bfree", &self.f_bfree)
.field("f_bavail", &self.f_bavail)
.field("f_files", &self.f_files)
.field("f_ffree", &self.f_ffree)
.field("f_syncwrites", &self.f_syncwrites)
.field("f_asyncwrites", &self.f_asyncwrites)
.field("f_syncreads", &self.f_syncreads)
.field("f_asyncreads", &self.f_asyncreads)
.field("f_namemax", &self.f_namemax)
.field("f_owner", &self.f_owner)
.field("f_fsid", &self.f_fsid)
.field("f_fstypename", &self.f_fstypename)
.field("f_mntfromname", &&self.f_mntfromname[..])
.field("f_mntonname", &&self.f_mntonname[..])
.finish()
}
}
impl ::hash::Hash for statfs {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.f_version.hash(state);
self.f_type.hash(state);
self.f_flags.hash(state);
self.f_bsize.hash(state);
self.f_iosize.hash(state);
self.f_blocks.hash(state);
self.f_bfree.hash(state);
self.f_bavail.hash(state);
self.f_files.hash(state);
self.f_ffree.hash(state);
self.f_syncwrites.hash(state);
self.f_asyncwrites.hash(state);
self.f_syncreads.hash(state);
self.f_asyncreads.hash(state);
self.f_namemax.hash(state);
self.f_owner.hash(state);
self.f_fsid.hash(state);
self.f_charspare.hash(state);
self.f_fstypename.hash(state);
self.f_mntfromname.hash(state);
self.f_mntonname.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_fileno == other.d_fileno
&& self.d_off == other.d_off
&& self.d_reclen == other.d_reclen
&& self.d_type == other.d_type
&& self.d_namlen == other.d_namlen
&& self
.d_name[..self.d_namlen as _]
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_fileno", &self.d_fileno)
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
.field("d_namlen", &self.d_namlen)
.field("d_name", &&self.d_name[..self.d_namlen as _])
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.d_fileno.hash(state);
self.d_off.hash(state);
self.d_reclen.hash(state);
self.d_type.hash(state);
self.d_namlen.hash(state);
self.d_name[..self.d_namlen as _].hash(state);
}
}
impl PartialEq for vnstat {
fn eq(&self, other: &vnstat) -> bool {
let self_vn_devname: &[::c_char] = &self.vn_devname;
let other_vn_devname: &[::c_char] = &other.vn_devname;
self.vn_fileid == other.vn_fileid &&
self.vn_size == other.vn_size &&
self.vn_dev == other.vn_dev &&
self.vn_fsid == other.vn_fsid &&
self.vn_mntdir == other.vn_mntdir &&
self.vn_type == other.vn_type &&
self.vn_mode == other.vn_mode &&
self_vn_devname == other_vn_devname
}
}
impl Eq for vnstat {}
impl ::fmt::Debug for vnstat {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let self_vn_devname: &[::c_char] = &self.vn_devname;
f.debug_struct("vnstat")
.field("vn_fileid", &self.vn_fileid)
.field("vn_size", &self.vn_size)
.field("vn_dev", &self.vn_dev)
.field("vn_fsid", &self.vn_fsid)
.field("vn_mntdir", &self.vn_mntdir)
.field("vn_type", &self.vn_type)
.field("vn_mode", &self.vn_mode)
.field("vn_devname", &self_vn_devname)
.finish()
}
}
impl ::hash::Hash for vnstat {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
let self_vn_devname: &[::c_char] = &self.vn_devname;
self.vn_fileid.hash(state);
self.vn_size.hash(state);
self.vn_dev.hash(state);
self.vn_fsid.hash(state);
self.vn_mntdir.hash(state);
self.vn_type.hash(state);
self.vn_mode.hash(state);
self_vn_devname.hash(state);
}
}
}
}
pub const RAND_MAX: ::c_int = 0x7fff_ffff;
pub const ELAST: ::c_int = 97;
pub const KF_TYPE_EVENTFD: ::c_int = 13;
/// max length of devicename
pub const SPECNAMELEN: ::c_int = 255;
pub const KI_NSPARE_PTR: usize = 5;
/// domainset policies
pub const DOMAINSET_POLICY_INVALID: ::c_int = 0;
pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1;
pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
pub const MINCORE_SUPER: ::c_int = 0x60;
safe_f! {
pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
let mut dev = 0;
dev |= ((major & 0xffffff00) as dev_t) << 32;
dev |= ((major & 0x000000ff) as dev_t) << 8;
dev |= ((minor & 0x0000ff00) as dev_t) << 24;
dev |= ((minor & 0xffff00ff) as dev_t) << 0;
dev
}
}
f! {
pub fn major(dev: ::dev_t) -> ::c_int {
(((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
}
pub fn minor(dev: ::dev_t) -> ::c_int {
(((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
}
}
extern "C" {
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn freelocale(loc: ::locale_t);
pub fn msgrcv(
msqid: ::c_int,
msgp: *mut ::c_void,
msgsz: ::size_t,
msgtyp: ::c_long,
msgflg: ::c_int,
) -> ::ssize_t;
pub fn cpuset_getdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *mut ::domainset_t,
policy: *mut ::c_int,
) -> ::c_int;
pub fn cpuset_setdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *const ::domainset_t,
policy: ::c_int,
) -> ::c_int;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
#[link(name = "kvm")]
extern "C" {
pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
}
}

View file

@ -0,0 +1,12 @@
pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
pub const PROC_LA_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN + 2;
pub const PROC_LA_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 3;
pub const PROC_LA_CTL_LA48_ON_EXEC: ::c_int = 1;
pub const PROC_LA_CTL_LA57_ON_EXEC: ::c_int = 2;
pub const PROC_LA_CTL_DEFAULT_ON_EXEC: ::c_int = 3;
pub const PROC_LA_STATUS_LA48: ::c_int = 0x01000000;
pub const PROC_LA_STATUS_LA57: ::c_int = 0x02000000;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,21 @@
pub type c_char = u8;
pub type c_long = i32;
pub type c_ulong = u32;
pub type wchar_t = i32;
pub type time_t = i64;
pub type suseconds_t = i32;
pub type register_t = i32;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 4 - 1;
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4

View file

@ -0,0 +1,21 @@
pub type c_char = u8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type wchar_t = i32;
pub type time_t = i64;
pub type suseconds_t = i64;
pub type register_t = i64;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4

View file

@ -0,0 +1,154 @@
pub type c_char = u8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type wchar_t = ::c_int;
pub type time_t = i64;
pub type suseconds_t = ::c_long;
pub type register_t = i64;
s_no_extra_traits! {
pub struct gpregs {
pub gp_ra: ::register_t,
pub gp_sp: ::register_t,
pub gp_gp: ::register_t,
pub gp_tp: ::register_t,
pub gp_t: [::register_t; 7],
pub gp_s: [::register_t; 12],
pub gp_a: [::register_t; 8],
pub gp_sepc: ::register_t,
pub gp_sstatus: ::register_t,
}
pub struct fpregs {
pub fp_x: [[::register_t; 2]; 32],
pub fp_fcsr: ::register_t,
pub fp_flags: ::c_int,
pub fp_pad: ::c_int,
}
pub struct mcontext_t {
pub mc_gpregs: gpregs,
pub mc_fpregs: fpregs,
pub mc_flags: ::c_int,
pub mc_pad: ::c_int,
pub mc_spare: [u64; 8],
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for gpregs {
fn eq(&self, other: &gpregs) -> bool {
self.gp_ra == other.gp_ra &&
self.gp_sp == other.gp_sp &&
self.gp_gp == other.gp_gp &&
self.gp_tp == other.gp_tp &&
self.gp_t.iter().zip(other.gp_t.iter()).all(|(a, b)| a == b) &&
self.gp_s.iter().zip(other.gp_s.iter()).all(|(a, b)| a == b) &&
self.gp_a.iter().zip(other.gp_a.iter()).all(|(a, b)| a == b) &&
self.gp_sepc == other.gp_sepc &&
self.gp_sstatus == other.gp_sstatus
}
}
impl Eq for gpregs {}
impl ::fmt::Debug for gpregs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("gpregs")
.field("gp_ra", &self.gp_ra)
.field("gp_sp", &self.gp_sp)
.field("gp_gp", &self.gp_gp)
.field("gp_tp", &self.gp_tp)
.field("gp_t", &self.gp_t)
.field("gp_s", &self.gp_s)
.field("gp_a", &self.gp_a)
.field("gp_sepc", &self.gp_sepc)
.field("gp_sstatus", &self.gp_sstatus)
.finish()
}
}
impl ::hash::Hash for gpregs {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.gp_ra.hash(state);
self.gp_sp.hash(state);
self.gp_gp.hash(state);
self.gp_tp.hash(state);
self.gp_t.hash(state);
self.gp_s.hash(state);
self.gp_a.hash(state);
self.gp_sepc.hash(state);
self.gp_sstatus.hash(state);
}
}
impl PartialEq for fpregs {
fn eq(&self, other: &fpregs) -> bool {
self.fp_x == other.fp_x &&
self.fp_fcsr == other.fp_fcsr &&
self.fp_flags == other.fp_flags &&
self.fp_pad == other.fp_pad
}
}
impl Eq for fpregs {}
impl ::fmt::Debug for fpregs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("fpregs")
.field("fp_x", &self.fp_x)
.field("fp_fcsr", &self.fp_fcsr)
.field("fp_flags", &self.fp_flags)
.field("fp_pad", &self.fp_pad)
.finish()
}
}
impl ::hash::Hash for fpregs {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.fp_x.hash(state);
self.fp_fcsr.hash(state);
self.fp_flags.hash(state);
self.fp_pad.hash(state);
}
}
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.mc_gpregs == other.mc_gpregs &&
self.mc_fpregs == other.mc_fpregs &&
self.mc_flags == other.mc_flags &&
self.mc_pad == other.mc_pad &&
self.mc_spare.iter().zip(other.mc_spare.iter()).all(|(a, b)| a == b)
}
}
impl Eq for mcontext_t {}
impl ::fmt::Debug for mcontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("mcontext_t")
.field("mc_gpregs", &self.mc_gpregs)
.field("mc_fpregs", &self.mc_fpregs)
.field("mc_flags", &self.mc_flags)
.field("mc_pad", &self.mc_pad)
.field("mc_spare", &self.mc_spare)
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.mc_gpregs.hash(state);
self.mc_fpregs.hash(state);
self.mc_flags.hash(state);
self.mc_pad.hash(state);
self.mc_spare.hash(state);
}
}
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4

View file

@ -0,0 +1,178 @@
pub type c_char = i8;
pub type c_long = i32;
pub type c_ulong = u32;
pub type wchar_t = i32;
pub type time_t = i32;
pub type suseconds_t = i32;
pub type register_t = i32;
s_no_extra_traits! {
pub struct mcontext_t {
pub mc_onstack: register_t,
pub mc_gs: register_t,
pub mc_fs: register_t,
pub mc_es: register_t,
pub mc_ds: register_t,
pub mc_edi: register_t,
pub mc_esi: register_t,
pub mc_ebp: register_t,
pub mc_isp: register_t,
pub mc_ebx: register_t,
pub mc_edx: register_t,
pub mc_ecx: register_t,
pub mc_eax: register_t,
pub mc_trapno: register_t,
pub mc_err: register_t,
pub mc_eip: register_t,
pub mc_cs: register_t,
pub mc_eflags: register_t,
pub mc_esp: register_t,
pub mc_ss: register_t,
pub mc_len: ::c_int,
pub mc_fpformat: ::c_int,
pub mc_ownedfp: ::c_int,
pub mc_flags: register_t,
pub mc_fpstate: [[::c_int; 32]; 4],
pub mc_fsbase: register_t,
pub mc_gsbase: register_t,
pub mc_xfpustate: register_t,
pub mc_xfpustate_len: register_t,
pub mc_spare2: [::c_int; 4],
}
}
s! {
pub struct ucontext_t {
pub uc_sigmask: ::sigset_t,
pub uc_mcontext: ::mcontext_t,
pub uc_link: *mut ::ucontext_t,
pub uc_stack: ::stack_t,
pub uc_flags: ::c_int,
__spare__: [::c_int; 4],
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 4 - 1;
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.mc_onstack == other.mc_onstack &&
self.mc_gs == other.mc_gs &&
self.mc_fs == other.mc_fs &&
self.mc_es == other.mc_es &&
self.mc_ds == other.mc_ds &&
self.mc_edi == other.mc_edi &&
self.mc_esi == other.mc_esi &&
self.mc_ebp == other.mc_ebp &&
self.mc_isp == other.mc_isp &&
self.mc_ebx == other.mc_ebx &&
self.mc_edx == other.mc_edx &&
self.mc_ecx == other.mc_ecx &&
self.mc_eax == other.mc_eax &&
self.mc_trapno == other.mc_trapno &&
self.mc_err == other.mc_err &&
self.mc_eip == other.mc_eip &&
self.mc_cs == other.mc_cs &&
self.mc_eflags == other.mc_eflags &&
self.mc_esp == other.mc_esp &&
self.mc_ss == other.mc_ss &&
self.mc_len == other.mc_len &&
self.mc_fpformat == other.mc_fpformat &&
self.mc_ownedfp == other.mc_ownedfp &&
self.mc_flags == other.mc_flags &&
self.mc_fpstate.iter().zip(other.mc_fpstate.iter()).all(|(a, b)| a == b) &&
self.mc_fsbase == other.mc_fsbase &&
self.mc_gsbase == other.mc_gsbase &&
self.mc_xfpustate == other.mc_xfpustate &&
self.mc_xfpustate_len == other.mc_xfpustate_len &&
self.mc_spare2.iter().zip(other.mc_spare2.iter()).all(|(a, b)| a == b)
}
}
impl Eq for mcontext_t {}
impl ::fmt::Debug for mcontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("mcontext_t")
.field("mc_onstack", &self.mc_onstack)
.field("mc_gs", &self.mc_gs)
.field("mc_fs", &self.mc_fs)
.field("mc_es", &self.mc_es)
.field("mc_ds", &self.mc_ds)
.field("mc_edi", &self.mc_edi)
.field("mc_esi", &self.mc_esi)
.field("mc_ebp", &self.mc_ebp)
.field("mc_isp", &self.mc_isp)
.field("mc_ebx", &self.mc_ebx)
.field("mc_edx", &self.mc_edx)
.field("mc_ecx", &self.mc_ecx)
.field("mc_eax", &self.mc_eax)
.field("mc_trapno", &self.mc_trapno)
.field("mc_err", &self.mc_err)
.field("mc_eip", &self.mc_eip)
.field("mc_cs", &self.mc_cs)
.field("mc_eflags", &self.mc_eflags)
.field("mc_esp", &self.mc_esp)
.field("mc_ss", &self.mc_ss)
.field("mc_len", &self.mc_len)
.field("mc_fpformat", &self.mc_fpformat)
.field("mc_ownedfp", &self.mc_ownedfp)
.field("mc_flags", &self.mc_flags)
.field("mc_fpstate", &self.mc_fpstate)
.field("mc_fsbase", &self.mc_fsbase)
.field("mc_gsbase", &self.mc_gsbase)
.field("mc_xfpustate", &self.mc_xfpustate)
.field("mc_xfpustate_len", &self.mc_xfpustate_len)
.field("mc_spare2", &self.mc_spare2)
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.mc_onstack.hash(state);
self.mc_gs.hash(state);
self.mc_fs.hash(state);
self.mc_es.hash(state);
self.mc_ds.hash(state);
self.mc_edi.hash(state);
self.mc_esi.hash(state);
self.mc_ebp.hash(state);
self.mc_isp.hash(state);
self.mc_ebx.hash(state);
self.mc_edx.hash(state);
self.mc_ecx.hash(state);
self.mc_eax.hash(state);
self.mc_trapno.hash(state);
self.mc_err.hash(state);
self.mc_eip.hash(state);
self.mc_cs.hash(state);
self.mc_eflags.hash(state);
self.mc_esp.hash(state);
self.mc_ss.hash(state);
self.mc_len.hash(state);
self.mc_fpformat.hash(state);
self.mc_ownedfp.hash(state);
self.mc_flags.hash(state);
self.mc_fpstate.hash(state);
self.mc_fsbase.hash(state);
self.mc_gsbase.hash(state);
self.mc_xfpustate.hash(state);
self.mc_xfpustate_len.hash(state);
self.mc_spare2.hash(state);
}
}
}
}
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
pub const KINFO_FILE_SIZE: ::c_int = 1392;

View file

@ -0,0 +1,197 @@
use {c_long, register_t};
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 4]
}
#[repr(align(16))]
pub struct mcontext_t {
pub mc_onstack: register_t,
pub mc_rdi: register_t,
pub mc_rsi: register_t,
pub mc_rdx: register_t,
pub mc_rcx: register_t,
pub mc_r8: register_t,
pub mc_r9: register_t,
pub mc_rax: register_t,
pub mc_rbx: register_t,
pub mc_rbp: register_t,
pub mc_r10: register_t,
pub mc_r11: register_t,
pub mc_r12: register_t,
pub mc_r13: register_t,
pub mc_r14: register_t,
pub mc_r15: register_t,
pub mc_trapno: u32,
pub mc_fs: u16,
pub mc_gs: u16,
pub mc_addr: register_t,
pub mc_flags: u32,
pub mc_es: u16,
pub mc_ds: u16,
pub mc_err: register_t,
pub mc_rip: register_t,
pub mc_cs: register_t,
pub mc_rflags: register_t,
pub mc_rsp: register_t,
pub mc_ss: register_t,
pub mc_len: c_long,
pub mc_fpformat: c_long,
pub mc_ownedfp: c_long,
pub mc_fpstate: [c_long; 64],
pub mc_fsbase: register_t,
pub mc_gsbase: register_t,
pub mc_xfpustate: register_t,
pub mc_xfpustate_len: register_t,
pub mc_spare: [c_long; 4],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.mc_onstack == other.mc_onstack &&
self.mc_rdi == other.mc_rdi &&
self.mc_rsi == other.mc_rsi &&
self.mc_rdx == other.mc_rdx &&
self.mc_rcx == other.mc_rcx &&
self.mc_r8 == other.mc_r8 &&
self.mc_r9 == other.mc_r9 &&
self.mc_rax == other.mc_rax &&
self.mc_rbx == other.mc_rbx &&
self.mc_rbp == other.mc_rbp &&
self.mc_r10 == other.mc_r10 &&
self.mc_r11 == other.mc_r11 &&
self.mc_r12 == other.mc_r12 &&
self.mc_r13 == other.mc_r13 &&
self.mc_r14 == other.mc_r14 &&
self.mc_r15 == other.mc_r15 &&
self.mc_trapno == other.mc_trapno &&
self.mc_fs == other.mc_fs &&
self.mc_gs == other.mc_gs &&
self.mc_addr == other.mc_addr &&
self.mc_flags == other.mc_flags &&
self.mc_es == other.mc_es &&
self.mc_ds == other.mc_ds &&
self.mc_err == other.mc_err &&
self.mc_rip == other.mc_rip &&
self.mc_cs == other.mc_cs &&
self.mc_rflags == other.mc_rflags &&
self.mc_rsp == other.mc_rsp &&
self.mc_ss == other.mc_ss &&
self.mc_len == other.mc_len &&
self.mc_fpformat == other.mc_fpformat &&
self.mc_ownedfp == other.mc_ownedfp &&
self.mc_fpstate.iter().zip(other.mc_fpstate.iter())
.all(|(a, b)| a == b) &&
self.mc_fsbase == other.mc_fsbase &&
self.mc_gsbase == other.mc_gsbase &&
self.mc_xfpustate == other.mc_xfpustate &&
self.mc_xfpustate_len == other.mc_xfpustate_len &&
self.mc_spare == other.mc_spare
}
}
impl Eq for mcontext_t {}
impl ::fmt::Debug for mcontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("mcontext_t")
.field("mc_onstack", &self.mc_onstack)
.field("mc_rdi", &self.mc_rdi)
.field("mc_rsi", &self.mc_rsi)
.field("mc_rdx", &self.mc_rdx)
.field("mc_rcx", &self.mc_rcx)
.field("mc_r8", &self.mc_r8)
.field("mc_r9", &self.mc_r9)
.field("mc_rax", &self.mc_rax)
.field("mc_rbx", &self.mc_rbx)
.field("mc_rbp", &self.mc_rbp)
.field("mc_r10", &self.mc_r10)
.field("mc_r11", &self.mc_r11)
.field("mc_r12", &self.mc_r12)
.field("mc_r13", &self.mc_r13)
.field("mc_r14", &self.mc_r14)
.field("mc_r15", &self.mc_r15)
.field("mc_trapno", &self.mc_trapno)
.field("mc_fs", &self.mc_fs)
.field("mc_gs", &self.mc_gs)
.field("mc_addr", &self.mc_addr)
.field("mc_flags", &self.mc_flags)
.field("mc_es", &self.mc_es)
.field("mc_ds", &self.mc_ds)
.field("mc_err", &self.mc_err)
.field("mc_rip", &self.mc_rip)
.field("mc_cs", &self.mc_cs)
.field("mc_rflags", &self.mc_rflags)
.field("mc_rsp", &self.mc_rsp)
.field("mc_ss", &self.mc_ss)
.field("mc_len", &self.mc_len)
.field("mc_fpformat", &self.mc_fpformat)
.field("mc_ownedfp", &self.mc_ownedfp)
// FIXME: .field("mc_fpstate", &self.mc_fpstate)
.field("mc_fsbase", &self.mc_fsbase)
.field("mc_gsbase", &self.mc_gsbase)
.field("mc_xfpustate", &self.mc_xfpustate)
.field("mc_xfpustate_len", &self.mc_xfpustate_len)
.field("mc_spare", &self.mc_spare)
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.mc_onstack.hash(state);
self.mc_rdi.hash(state);
self.mc_rsi.hash(state);
self.mc_rdx.hash(state);
self.mc_rcx.hash(state);
self.mc_r8.hash(state);
self.mc_r9.hash(state);
self.mc_rax.hash(state);
self.mc_rbx.hash(state);
self.mc_rbp.hash(state);
self.mc_r10.hash(state);
self.mc_r11.hash(state);
self.mc_r12.hash(state);
self.mc_r13.hash(state);
self.mc_r14.hash(state);
self.mc_r15.hash(state);
self.mc_trapno.hash(state);
self.mc_fs.hash(state);
self.mc_gs.hash(state);
self.mc_addr.hash(state);
self.mc_flags.hash(state);
self.mc_es.hash(state);
self.mc_ds.hash(state);
self.mc_err.hash(state);
self.mc_rip.hash(state);
self.mc_cs.hash(state);
self.mc_rflags.hash(state);
self.mc_rsp.hash(state);
self.mc_ss.hash(state);
self.mc_len.hash(state);
self.mc_fpformat.hash(state);
self.mc_ownedfp.hash(state);
self.mc_fpstate.hash(state);
self.mc_fsbase.hash(state);
self.mc_gsbase.hash(state);
self.mc_xfpustate.hash(state);
self.mc_xfpustate_len.hash(state);
self.mc_spare.hash(state);
}
}
}
}
s! {
pub struct ucontext_t {
pub uc_sigmask: ::sigset_t,
pub uc_mcontext: ::mcontext_t,
pub uc_link: *mut ::ucontext_t,
pub uc_stack: ::stack_t,
pub uc_flags: ::c_int,
__spare__: [::c_int; 4],
}
}

View file

@ -0,0 +1,273 @@
pub type c_char = i8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type wchar_t = i32;
pub type time_t = i64;
pub type suseconds_t = i64;
pub type register_t = i64;
s! {
pub struct reg32 {
pub r_fs: u32,
pub r_es: u32,
pub r_ds: u32,
pub r_edi: u32,
pub r_esi: u32,
pub r_ebp: u32,
pub r_isp: u32,
pub r_ebx: u32,
pub r_edx: u32,
pub r_ecx: u32,
pub r_eax: u32,
pub r_trapno: u32,
pub r_err: u32,
pub r_eip: u32,
pub r_cs: u32,
pub r_eflags: u32,
pub r_esp: u32,
pub r_ss: u32,
pub r_gs: u32,
}
pub struct reg {
pub r_r15: i64,
pub r_r14: i64,
pub r_r13: i64,
pub r_r12: i64,
pub r_r11: i64,
pub r_r10: i64,
pub r_r9: i64,
pub r_r8: i64,
pub r_rdi: i64,
pub r_rsi: i64,
pub r_rbp: i64,
pub r_rbx: i64,
pub r_rdx: i64,
pub r_rcx: i64,
pub r_rax: i64,
pub r_trapno: u32,
pub r_fs: u16,
pub r_gs: u16,
pub r_err: u32,
pub r_es: u16,
pub r_ds: u16,
pub r_rip: i64,
pub r_cs: i64,
pub r_rflags: i64,
pub r_rsp: i64,
pub r_ss: i64,
}
}
s_no_extra_traits! {
pub struct fpreg32 {
pub fpr_env: [u32; 7],
pub fpr_acc: [[u8; 10]; 8],
pub fpr_ex_sw: u32,
pub fpr_pad: [u8; 64],
}
pub struct fpreg {
pub fpr_env: [u64; 4],
pub fpr_acc: [[u8; 16]; 8],
pub fpr_xacc: [[u8; 16]; 16],
pub fpr_spare: [u64; 12],
}
pub struct xmmreg {
pub xmm_env: [u32; 8],
pub xmm_acc: [[u8; 16]; 8],
pub xmm_reg: [[u8; 16]; 8],
pub xmm_pad: [u8; 224],
}
#[cfg(libc_union)]
pub union __c_anonymous_elf64_auxv_union {
pub a_val: ::c_long,
pub a_ptr: *mut ::c_void,
pub a_fcn: extern "C" fn(),
}
pub struct Elf64_Auxinfo {
pub a_type: ::c_long,
#[cfg(libc_union)]
pub a_un: __c_anonymous_elf64_auxv_union,
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for fpreg32 {
fn eq(&self, other: &fpreg32) -> bool {
self.fpr_env == other.fpr_env &&
self.fpr_acc == other.fpr_acc &&
self.fpr_ex_sw == other.fpr_ex_sw &&
self.fpr_pad
.iter()
.zip(other.fpr_pad.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for fpreg32 {}
impl ::fmt::Debug for fpreg32 {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("fpreg32")
.field("fpr_env", &&self.fpr_env[..])
.field("fpr_acc", &self.fpr_acc)
.field("fpr_ex_sw", &self.fpr_ex_sw)
.field("fpr_pad", &&self.fpr_pad[..])
.finish()
}
}
impl ::hash::Hash for fpreg32 {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.fpr_env.hash(state);
self.fpr_acc.hash(state);
self.fpr_ex_sw.hash(state);
self.fpr_pad.hash(state);
}
}
impl PartialEq for fpreg {
fn eq(&self, other: &fpreg) -> bool {
self.fpr_env == other.fpr_env &&
self.fpr_acc == other.fpr_acc &&
self.fpr_xacc == other.fpr_xacc &&
self.fpr_spare == other.fpr_spare
}
}
impl Eq for fpreg {}
impl ::fmt::Debug for fpreg {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("fpreg")
.field("fpr_env", &self.fpr_env)
.field("fpr_acc", &self.fpr_acc)
.field("fpr_xacc", &self.fpr_xacc)
.field("fpr_spare", &self.fpr_spare)
.finish()
}
}
impl ::hash::Hash for fpreg {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.fpr_env.hash(state);
self.fpr_acc.hash(state);
self.fpr_xacc.hash(state);
self.fpr_spare.hash(state);
}
}
impl PartialEq for xmmreg {
fn eq(&self, other: &xmmreg) -> bool {
self.xmm_env == other.xmm_env &&
self.xmm_acc == other.xmm_acc &&
self.xmm_reg == other.xmm_reg &&
self.xmm_pad
.iter()
.zip(other.xmm_pad.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for xmmreg {}
impl ::fmt::Debug for xmmreg {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("xmmreg")
.field("xmm_env", &self.xmm_env)
.field("xmm_acc", &self.xmm_acc)
.field("xmm_reg", &self.xmm_reg)
.field("xmm_pad", &&self.xmm_pad[..])
.finish()
}
}
impl ::hash::Hash for xmmreg {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.xmm_env.hash(state);
self.xmm_acc.hash(state);
self.xmm_reg.hash(state);
self.xmm_pad.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for __c_anonymous_elf64_auxv_union {
fn eq(&self, other: &__c_anonymous_elf64_auxv_union) -> bool {
unsafe { self.a_val == other.a_val
|| self.a_ptr == other.a_ptr
|| self.a_fcn == other.a_fcn }
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous_elf64_auxv_union {}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous_elf64_auxv_union {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("a_val")
.field("a_val", unsafe { &self.a_val })
.finish()
}
}
#[cfg(not(libc_union))]
impl PartialEq for Elf64_Auxinfo {
fn eq(&self, other: &Elf64_Auxinfo) -> bool {
self.a_type == other.a_type
}
}
#[cfg(libc_union)]
impl PartialEq for Elf64_Auxinfo {
fn eq(&self, other: &Elf64_Auxinfo) -> bool {
self.a_type == other.a_type
&& self.a_un == other.a_un
}
}
impl Eq for Elf64_Auxinfo {}
#[cfg(not(libc_union))]
impl ::fmt::Debug for Elf64_Auxinfo {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("Elf64_Auxinfo")
.field("a_type", &self.a_type)
.finish()
}
}
#[cfg(libc_union)]
impl ::fmt::Debug for Elf64_Auxinfo {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("Elf64_Auxinfo")
.field("a_type", &self.a_type)
.field("a_un", &self.a_un)
.finish()
}
}
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
pub const _MC_HASSEGS: u32 = 0x1;
pub const _MC_HASBASES: u32 = 0x2;
pub const _MC_HASFPXSTATE: u32 = 0x4;
pub const _MC_FLAG_MASK: u32 = _MC_HASSEGS | _MC_HASBASES | _MC_HASFPXSTATE;
pub const _MC_FPFMT_NODEV: c_long = 0x10000;
pub const _MC_FPFMT_XMM: c_long = 0x10002;
pub const _MC_FPOWNED_NONE: c_long = 0x20000;
pub const _MC_FPOWNED_FPU: c_long = 0x20001;
pub const _MC_FPOWNED_PCB: c_long = 0x20002;
pub const KINFO_FILE_SIZE: ::c_int = 1392;
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}

File diff suppressed because it is too large Load diff

977
vendor/libc/src/unix/bsd/mod.rs vendored Normal file
View file

@ -0,0 +1,977 @@
pub type off_t = i64;
pub type useconds_t = u32;
pub type blkcnt_t = i64;
pub type socklen_t = u32;
pub type sa_family_t = u8;
pub type pthread_t = ::uintptr_t;
pub type nfds_t = ::c_uint;
pub type regoff_t = off_t;
s! {
pub struct sockaddr {
pub sa_len: u8,
pub sa_family: sa_family_t,
pub sa_data: [::c_char; 14],
}
pub struct sockaddr_in6 {
pub sin6_len: u8,
pub sin6_family: sa_family_t,
pub sin6_port: ::in_port_t,
pub sin6_flowinfo: u32,
pub sin6_addr: ::in6_addr,
pub sin6_scope_id: u32,
}
pub struct passwd {
pub pw_name: *mut ::c_char,
pub pw_passwd: *mut ::c_char,
pub pw_uid: ::uid_t,
pub pw_gid: ::gid_t,
pub pw_change: ::time_t,
pub pw_class: *mut ::c_char,
pub pw_gecos: *mut ::c_char,
pub pw_dir: *mut ::c_char,
pub pw_shell: *mut ::c_char,
pub pw_expire: ::time_t,
#[cfg(not(any(target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_os = "visionos",
target_os = "netbsd",
target_os = "openbsd")))]
pub pw_fields: ::c_int,
}
pub struct ifaddrs {
pub ifa_next: *mut ifaddrs,
pub ifa_name: *mut ::c_char,
pub ifa_flags: ::c_uint,
pub ifa_addr: *mut ::sockaddr,
pub ifa_netmask: *mut ::sockaddr,
pub ifa_dstaddr: *mut ::sockaddr,
pub ifa_data: *mut ::c_void,
#[cfg(target_os = "netbsd")]
pub ifa_addrflags: ::c_uint
}
pub struct fd_set {
#[cfg(all(target_pointer_width = "64",
any(target_os = "freebsd", target_os = "dragonfly")))]
fds_bits: [i64; FD_SETSIZE / 64],
#[cfg(not(all(target_pointer_width = "64",
any(target_os = "freebsd", target_os = "dragonfly"))))]
fds_bits: [i32; FD_SETSIZE / 32],
}
pub struct tm {
pub tm_sec: ::c_int,
pub tm_min: ::c_int,
pub tm_hour: ::c_int,
pub tm_mday: ::c_int,
pub tm_mon: ::c_int,
pub tm_year: ::c_int,
pub tm_wday: ::c_int,
pub tm_yday: ::c_int,
pub tm_isdst: ::c_int,
pub tm_gmtoff: ::c_long,
pub tm_zone: *mut ::c_char,
}
pub struct msghdr {
pub msg_name: *mut ::c_void,
pub msg_namelen: ::socklen_t,
pub msg_iov: *mut ::iovec,
pub msg_iovlen: ::c_int,
pub msg_control: *mut ::c_void,
pub msg_controllen: ::socklen_t,
pub msg_flags: ::c_int,
}
pub struct cmsghdr {
pub cmsg_len: ::socklen_t,
pub cmsg_level: ::c_int,
pub cmsg_type: ::c_int,
}
pub struct fsid_t {
__fsid_val: [i32; 2],
}
pub struct if_nameindex {
pub if_index: ::c_uint,
pub if_name: *mut ::c_char,
}
pub struct regex_t {
__re_magic: ::c_int,
__re_nsub: ::size_t,
__re_endp: *const ::c_char,
__re_g: *mut ::c_void,
}
pub struct regmatch_t {
pub rm_so: regoff_t,
pub rm_eo: regoff_t,
}
pub struct option {
pub name: *const ::c_char,
pub has_arg: ::c_int,
pub flag: *mut ::c_int,
pub val: ::c_int,
}
}
s_no_extra_traits! {
pub struct sockaddr_un {
pub sun_len: u8,
pub sun_family: sa_family_t,
pub sun_path: [c_char; 104]
}
pub struct utsname {
#[cfg(not(target_os = "dragonfly"))]
pub sysname: [::c_char; 256],
#[cfg(target_os = "dragonfly")]
pub sysname: [::c_char; 32],
#[cfg(not(target_os = "dragonfly"))]
pub nodename: [::c_char; 256],
#[cfg(target_os = "dragonfly")]
pub nodename: [::c_char; 32],
#[cfg(not(target_os = "dragonfly"))]
pub release: [::c_char; 256],
#[cfg(target_os = "dragonfly")]
pub release: [::c_char; 32],
#[cfg(not(target_os = "dragonfly"))]
pub version: [::c_char; 256],
#[cfg(target_os = "dragonfly")]
pub version: [::c_char; 32],
#[cfg(not(target_os = "dragonfly"))]
pub machine: [::c_char; 256],
#[cfg(target_os = "dragonfly")]
pub machine: [::c_char; 32],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for sockaddr_un {
fn eq(&self, other: &sockaddr_un) -> bool {
self.sun_len == other.sun_len
&& self.sun_family == other.sun_family
&& self
.sun_path
.iter()
.zip(other.sun_path.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for sockaddr_un {}
impl ::fmt::Debug for sockaddr_un {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sockaddr_un")
.field("sun_len", &self.sun_len)
.field("sun_family", &self.sun_family)
// FIXME: .field("sun_path", &self.sun_path)
.finish()
}
}
impl ::hash::Hash for sockaddr_un {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.sun_len.hash(state);
self.sun_family.hash(state);
self.sun_path.hash(state);
}
}
impl PartialEq for utsname {
fn eq(&self, other: &utsname) -> bool {
self.sysname
.iter()
.zip(other.sysname.iter())
.all(|(a,b)| a == b)
&& self
.nodename
.iter()
.zip(other.nodename.iter())
.all(|(a,b)| a == b)
&& self
.release
.iter()
.zip(other.release.iter())
.all(|(a,b)| a == b)
&& self
.version
.iter()
.zip(other.version.iter())
.all(|(a,b)| a == b)
&& self
.machine
.iter()
.zip(other.machine.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for utsname {}
impl ::fmt::Debug for utsname {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("utsname")
// FIXME: .field("sysname", &self.sysname)
// FIXME: .field("nodename", &self.nodename)
// FIXME: .field("release", &self.release)
// FIXME: .field("version", &self.version)
// FIXME: .field("machine", &self.machine)
.finish()
}
}
impl ::hash::Hash for utsname {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.sysname.hash(state);
self.nodename.hash(state);
self.release.hash(state);
self.version.hash(state);
self.machine.hash(state);
}
}
}
}
pub const LC_ALL: ::c_int = 0;
pub const LC_COLLATE: ::c_int = 1;
pub const LC_CTYPE: ::c_int = 2;
pub const LC_MONETARY: ::c_int = 3;
pub const LC_NUMERIC: ::c_int = 4;
pub const LC_TIME: ::c_int = 5;
pub const LC_MESSAGES: ::c_int = 6;
pub const FIOCLEX: ::c_ulong = 0x20006601;
pub const FIONCLEX: ::c_ulong = 0x20006602;
pub const FIONREAD: ::c_ulong = 0x4004667f;
pub const FIONBIO: ::c_ulong = 0x8004667e;
pub const FIOASYNC: ::c_ulong = 0x8004667d;
pub const FIOSETOWN: ::c_ulong = 0x8004667c;
pub const FIOGETOWN: ::c_ulong = 0x4004667b;
pub const PATH_MAX: ::c_int = 1024;
pub const MAXPATHLEN: ::c_int = PATH_MAX;
pub const IOV_MAX: ::c_int = 1024;
pub const SA_ONSTACK: ::c_int = 0x0001;
pub const SA_SIGINFO: ::c_int = 0x0040;
pub const SA_RESTART: ::c_int = 0x0002;
pub const SA_RESETHAND: ::c_int = 0x0004;
pub const SA_NOCLDSTOP: ::c_int = 0x0008;
pub const SA_NODEFER: ::c_int = 0x0010;
pub const SA_NOCLDWAIT: ::c_int = 0x0020;
pub const SS_ONSTACK: ::c_int = 1;
pub const SS_DISABLE: ::c_int = 4;
pub const SIGCHLD: ::c_int = 20;
pub const SIGBUS: ::c_int = 10;
pub const SIGUSR1: ::c_int = 30;
pub const SIGUSR2: ::c_int = 31;
pub const SIGCONT: ::c_int = 19;
pub const SIGSTOP: ::c_int = 17;
pub const SIGTSTP: ::c_int = 18;
pub const SIGURG: ::c_int = 16;
pub const SIGIO: ::c_int = 23;
pub const SIGSYS: ::c_int = 12;
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;
pub const SIGXCPU: ::c_int = 24;
pub const SIGXFSZ: ::c_int = 25;
pub const SIGVTALRM: ::c_int = 26;
pub const SIGPROF: ::c_int = 27;
pub const SIGWINCH: ::c_int = 28;
pub const SIGINFO: ::c_int = 29;
pub const SIG_SETMASK: ::c_int = 3;
pub const SIG_BLOCK: ::c_int = 0x1;
pub const SIG_UNBLOCK: ::c_int = 0x2;
pub const IP_TOS: ::c_int = 3;
pub const IP_MULTICAST_IF: ::c_int = 9;
pub const IP_MULTICAST_TTL: ::c_int = 10;
pub const IP_MULTICAST_LOOP: ::c_int = 11;
pub const IPV6_UNICAST_HOPS: ::c_int = 4;
pub const IPV6_MULTICAST_IF: ::c_int = 9;
pub const IPV6_MULTICAST_HOPS: ::c_int = 10;
pub const IPV6_MULTICAST_LOOP: ::c_int = 11;
pub const IPV6_V6ONLY: ::c_int = 27;
pub const IPV6_DONTFRAG: ::c_int = 62;
pub const IPTOS_ECN_NOTECT: u8 = 0x00;
pub const IPTOS_ECN_MASK: u8 = 0x03;
pub const IPTOS_ECN_ECT1: u8 = 0x01;
pub const IPTOS_ECN_ECT0: u8 = 0x02;
pub const IPTOS_ECN_CE: u8 = 0x03;
pub const ST_RDONLY: ::c_ulong = 1;
pub const SCM_RIGHTS: ::c_int = 0x01;
pub const NCCS: usize = 20;
pub const O_ACCMODE: ::c_int = 0x3;
pub const O_RDONLY: ::c_int = 0;
pub const O_WRONLY: ::c_int = 1;
pub const O_RDWR: ::c_int = 2;
pub const O_APPEND: ::c_int = 8;
pub const O_CREAT: ::c_int = 512;
pub const O_TRUNC: ::c_int = 1024;
pub const O_EXCL: ::c_int = 2048;
pub const O_ASYNC: ::c_int = 0x40;
pub const O_SYNC: ::c_int = 0x80;
pub const O_NONBLOCK: ::c_int = 0x4;
pub const O_NOFOLLOW: ::c_int = 0x100;
pub const O_SHLOCK: ::c_int = 0x10;
pub const O_EXLOCK: ::c_int = 0x20;
pub const O_FSYNC: ::c_int = O_SYNC;
pub const O_NDELAY: ::c_int = O_NONBLOCK;
pub const F_GETOWN: ::c_int = 5;
pub const F_SETOWN: ::c_int = 6;
pub const F_RDLCK: ::c_short = 1;
pub const F_UNLCK: ::c_short = 2;
pub const F_WRLCK: ::c_short = 3;
pub const MNT_RDONLY: ::c_int = 0x00000001;
pub const MNT_SYNCHRONOUS: ::c_int = 0x00000002;
pub const MNT_NOEXEC: ::c_int = 0x00000004;
pub const MNT_NOSUID: ::c_int = 0x00000008;
pub const MNT_ASYNC: ::c_int = 0x00000040;
pub const MNT_EXPORTED: ::c_int = 0x00000100;
pub const MNT_UPDATE: ::c_int = 0x00010000;
pub const MNT_RELOAD: ::c_int = 0x00040000;
pub const MNT_FORCE: ::c_int = 0x00080000;
pub const Q_SYNC: ::c_int = 0x600;
pub const Q_QUOTAON: ::c_int = 0x100;
pub const Q_QUOTAOFF: ::c_int = 0x200;
pub const TCIOFF: ::c_int = 3;
pub const TCION: ::c_int = 4;
pub const TCOOFF: ::c_int = 1;
pub const TCOON: ::c_int = 2;
pub const TCIFLUSH: ::c_int = 1;
pub const TCOFLUSH: ::c_int = 2;
pub const TCIOFLUSH: ::c_int = 3;
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
pub const VEOF: usize = 0;
pub const VEOL: usize = 1;
pub const VEOL2: usize = 2;
pub const VERASE: usize = 3;
pub const VWERASE: usize = 4;
pub const VKILL: usize = 5;
pub const VREPRINT: usize = 6;
pub const VINTR: usize = 8;
pub const VQUIT: usize = 9;
pub const VSUSP: usize = 10;
pub const VDSUSP: usize = 11;
pub const VSTART: usize = 12;
pub const VSTOP: usize = 13;
pub const VLNEXT: usize = 14;
pub const VDISCARD: usize = 15;
pub const VMIN: usize = 16;
pub const VTIME: usize = 17;
pub const VSTATUS: usize = 18;
pub const _POSIX_VDISABLE: ::cc_t = 0xff;
pub const IGNBRK: ::tcflag_t = 0x00000001;
pub const BRKINT: ::tcflag_t = 0x00000002;
pub const IGNPAR: ::tcflag_t = 0x00000004;
pub const PARMRK: ::tcflag_t = 0x00000008;
pub const INPCK: ::tcflag_t = 0x00000010;
pub const ISTRIP: ::tcflag_t = 0x00000020;
pub const INLCR: ::tcflag_t = 0x00000040;
pub const IGNCR: ::tcflag_t = 0x00000080;
pub const ICRNL: ::tcflag_t = 0x00000100;
pub const IXON: ::tcflag_t = 0x00000200;
pub const IXOFF: ::tcflag_t = 0x00000400;
pub const IXANY: ::tcflag_t = 0x00000800;
pub const IMAXBEL: ::tcflag_t = 0x00002000;
pub const OPOST: ::tcflag_t = 0x1;
pub const ONLCR: ::tcflag_t = 0x2;
pub const OXTABS: ::tcflag_t = 0x4;
pub const ONOEOT: ::tcflag_t = 0x8;
pub const CIGNORE: ::tcflag_t = 0x00000001;
pub const CSIZE: ::tcflag_t = 0x00000300;
pub const CS5: ::tcflag_t = 0x00000000;
pub const CS6: ::tcflag_t = 0x00000100;
pub const CS7: ::tcflag_t = 0x00000200;
pub const CS8: ::tcflag_t = 0x00000300;
pub const CSTOPB: ::tcflag_t = 0x00000400;
pub const CREAD: ::tcflag_t = 0x00000800;
pub const PARENB: ::tcflag_t = 0x00001000;
pub const PARODD: ::tcflag_t = 0x00002000;
pub const HUPCL: ::tcflag_t = 0x00004000;
pub const CLOCAL: ::tcflag_t = 0x00008000;
pub const ECHOKE: ::tcflag_t = 0x00000001;
pub const ECHOE: ::tcflag_t = 0x00000002;
pub const ECHOK: ::tcflag_t = 0x00000004;
pub const ECHO: ::tcflag_t = 0x00000008;
pub const ECHONL: ::tcflag_t = 0x00000010;
pub const ECHOPRT: ::tcflag_t = 0x00000020;
pub const ECHOCTL: ::tcflag_t = 0x00000040;
pub const ISIG: ::tcflag_t = 0x00000080;
pub const ICANON: ::tcflag_t = 0x00000100;
pub const ALTWERASE: ::tcflag_t = 0x00000200;
pub const IEXTEN: ::tcflag_t = 0x00000400;
pub const EXTPROC: ::tcflag_t = 0x00000800;
pub const TOSTOP: ::tcflag_t = 0x00400000;
pub const FLUSHO: ::tcflag_t = 0x00800000;
pub const NOKERNINFO: ::tcflag_t = 0x02000000;
pub const PENDIN: ::tcflag_t = 0x20000000;
pub const NOFLSH: ::tcflag_t = 0x80000000;
pub const MDMBUF: ::tcflag_t = 0x00100000;
pub const WNOHANG: ::c_int = 0x00000001;
pub const WUNTRACED: ::c_int = 0x00000002;
pub const RTLD_LAZY: ::c_int = 0x1;
pub const RTLD_NOW: ::c_int = 0x2;
pub const RTLD_NEXT: *mut ::c_void = -1isize as *mut ::c_void;
pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void;
pub const RTLD_SELF: *mut ::c_void = -3isize as *mut ::c_void;
pub const LOG_CRON: ::c_int = 9 << 3;
pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
pub const LOG_FTP: ::c_int = 11 << 3;
pub const LOG_PERROR: ::c_int = 0x20;
pub const TCP_NODELAY: ::c_int = 1;
pub const TCP_MAXSEG: ::c_int = 2;
pub const PIPE_BUF: usize = 512;
// si_code values for SIGBUS signal
pub const BUS_ADRALN: ::c_int = 1;
pub const BUS_ADRERR: ::c_int = 2;
pub const BUS_OBJERR: ::c_int = 3;
// si_code values for SIGCHLD signal
pub const CLD_EXITED: ::c_int = 1;
pub const CLD_KILLED: ::c_int = 2;
pub const CLD_DUMPED: ::c_int = 3;
pub const CLD_TRAPPED: ::c_int = 4;
pub const CLD_STOPPED: ::c_int = 5;
pub const CLD_CONTINUED: ::c_int = 6;
pub const POLLIN: ::c_short = 0x1;
pub const POLLPRI: ::c_short = 0x2;
pub const POLLOUT: ::c_short = 0x4;
pub const POLLERR: ::c_short = 0x8;
pub const POLLHUP: ::c_short = 0x10;
pub const POLLNVAL: ::c_short = 0x20;
pub const POLLRDNORM: ::c_short = 0x040;
pub const POLLWRNORM: ::c_short = 0x004;
pub const POLLRDBAND: ::c_short = 0x080;
pub const POLLWRBAND: ::c_short = 0x100;
pub const BIOCGBLEN: ::c_ulong = 0x40044266;
pub const BIOCSBLEN: ::c_ulong = 0xc0044266;
pub const BIOCFLUSH: ::c_uint = 0x20004268;
pub const BIOCPROMISC: ::c_uint = 0x20004269;
pub const BIOCGDLT: ::c_ulong = 0x4004426a;
pub const BIOCGETIF: ::c_ulong = 0x4020426b;
pub const BIOCSETIF: ::c_ulong = 0x8020426c;
pub const BIOCGSTATS: ::c_ulong = 0x4008426f;
pub const BIOCIMMEDIATE: ::c_ulong = 0x80044270;
pub const BIOCVERSION: ::c_ulong = 0x40044271;
pub const BIOCGHDRCMPLT: ::c_ulong = 0x40044274;
pub const BIOCSHDRCMPLT: ::c_ulong = 0x80044275;
pub const SIOCGIFADDR: ::c_ulong = 0xc0206921;
pub const REG_BASIC: ::c_int = 0o0000;
pub const REG_EXTENDED: ::c_int = 0o0001;
pub const REG_ICASE: ::c_int = 0o0002;
pub const REG_NOSUB: ::c_int = 0o0004;
pub const REG_NEWLINE: ::c_int = 0o0010;
pub const REG_NOSPEC: ::c_int = 0o0020;
pub const REG_PEND: ::c_int = 0o0040;
pub const REG_DUMP: ::c_int = 0o0200;
pub const REG_NOMATCH: ::c_int = 1;
pub const REG_BADPAT: ::c_int = 2;
pub const REG_ECOLLATE: ::c_int = 3;
pub const REG_ECTYPE: ::c_int = 4;
pub const REG_EESCAPE: ::c_int = 5;
pub const REG_ESUBREG: ::c_int = 6;
pub const REG_EBRACK: ::c_int = 7;
pub const REG_EPAREN: ::c_int = 8;
pub const REG_EBRACE: ::c_int = 9;
pub const REG_BADBR: ::c_int = 10;
pub const REG_ERANGE: ::c_int = 11;
pub const REG_ESPACE: ::c_int = 12;
pub const REG_BADRPT: ::c_int = 13;
pub const REG_EMPTY: ::c_int = 14;
pub const REG_ASSERT: ::c_int = 15;
pub const REG_INVARG: ::c_int = 16;
pub const REG_ATOI: ::c_int = 255;
pub const REG_ITOA: ::c_int = 0o0400;
pub const REG_NOTBOL: ::c_int = 0o00001;
pub const REG_NOTEOL: ::c_int = 0o00002;
pub const REG_STARTEND: ::c_int = 0o00004;
pub const REG_TRACE: ::c_int = 0o00400;
pub const REG_LARGE: ::c_int = 0o01000;
pub const REG_BACKR: ::c_int = 0o02000;
pub const TIOCCBRK: ::c_uint = 0x2000747a;
pub const TIOCSBRK: ::c_uint = 0x2000747b;
pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;
pub const ITIMER_REAL: ::c_int = 0;
pub const ITIMER_VIRTUAL: ::c_int = 1;
pub const ITIMER_PROF: ::c_int = 2;
// net/route.h
pub const RTF_UP: ::c_int = 0x1;
pub const RTF_GATEWAY: ::c_int = 0x2;
pub const RTF_HOST: ::c_int = 0x4;
pub const RTF_REJECT: ::c_int = 0x8;
pub const RTF_DYNAMIC: ::c_int = 0x10;
pub const RTF_MODIFIED: ::c_int = 0x20;
pub const RTF_DONE: ::c_int = 0x40;
pub const RTF_STATIC: ::c_int = 0x800;
pub const RTF_BLACKHOLE: ::c_int = 0x1000;
pub const RTF_PROTO2: ::c_int = 0x4000;
pub const RTF_PROTO1: ::c_int = 0x8000;
// Message types
pub const RTM_ADD: ::c_int = 0x1;
pub const RTM_DELETE: ::c_int = 0x2;
pub const RTM_CHANGE: ::c_int = 0x3;
pub const RTM_GET: ::c_int = 0x4;
pub const RTM_LOSING: ::c_int = 0x5;
pub const RTM_REDIRECT: ::c_int = 0x6;
pub const RTM_MISS: ::c_int = 0x7;
// Bitmask values for rtm_addrs.
pub const RTA_DST: ::c_int = 0x1;
pub const RTA_GATEWAY: ::c_int = 0x2;
pub const RTA_NETMASK: ::c_int = 0x4;
pub const RTA_GENMASK: ::c_int = 0x8;
pub const RTA_IFP: ::c_int = 0x10;
pub const RTA_IFA: ::c_int = 0x20;
pub const RTA_AUTHOR: ::c_int = 0x40;
pub const RTA_BRD: ::c_int = 0x80;
// Index offsets for sockaddr array for alternate internal encoding.
pub const RTAX_DST: ::c_int = 0;
pub const RTAX_GATEWAY: ::c_int = 1;
pub const RTAX_NETMASK: ::c_int = 2;
pub const RTAX_GENMASK: ::c_int = 3;
pub const RTAX_IFP: ::c_int = 4;
pub const RTAX_IFA: ::c_int = 5;
pub const RTAX_AUTHOR: ::c_int = 6;
pub const RTAX_BRD: ::c_int = 7;
f! {
pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
(*mhdr).msg_control as *mut ::cmsghdr
} else {
0 as *mut ::cmsghdr
}
}
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
let fd = fd as usize;
(*set).fds_bits[fd / bits] &= !(1 << (fd % bits));
return
}
pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
let fd = fd as usize;
return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0
}
pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
let fd = fd as usize;
(*set).fds_bits[fd / bits] |= 1 << (fd % bits);
return
}
pub fn FD_ZERO(set: *mut fd_set) -> () {
for slot in (*set).fds_bits.iter_mut() {
*slot = 0;
}
}
}
safe_f! {
pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
status & 0o177
}
pub {const} fn WIFEXITED(status: ::c_int) -> bool {
(status & 0o177) == 0
}
pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
status >> 8
}
pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
(status & 0o200) != 0
}
pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
(cmd << 8) | (type_ & 0x00ff)
}
}
extern "C" {
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "getrlimit$UNIX2003"
)]
pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "setrlimit$UNIX2003"
)]
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn abs(i: ::c_int) -> ::c_int;
pub fn labs(i: ::c_long) -> ::c_long;
#[cfg_attr(
all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)),
link_name = "rand@FBSD_1.0"
)]
pub fn rand() -> ::c_int;
#[cfg_attr(
all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)),
link_name = "srand@FBSD_1.0"
)]
pub fn srand(seed: ::c_uint);
pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
pub fn freeifaddrs(ifa: *mut ::ifaddrs);
pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
pub fn setlogin(name: *const ::c_char) -> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
pub fn kqueue() -> ::c_int;
pub fn unmount(target: *const ::c_char, arg: ::c_int) -> ::c_int;
pub fn syscall(num: ::c_int, ...) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent50")]
pub fn getpwent() -> *mut passwd;
pub fn setpwent();
pub fn endpwent();
pub fn endgrent();
pub fn getgrent() -> *mut ::group;
pub fn getprogname() -> *const ::c_char;
pub fn setprogname(name: *const ::c_char);
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::gid_t) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", not(target_arch = "aarch64")),
link_name = "glob$INODE64"
)]
#[cfg_attr(target_os = "netbsd", link_name = "__glob30")]
#[cfg_attr(
all(target_os = "freebsd", any(freebsd11, freebsd10)),
link_name = "glob@FBSD_1.0"
)]
pub fn glob(
pattern: *const ::c_char,
flags: ::c_int,
errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
pglob: *mut ::glob_t,
) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__globfree30")]
#[cfg_attr(
all(target_os = "freebsd", any(freebsd11, freebsd10)),
link_name = "globfree@FBSD_1.0"
)]
pub fn globfree(pglob: *mut ::glob_t);
pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86_64"),
link_name = "seekdir$INODE64"
)]
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "seekdir$INODE64$UNIX2003"
)]
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
#[cfg_attr(
all(target_os = "macos", target_arch = "x86_64"),
link_name = "telldir$INODE64"
)]
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "telldir$INODE64$UNIX2003"
)]
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "msync$UNIX2003"
)]
#[cfg_attr(target_os = "netbsd", link_name = "__msync13")]
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "recvfrom$UNIX2003"
)]
pub fn recvfrom(
socket: ::c_int,
buf: *mut ::c_void,
len: ::size_t,
flags: ::c_int,
addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t,
) -> ::ssize_t;
pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__futimes50")]
pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "bind$UNIX2003"
)]
pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "writev$UNIX2003"
)]
pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "readv$UNIX2003"
)]
pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "sendmsg$UNIX2003"
)]
pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "recvmsg$UNIX2003"
)]
pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
pub fn sync();
pub fn getgrgid_r(
gid: ::gid_t,
grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "sigaltstack$UNIX2003"
)]
#[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")]
pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
pub fn sem_close(sem: *mut sem_t) -> ::c_int;
pub fn getdtablesize() -> ::c_int;
pub fn getgrnam_r(
name: *const ::c_char,
grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "pthread_sigmask$UNIX2003"
)]
pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "pthread_cancel$UNIX2003"
)]
pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
pub fn getpwnam_r(
name: *const ::c_char,
pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd,
) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
pub fn getpwuid_r(
uid: ::uid_t,
pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd,
) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "sigwait$UNIX2003"
)]
pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
pub fn pthread_atfork(
prepare: ::Option<unsafe extern "C" fn()>,
parent: ::Option<unsafe extern "C" fn()>,
child: ::Option<unsafe extern "C" fn()>,
) -> ::c_int;
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "popen$UNIX2003"
)]
pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
pub fn faccessat(
dirfd: ::c_int,
pathname: *const ::c_char,
mode: ::c_int,
flags: ::c_int,
) -> ::c_int;
pub fn pthread_create(
native: *mut ::pthread_t,
attr: *const ::pthread_attr_t,
f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
value: *mut ::c_void,
) -> ::c_int;
pub fn acct(filename: *const ::c_char) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "wait4$UNIX2003"
)]
#[cfg_attr(
all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)),
link_name = "wait4@FBSD_1.0"
)]
pub fn wait4(
pid: ::pid_t,
status: *mut ::c_int,
options: ::c_int,
rusage: *mut ::rusage,
) -> ::pid_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "getitimer$UNIX2003"
)]
pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "setitimer$UNIX2003"
)]
pub fn setitimer(
which: ::c_int,
new_value: *const ::itimerval,
old_value: *mut ::itimerval,
) -> ::c_int;
pub fn regcomp(preg: *mut regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int;
pub fn regexec(
preg: *const regex_t,
input: *const ::c_char,
nmatch: ::size_t,
pmatch: *mut regmatch_t,
eflags: ::c_int,
) -> ::c_int;
pub fn regerror(
errcode: ::c_int,
preg: *const regex_t,
errbuf: *mut ::c_char,
errbuf_size: ::size_t,
) -> ::size_t;
pub fn regfree(preg: *mut regex_t);
pub fn arc4random() -> u32;
pub fn arc4random_buf(buf: *mut ::c_void, size: ::size_t);
pub fn arc4random_uniform(l: u32) -> u32;
pub fn drand48() -> ::c_double;
pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double;
pub fn lrand48() -> ::c_long;
pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long;
pub fn mrand48() -> ::c_long;
pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long;
pub fn srand48(seed: ::c_long);
pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
pub fn lcong48(p: *mut ::c_ushort);
pub fn getopt_long(
argc: ::c_int,
argv: *const *mut c_char,
optstring: *const c_char,
longopts: *const option,
longindex: *mut ::c_int,
) -> ::c_int;
pub fn strftime(
buf: *mut ::c_char,
maxsize: ::size_t,
format: *const ::c_char,
timeptr: *const ::tm,
) -> ::size_t;
pub fn strftime_l(
buf: *mut ::c_char,
maxsize: ::size_t,
format: *const ::c_char,
timeptr: *const ::tm,
locale: ::locale_t,
) -> ::size_t;
}
cfg_if! {
if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))] {
mod apple;
pub use self::apple::*;
} else if #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] {
mod netbsdlike;
pub use self::netbsdlike::*;
} else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] {
mod freebsdlike;
pub use self::freebsdlike::*;
} else {
// Unknown target_os
}
}

View file

@ -0,0 +1,882 @@
pub type wchar_t = i32;
pub type time_t = i64;
pub type mode_t = u32;
pub type nlink_t = u32;
pub type ino_t = u64;
pub type pthread_key_t = ::c_int;
pub type rlim_t = u64;
pub type speed_t = ::c_uint;
pub type tcflag_t = ::c_uint;
pub type nl_item = c_long;
pub type clockid_t = ::c_int;
pub type id_t = u32;
pub type sem_t = *mut sem;
pub type key_t = c_long;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
impl ::Copy for timezone {}
impl ::Clone for timezone {
fn clone(&self) -> timezone {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum sem {}
impl ::Copy for sem {}
impl ::Clone for sem {
fn clone(&self) -> sem {
*self
}
}
s! {
pub struct sched_param {
pub sched_priority: ::c_int,
}
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_size: ::size_t,
pub ss_flags: ::c_int,
}
pub struct in6_pktinfo {
pub ipi6_addr: ::in6_addr,
pub ipi6_ifindex: ::c_uint,
}
pub struct termios {
pub c_iflag: ::tcflag_t,
pub c_oflag: ::tcflag_t,
pub c_cflag: ::tcflag_t,
pub c_lflag: ::tcflag_t,
pub c_cc: [::cc_t; ::NCCS],
pub c_ispeed: ::c_int,
pub c_ospeed: ::c_int,
}
pub struct flock {
pub l_start: ::off_t,
pub l_len: ::off_t,
pub l_pid: ::pid_t,
pub l_type: ::c_short,
pub l_whence: ::c_short,
}
pub struct ipc_perm {
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub mode: ::mode_t,
#[cfg(target_os = "openbsd")]
pub seq: ::c_ushort,
#[cfg(target_os = "netbsd")]
pub _seq: ::c_ushort,
#[cfg(target_os = "openbsd")]
pub key: ::key_t,
#[cfg(target_os = "netbsd")]
pub _key: ::key_t,
}
pub struct ptrace_io_desc {
pub piod_op: ::c_int,
pub piod_offs: *mut ::c_void,
pub piod_addr: *mut ::c_void,
pub piod_len: ::size_t,
}
pub struct mmsghdr {
pub msg_hdr: ::msghdr,
pub msg_len: ::c_uint,
}
}
pub const D_T_FMT: ::nl_item = 0;
pub const D_FMT: ::nl_item = 1;
pub const T_FMT: ::nl_item = 2;
pub const T_FMT_AMPM: ::nl_item = 3;
pub const AM_STR: ::nl_item = 4;
pub const PM_STR: ::nl_item = 5;
pub const DAY_1: ::nl_item = 6;
pub const DAY_2: ::nl_item = 7;
pub const DAY_3: ::nl_item = 8;
pub const DAY_4: ::nl_item = 9;
pub const DAY_5: ::nl_item = 10;
pub const DAY_6: ::nl_item = 11;
pub const DAY_7: ::nl_item = 12;
pub const ABDAY_1: ::nl_item = 13;
pub const ABDAY_2: ::nl_item = 14;
pub const ABDAY_3: ::nl_item = 15;
pub const ABDAY_4: ::nl_item = 16;
pub const ABDAY_5: ::nl_item = 17;
pub const ABDAY_6: ::nl_item = 18;
pub const ABDAY_7: ::nl_item = 19;
pub const MON_1: ::nl_item = 20;
pub const MON_2: ::nl_item = 21;
pub const MON_3: ::nl_item = 22;
pub const MON_4: ::nl_item = 23;
pub const MON_5: ::nl_item = 24;
pub const MON_6: ::nl_item = 25;
pub const MON_7: ::nl_item = 26;
pub const MON_8: ::nl_item = 27;
pub const MON_9: ::nl_item = 28;
pub const MON_10: ::nl_item = 29;
pub const MON_11: ::nl_item = 30;
pub const MON_12: ::nl_item = 31;
pub const ABMON_1: ::nl_item = 32;
pub const ABMON_2: ::nl_item = 33;
pub const ABMON_3: ::nl_item = 34;
pub const ABMON_4: ::nl_item = 35;
pub const ABMON_5: ::nl_item = 36;
pub const ABMON_6: ::nl_item = 37;
pub const ABMON_7: ::nl_item = 38;
pub const ABMON_8: ::nl_item = 39;
pub const ABMON_9: ::nl_item = 40;
pub const ABMON_10: ::nl_item = 41;
pub const ABMON_11: ::nl_item = 42;
pub const ABMON_12: ::nl_item = 43;
pub const RADIXCHAR: ::nl_item = 44;
pub const THOUSEP: ::nl_item = 45;
pub const YESSTR: ::nl_item = 46;
pub const YESEXPR: ::nl_item = 47;
pub const NOSTR: ::nl_item = 48;
pub const NOEXPR: ::nl_item = 49;
pub const CRNCYSTR: ::nl_item = 50;
pub const CODESET: ::nl_item = 51;
pub const EXIT_FAILURE: ::c_int = 1;
pub const EXIT_SUCCESS: ::c_int = 0;
pub const RAND_MAX: ::c_int = 2147483647;
pub const EOF: ::c_int = -1;
pub const SEEK_SET: ::c_int = 0;
pub const SEEK_CUR: ::c_int = 1;
pub const SEEK_END: ::c_int = 2;
pub const _IOFBF: ::c_int = 0;
pub const _IONBF: ::c_int = 2;
pub const _IOLBF: ::c_int = 1;
pub const BUFSIZ: ::c_uint = 1024;
pub const FOPEN_MAX: ::c_uint = 20;
pub const FILENAME_MAX: ::c_uint = 1024;
pub const L_tmpnam: ::c_uint = 1024;
pub const O_NOCTTY: ::c_int = 32768;
pub const S_IFIFO: mode_t = 4096;
pub const S_IFCHR: mode_t = 8192;
pub const S_IFBLK: mode_t = 24576;
pub const S_IFDIR: mode_t = 16384;
pub const S_IFREG: mode_t = 32768;
pub const S_IFLNK: mode_t = 40960;
pub const S_IFSOCK: mode_t = 49152;
pub const S_IFMT: mode_t = 61440;
pub const S_IEXEC: mode_t = 64;
pub const S_IWRITE: mode_t = 128;
pub const S_IREAD: mode_t = 256;
pub const S_IRWXU: mode_t = 448;
pub const S_IXUSR: mode_t = 64;
pub const S_IWUSR: mode_t = 128;
pub const S_IRUSR: mode_t = 256;
pub const S_IRWXG: mode_t = 56;
pub const S_IXGRP: mode_t = 8;
pub const S_IWGRP: mode_t = 16;
pub const S_IRGRP: mode_t = 32;
pub const S_IRWXO: mode_t = 7;
pub const S_IXOTH: mode_t = 1;
pub const S_IWOTH: mode_t = 2;
pub const S_IROTH: mode_t = 4;
pub const F_OK: ::c_int = 0;
pub const R_OK: ::c_int = 4;
pub const W_OK: ::c_int = 2;
pub const X_OK: ::c_int = 1;
pub const STDIN_FILENO: ::c_int = 0;
pub const STDOUT_FILENO: ::c_int = 1;
pub const STDERR_FILENO: ::c_int = 2;
pub const F_LOCK: ::c_int = 1;
pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
pub const F_GETLK: ::c_int = 7;
pub const F_SETLK: ::c_int = 8;
pub const F_SETLKW: ::c_int = 9;
pub const SIGHUP: ::c_int = 1;
pub const SIGINT: ::c_int = 2;
pub const SIGQUIT: ::c_int = 3;
pub const SIGILL: ::c_int = 4;
pub const SIGABRT: ::c_int = 6;
pub const SIGEMT: ::c_int = 7;
pub const SIGFPE: ::c_int = 8;
pub const SIGKILL: ::c_int = 9;
pub const SIGSEGV: ::c_int = 11;
pub const SIGPIPE: ::c_int = 13;
pub const SIGALRM: ::c_int = 14;
pub const SIGTERM: ::c_int = 15;
pub const PROT_NONE: ::c_int = 0;
pub const PROT_READ: ::c_int = 1;
pub const PROT_WRITE: ::c_int = 2;
pub const PROT_EXEC: ::c_int = 4;
pub const MAP_FILE: ::c_int = 0x0000;
pub const MAP_SHARED: ::c_int = 0x0001;
pub const MAP_PRIVATE: ::c_int = 0x0002;
pub const MAP_FIXED: ::c_int = 0x0010;
pub const MAP_ANON: ::c_int = 0x1000;
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
pub const IPC_CREAT: ::c_int = 0o001000;
pub const IPC_EXCL: ::c_int = 0o002000;
pub const IPC_NOWAIT: ::c_int = 0o004000;
pub const IPC_PRIVATE: ::key_t = 0;
pub const IPC_RMID: ::c_int = 0;
pub const IPC_SET: ::c_int = 1;
pub const IPC_STAT: ::c_int = 2;
pub const IPC_R: ::c_int = 0o000400;
pub const IPC_W: ::c_int = 0o000200;
pub const IPC_M: ::c_int = 0o010000;
pub const SHM_R: ::c_int = IPC_R;
pub const SHM_W: ::c_int = IPC_W;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const MS_ASYNC: ::c_int = 0x0001;
pub const EPERM: ::c_int = 1;
pub const ENOENT: ::c_int = 2;
pub const ESRCH: ::c_int = 3;
pub const EINTR: ::c_int = 4;
pub const EIO: ::c_int = 5;
pub const ENXIO: ::c_int = 6;
pub const E2BIG: ::c_int = 7;
pub const ENOEXEC: ::c_int = 8;
pub const EBADF: ::c_int = 9;
pub const ECHILD: ::c_int = 10;
pub const EDEADLK: ::c_int = 11;
pub const ENOMEM: ::c_int = 12;
pub const EACCES: ::c_int = 13;
pub const EFAULT: ::c_int = 14;
pub const ENOTBLK: ::c_int = 15;
pub const EBUSY: ::c_int = 16;
pub const EEXIST: ::c_int = 17;
pub const EXDEV: ::c_int = 18;
pub const ENODEV: ::c_int = 19;
pub const ENOTDIR: ::c_int = 20;
pub const EISDIR: ::c_int = 21;
pub const EINVAL: ::c_int = 22;
pub const ENFILE: ::c_int = 23;
pub const EMFILE: ::c_int = 24;
pub const ENOTTY: ::c_int = 25;
pub const ETXTBSY: ::c_int = 26;
pub const EFBIG: ::c_int = 27;
pub const ENOSPC: ::c_int = 28;
pub const ESPIPE: ::c_int = 29;
pub const EROFS: ::c_int = 30;
pub const EMLINK: ::c_int = 31;
pub const EPIPE: ::c_int = 32;
pub const EDOM: ::c_int = 33;
pub const ERANGE: ::c_int = 34;
pub const EAGAIN: ::c_int = 35;
pub const EWOULDBLOCK: ::c_int = 35;
pub const EINPROGRESS: ::c_int = 36;
pub const EALREADY: ::c_int = 37;
pub const ENOTSOCK: ::c_int = 38;
pub const EDESTADDRREQ: ::c_int = 39;
pub const EMSGSIZE: ::c_int = 40;
pub const EPROTOTYPE: ::c_int = 41;
pub const ENOPROTOOPT: ::c_int = 42;
pub const EPROTONOSUPPORT: ::c_int = 43;
pub const ESOCKTNOSUPPORT: ::c_int = 44;
pub const EOPNOTSUPP: ::c_int = 45;
pub const EPFNOSUPPORT: ::c_int = 46;
pub const EAFNOSUPPORT: ::c_int = 47;
pub const EADDRINUSE: ::c_int = 48;
pub const EADDRNOTAVAIL: ::c_int = 49;
pub const ENETDOWN: ::c_int = 50;
pub const ENETUNREACH: ::c_int = 51;
pub const ENETRESET: ::c_int = 52;
pub const ECONNABORTED: ::c_int = 53;
pub const ECONNRESET: ::c_int = 54;
pub const ENOBUFS: ::c_int = 55;
pub const EISCONN: ::c_int = 56;
pub const ENOTCONN: ::c_int = 57;
pub const ESHUTDOWN: ::c_int = 58;
pub const ETOOMANYREFS: ::c_int = 59;
pub const ETIMEDOUT: ::c_int = 60;
pub const ECONNREFUSED: ::c_int = 61;
pub const ELOOP: ::c_int = 62;
pub const ENAMETOOLONG: ::c_int = 63;
pub const EHOSTDOWN: ::c_int = 64;
pub const EHOSTUNREACH: ::c_int = 65;
pub const ENOTEMPTY: ::c_int = 66;
pub const EPROCLIM: ::c_int = 67;
pub const EUSERS: ::c_int = 68;
pub const EDQUOT: ::c_int = 69;
pub const ESTALE: ::c_int = 70;
pub const EREMOTE: ::c_int = 71;
pub const EBADRPC: ::c_int = 72;
pub const ERPCMISMATCH: ::c_int = 73;
pub const EPROGUNAVAIL: ::c_int = 74;
pub const EPROGMISMATCH: ::c_int = 75;
pub const EPROCUNAVAIL: ::c_int = 76;
pub const ENOLCK: ::c_int = 77;
pub const ENOSYS: ::c_int = 78;
pub const EFTYPE: ::c_int = 79;
pub const EAUTH: ::c_int = 80;
pub const ENEEDAUTH: ::c_int = 81;
pub const F_DUPFD: ::c_int = 0;
pub const F_GETFD: ::c_int = 1;
pub const F_SETFD: ::c_int = 2;
pub const F_GETFL: ::c_int = 3;
pub const F_SETFL: ::c_int = 4;
pub const SIGTRAP: ::c_int = 5;
pub const GLOB_APPEND: ::c_int = 0x0001;
pub const GLOB_DOOFFS: ::c_int = 0x0002;
pub const GLOB_ERR: ::c_int = 0x0004;
pub const GLOB_MARK: ::c_int = 0x0008;
pub const GLOB_NOCHECK: ::c_int = 0x0010;
pub const GLOB_NOSORT: ::c_int = 0x0020;
pub const GLOB_NOESCAPE: ::c_int = 0x1000;
pub const GLOB_NOSPACE: ::c_int = -1;
pub const GLOB_ABORTED: ::c_int = -2;
pub const GLOB_NOMATCH: ::c_int = -3;
pub const GLOB_NOSYS: ::c_int = -4;
pub const POSIX_MADV_NORMAL: ::c_int = 0;
pub const POSIX_MADV_RANDOM: ::c_int = 1;
pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_MADV_WILLNEED: ::c_int = 3;
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04;
pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08;
pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
pub const PIOD_READ_D: ::c_int = 1;
pub const PIOD_WRITE_D: ::c_int = 2;
pub const PIOD_READ_I: ::c_int = 3;
pub const PIOD_WRITE_I: ::c_int = 4;
pub const PIOD_READ_AUXV: ::c_int = 5;
pub const PT_TRACE_ME: ::c_int = 0;
pub const PT_READ_I: ::c_int = 1;
pub const PT_READ_D: ::c_int = 2;
pub const PT_WRITE_I: ::c_int = 4;
pub const PT_WRITE_D: ::c_int = 5;
pub const PT_CONTINUE: ::c_int = 7;
pub const PT_KILL: ::c_int = 8;
pub const PT_ATTACH: ::c_int = 9;
pub const PT_DETACH: ::c_int = 10;
pub const PT_IO: ::c_int = 11;
// http://man.openbsd.org/OpenBSD-current/man2/clock_getres.2
// The man page says clock_gettime(3) can accept various values as clockid_t but
// http://fxr.watson.org/fxr/source/kern/kern_time.c?v=OPENBSD;im=excerpts#L161
// the implementation rejects anything other than the below two
//
// http://netbsd.gw.com/cgi-bin/man-cgi?clock_gettime
// https://github.com/jsonn/src/blob/HEAD/sys/kern/subr_time.c#L222
// Basically the same goes for NetBSD
pub const CLOCK_REALTIME: ::clockid_t = 0;
pub const CLOCK_MONOTONIC: ::clockid_t = 3;
pub const RLIMIT_CPU: ::c_int = 0;
pub const RLIMIT_FSIZE: ::c_int = 1;
pub const RLIMIT_DATA: ::c_int = 2;
pub const RLIMIT_STACK: ::c_int = 3;
pub const RLIMIT_CORE: ::c_int = 4;
pub const RLIMIT_RSS: ::c_int = 5;
pub const RLIMIT_MEMLOCK: ::c_int = 6;
pub const RLIMIT_NPROC: ::c_int = 7;
pub const RLIMIT_NOFILE: ::c_int = 8;
pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
pub const RLIM_SAVED_MAX: rlim_t = RLIM_INFINITY;
pub const RLIM_SAVED_CUR: rlim_t = RLIM_INFINITY;
pub const RUSAGE_SELF: ::c_int = 0;
pub const RUSAGE_CHILDREN: ::c_int = -1;
pub const MADV_NORMAL: ::c_int = 0;
pub const MADV_RANDOM: ::c_int = 1;
pub const MADV_SEQUENTIAL: ::c_int = 2;
pub const MADV_WILLNEED: ::c_int = 3;
pub const MADV_DONTNEED: ::c_int = 4;
pub const MADV_FREE: ::c_int = 6;
// sys/fstypes.h in NetBSD, or sys/mount.h in OpenBSD
pub const MNT_NODEV: ::c_int = 0x00000010;
pub const MNT_LOCAL: ::c_int = 0x00001000;
pub const MNT_QUOTA: ::c_int = 0x00002000;
pub const AF_UNSPEC: ::c_int = 0;
pub const AF_LOCAL: ::c_int = 1;
pub const AF_UNIX: ::c_int = AF_LOCAL;
pub const AF_INET: ::c_int = 2;
pub const AF_IMPLINK: ::c_int = 3;
pub const AF_PUP: ::c_int = 4;
pub const AF_CHAOS: ::c_int = 5;
pub const AF_NS: ::c_int = 6;
pub const AF_ISO: ::c_int = 7;
pub const AF_OSI: ::c_int = AF_ISO;
pub const AF_DATAKIT: ::c_int = 9;
pub const AF_CCITT: ::c_int = 10;
pub const AF_SNA: ::c_int = 11;
pub const AF_DECnet: ::c_int = 12;
pub const AF_DLI: ::c_int = 13;
pub const AF_LAT: ::c_int = 14;
pub const AF_HYLINK: ::c_int = 15;
pub const AF_APPLETALK: ::c_int = 16;
pub const AF_LINK: ::c_int = 18;
pub const pseudo_AF_XTP: ::c_int = 19;
pub const AF_COIP: ::c_int = 20;
pub const AF_CNT: ::c_int = 21;
pub const pseudo_AF_RTIP: ::c_int = 22;
pub const AF_IPX: ::c_int = 23;
pub const AF_INET6: ::c_int = 24;
pub const pseudo_AF_PIP: ::c_int = 25;
pub const AF_ISDN: ::c_int = 26;
pub const AF_E164: ::c_int = AF_ISDN;
pub const AF_NATM: ::c_int = 27;
pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
pub const PF_LOCAL: ::c_int = AF_LOCAL;
pub const PF_UNIX: ::c_int = PF_LOCAL;
pub const PF_INET: ::c_int = AF_INET;
pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
pub const PF_PUP: ::c_int = AF_PUP;
pub const PF_CHAOS: ::c_int = AF_CHAOS;
pub const PF_NS: ::c_int = AF_NS;
pub const PF_ISO: ::c_int = AF_ISO;
pub const PF_OSI: ::c_int = AF_ISO;
pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
pub const PF_CCITT: ::c_int = AF_CCITT;
pub const PF_SNA: ::c_int = AF_SNA;
pub const PF_DECnet: ::c_int = AF_DECnet;
pub const PF_DLI: ::c_int = AF_DLI;
pub const PF_LAT: ::c_int = AF_LAT;
pub const PF_HYLINK: ::c_int = AF_HYLINK;
pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
pub const PF_LINK: ::c_int = AF_LINK;
pub const PF_XTP: ::c_int = pseudo_AF_XTP;
pub const PF_COIP: ::c_int = AF_COIP;
pub const PF_CNT: ::c_int = AF_CNT;
pub const PF_IPX: ::c_int = AF_IPX;
pub const PF_INET6: ::c_int = AF_INET6;
pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
pub const PF_PIP: ::c_int = pseudo_AF_PIP;
pub const PF_ISDN: ::c_int = AF_ISDN;
pub const PF_NATM: ::c_int = AF_NATM;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_RAW: ::c_int = 3;
pub const SOCK_RDM: ::c_int = 4;
pub const SOCK_SEQPACKET: ::c_int = 5;
pub const IP_TTL: ::c_int = 4;
pub const IP_HDRINCL: ::c_int = 2;
pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
pub const IPV6_RECVPKTINFO: ::c_int = 36;
pub const IPV6_PKTINFO: ::c_int = 46;
pub const IPV6_RECVTCLASS: ::c_int = 57;
pub const IPV6_TCLASS: ::c_int = 61;
pub const SOL_SOCKET: ::c_int = 0xffff;
pub const SO_DEBUG: ::c_int = 0x01;
pub const SO_ACCEPTCONN: ::c_int = 0x0002;
pub const SO_REUSEADDR: ::c_int = 0x0004;
pub const SO_KEEPALIVE: ::c_int = 0x0008;
pub const SO_DONTROUTE: ::c_int = 0x0010;
pub const SO_BROADCAST: ::c_int = 0x0020;
pub const SO_USELOOPBACK: ::c_int = 0x0040;
pub const SO_LINGER: ::c_int = 0x0080;
pub const SO_OOBINLINE: ::c_int = 0x0100;
pub const SO_REUSEPORT: ::c_int = 0x0200;
pub const SO_SNDBUF: ::c_int = 0x1001;
pub const SO_RCVBUF: ::c_int = 0x1002;
pub const SO_SNDLOWAT: ::c_int = 0x1003;
pub const SO_RCVLOWAT: ::c_int = 0x1004;
pub const SO_ERROR: ::c_int = 0x1007;
pub const SO_TYPE: ::c_int = 0x1008;
pub const SOMAXCONN: ::c_int = 128;
pub const MSG_OOB: ::c_int = 0x1;
pub const MSG_PEEK: ::c_int = 0x2;
pub const MSG_DONTROUTE: ::c_int = 0x4;
pub const MSG_EOR: ::c_int = 0x8;
pub const MSG_TRUNC: ::c_int = 0x10;
pub const MSG_CTRUNC: ::c_int = 0x20;
pub const MSG_WAITALL: ::c_int = 0x40;
pub const MSG_DONTWAIT: ::c_int = 0x80;
pub const MSG_BCAST: ::c_int = 0x100;
pub const MSG_MCAST: ::c_int = 0x200;
pub const MSG_NOSIGNAL: ::c_int = 0x400;
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x800;
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
pub const LOCK_SH: ::c_int = 1;
pub const LOCK_EX: ::c_int = 2;
pub const LOCK_NB: ::c_int = 4;
pub const LOCK_UN: ::c_int = 8;
pub const IPPROTO_RAW: ::c_int = 255;
pub const _SC_ARG_MAX: ::c_int = 1;
pub const _SC_CHILD_MAX: ::c_int = 2;
pub const _SC_NGROUPS_MAX: ::c_int = 4;
pub const _SC_OPEN_MAX: ::c_int = 5;
pub const _SC_JOB_CONTROL: ::c_int = 6;
pub const _SC_SAVED_IDS: ::c_int = 7;
pub const _SC_VERSION: ::c_int = 8;
pub const _SC_BC_BASE_MAX: ::c_int = 9;
pub const _SC_BC_DIM_MAX: ::c_int = 10;
pub const _SC_BC_SCALE_MAX: ::c_int = 11;
pub const _SC_BC_STRING_MAX: ::c_int = 12;
pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
pub const _SC_LINE_MAX: ::c_int = 15;
pub const _SC_RE_DUP_MAX: ::c_int = 16;
pub const _SC_2_VERSION: ::c_int = 17;
pub const _SC_2_C_BIND: ::c_int = 18;
pub const _SC_2_C_DEV: ::c_int = 19;
pub const _SC_2_CHAR_TERM: ::c_int = 20;
pub const _SC_2_FORT_DEV: ::c_int = 21;
pub const _SC_2_FORT_RUN: ::c_int = 22;
pub const _SC_2_LOCALEDEF: ::c_int = 23;
pub const _SC_2_SW_DEV: ::c_int = 24;
pub const _SC_2_UPE: ::c_int = 25;
pub const _SC_STREAM_MAX: ::c_int = 26;
pub const _SC_TZNAME_MAX: ::c_int = 27;
pub const _SC_PAGESIZE: ::c_int = 28;
pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
pub const _SC_FSYNC: ::c_int = 29;
pub const _SC_XOPEN_SHM: ::c_int = 30;
pub const Q_GETQUOTA: ::c_int = 0x300;
pub const Q_SETQUOTA: ::c_int = 0x400;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const LOG_NFACILITIES: ::c_int = 24;
pub const HW_NCPU: ::c_int = 3;
pub const B0: speed_t = 0;
pub const B50: speed_t = 50;
pub const B75: speed_t = 75;
pub const B110: speed_t = 110;
pub const B134: speed_t = 134;
pub const B150: speed_t = 150;
pub const B200: speed_t = 200;
pub const B300: speed_t = 300;
pub const B600: speed_t = 600;
pub const B1200: speed_t = 1200;
pub const B1800: speed_t = 1800;
pub const B2400: speed_t = 2400;
pub const B4800: speed_t = 4800;
pub const B9600: speed_t = 9600;
pub const B19200: speed_t = 19200;
pub const B38400: speed_t = 38400;
pub const B7200: speed_t = 7200;
pub const B14400: speed_t = 14400;
pub const B28800: speed_t = 28800;
pub const B57600: speed_t = 57600;
pub const B76800: speed_t = 76800;
pub const B115200: speed_t = 115200;
pub const B230400: speed_t = 230400;
pub const EXTA: speed_t = 19200;
pub const EXTB: speed_t = 38400;
pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
pub const CRTSCTS: ::tcflag_t = 0x00010000;
pub const CRTS_IFLOW: ::tcflag_t = CRTSCTS;
pub const CCTS_OFLOW: ::tcflag_t = CRTSCTS;
pub const OCRNL: ::tcflag_t = 0x10;
pub const TIOCEXCL: ::c_ulong = 0x2000740d;
pub const TIOCNXCL: ::c_ulong = 0x2000740e;
pub const TIOCFLUSH: ::c_ulong = 0x80047410;
pub const TIOCGETA: ::c_ulong = 0x402c7413;
pub const TIOCSETA: ::c_ulong = 0x802c7414;
pub const TIOCSETAW: ::c_ulong = 0x802c7415;
pub const TIOCSETAF: ::c_ulong = 0x802c7416;
pub const TIOCGETD: ::c_ulong = 0x4004741a;
pub const TIOCSETD: ::c_ulong = 0x8004741b;
pub const TIOCMGET: ::c_ulong = 0x4004746a;
pub const TIOCMBIC: ::c_ulong = 0x8004746b;
pub const TIOCMBIS: ::c_ulong = 0x8004746c;
pub const TIOCMSET: ::c_ulong = 0x8004746d;
pub const TIOCSTART: ::c_ulong = 0x2000746e;
pub const TIOCSTOP: ::c_ulong = 0x2000746f;
pub const TIOCSCTTY: ::c_ulong = 0x20007461;
pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
pub const TIOCM_LE: ::c_int = 0o0001;
pub const TIOCM_DTR: ::c_int = 0o0002;
pub const TIOCM_RTS: ::c_int = 0o0004;
pub const TIOCM_ST: ::c_int = 0o0010;
pub const TIOCM_SR: ::c_int = 0o0020;
pub const TIOCM_CTS: ::c_int = 0o0040;
pub const TIOCM_CAR: ::c_int = 0o0100;
pub const TIOCM_RNG: ::c_int = 0o0200;
pub const TIOCM_DSR: ::c_int = 0o0400;
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
pub const TIMER_ABSTIME: ::c_int = 1;
// sys/reboot.h
pub const RB_AUTOBOOT: ::c_int = 0;
pub const TCP_INFO: ::c_int = 9;
#[link(name = "util")]
extern "C" {
pub fn setgrent();
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
pub fn accept4(
s: ::c_int,
addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t,
flags: ::c_int,
) -> ::c_int;
pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__clock_getres50")]
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")]
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__clock_settime50")]
pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
pub fn __errno() -> *mut ::c_int;
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
-> ::ssize_t;
pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
pub fn utimensat(
dirfd: ::c_int,
path: *const ::c_char,
times: *const ::timespec,
flag: ::c_int,
) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
pub fn login_tty(fd: ::c_int) -> ::c_int;
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
pub fn mknodat(
dirfd: ::c_int,
pathname: *const ::c_char,
mode: ::mode_t,
dev: dev_t,
) -> ::c_int;
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
pub fn pthread_condattr_setclock(
attr: *mut pthread_condattr_t,
clock_id: ::clockid_t,
) -> ::c_int;
pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
pub fn pthread_mutex_timedlock(
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_setschedparam(
native: ::pthread_t,
policy: ::c_int,
param: *const sched_param,
) -> ::c_int;
pub fn pthread_getschedparam(
native: ::pthread_t,
policy: *mut ::c_int,
param: *mut sched_param,
) -> ::c_int;
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
pub fn getgrouplist(
name: *const ::c_char,
basegid: ::gid_t,
groups: *mut ::gid_t,
ngroups: *mut ::c_int,
) -> ::c_int;
pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
pub fn execvpe(
file: *const ::c_char,
argv: *const *const ::c_char,
envp: *const *const ::c_char,
) -> ::c_int;
pub fn waitid(
idtype: idtype_t,
id: ::id_t,
infop: *mut ::siginfo_t,
options: ::c_int,
) -> ::c_int;
pub fn 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_int;
pub fn 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_int;
pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
pub fn posix_spawnattr_getsigdefault(
attr: *const posix_spawnattr_t,
default: *mut ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_setsigdefault(
attr: *mut posix_spawnattr_t,
default: *const ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_getsigmask(
attr: *const posix_spawnattr_t,
default: *mut ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_setsigmask(
attr: *mut posix_spawnattr_t,
default: *const ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_getflags(
attr: *const posix_spawnattr_t,
flags: *mut ::c_short,
) -> ::c_int;
pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
pub fn posix_spawnattr_getpgroup(
attr: *const posix_spawnattr_t,
flags: *mut ::pid_t,
) -> ::c_int;
pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
pub fn posix_spawnattr_getschedpolicy(
attr: *const posix_spawnattr_t,
flags: *mut ::c_int,
) -> ::c_int;
pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
pub fn posix_spawnattr_getschedparam(
attr: *const posix_spawnattr_t,
param: *mut ::sched_param,
) -> ::c_int;
pub fn posix_spawnattr_setschedparam(
attr: *mut posix_spawnattr_t,
param: *const ::sched_param,
) -> ::c_int;
pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
pub fn 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_int;
pub fn posix_spawn_file_actions_addclose(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
) -> ::c_int;
pub fn posix_spawn_file_actions_adddup2(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
newfd: ::c_int,
) -> ::c_int;
}
extern "C" {
pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
pub fn gethostid() -> ::c_long;
pub fn sethostid(hostid: ::c_long) -> ::c_int;
pub fn ftok(path: *const ::c_char, id: ::c_int) -> ::key_t;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
pub fn sendmmsg(
sockfd: ::c_int,
mmsg: *mut ::mmsghdr,
vlen: ::c_uint,
flags: ::c_int,
) -> ::c_int;
pub fn recvmmsg(
sockfd: ::c_int,
mmsg: *mut ::mmsghdr,
vlen: ::c_uint,
flags: ::c_int,
timeout: *mut ::timespec,
) -> ::c_int;
}
cfg_if! {
if #[cfg(target_os = "netbsd")] {
mod netbsd;
pub use self::netbsd::*;
} else if #[cfg(target_os = "openbsd")] {
mod openbsd;
pub use self::openbsd::*;
} else {
// Unknown target_os
}
}

View file

@ -0,0 +1,162 @@
use PT_FIRSTMACH;
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;
pub type greg_t = u64;
pub type __cpu_simple_lock_nv_t = ::c_uchar;
s! {
pub struct __fregset {
#[cfg(libc_union)]
pub __qregs: [__c_anonymous__freg; 32],
pub __fpcr: u32,
pub __fpsr: u32,
}
pub struct mcontext_t {
pub __gregs: [::greg_t; 32],
pub __fregs: __fregset,
__spare: [::greg_t; 8],
}
pub struct ucontext_t {
pub uc_flags: ::c_uint,
pub uc_link: *mut ucontext_t,
pub uc_sigmask: ::sigset_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: mcontext_t,
}
}
s_no_extra_traits! {
#[cfg(libc_union)]
#[repr(align(16))]
pub union __c_anonymous__freg {
pub __b8: [u8; 16],
pub __h16: [u16; 8],
pub __s32: [u32; 4],
pub __d64: [u64; 2],
pub __q128: [u128; 1],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
#[cfg(libc_union)]
impl PartialEq for __c_anonymous__freg {
fn eq(&self, other: &__c_anonymous__freg) -> bool {
unsafe {
self.__b8 == other.__b8
|| self.__h16 == other.__h16
|| self.__s32 == other.__s32
|| self.__d64 == other.__d64
|| self.__q128 == other.__q128
}
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous__freg {}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous__freg {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
unsafe {
f.debug_struct("__c_anonymous__freg")
.field("__b8", &self.__b8)
.field("__h16", &self.__h16)
.field("__s32", &self.__s32)
.field("__d64", &self.__d64)
.field("__q128", &self.__q128)
.finish()
}
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __c_anonymous__freg {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
unsafe {
self.__b8.hash(state);
self.__h16.hash(state);
self.__s32.hash(state);
self.__d64.hash(state);
self.__q128.hash(state);
}
}
}
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 4 - 1;
}
}
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;
pub const _REG_R0: ::c_int = 0;
pub const _REG_R1: ::c_int = 1;
pub const _REG_R2: ::c_int = 2;
pub const _REG_R3: ::c_int = 3;
pub const _REG_R4: ::c_int = 4;
pub const _REG_R5: ::c_int = 5;
pub const _REG_R6: ::c_int = 6;
pub const _REG_R7: ::c_int = 7;
pub const _REG_R8: ::c_int = 8;
pub const _REG_R9: ::c_int = 9;
pub const _REG_R10: ::c_int = 10;
pub const _REG_R11: ::c_int = 11;
pub const _REG_R12: ::c_int = 12;
pub const _REG_R13: ::c_int = 13;
pub const _REG_R14: ::c_int = 14;
pub const _REG_R15: ::c_int = 15;
pub const _REG_CPSR: ::c_int = 16;
pub const _REG_X0: ::c_int = 0;
pub const _REG_X1: ::c_int = 1;
pub const _REG_X2: ::c_int = 2;
pub const _REG_X3: ::c_int = 3;
pub const _REG_X4: ::c_int = 4;
pub const _REG_X5: ::c_int = 5;
pub const _REG_X6: ::c_int = 6;
pub const _REG_X7: ::c_int = 7;
pub const _REG_X8: ::c_int = 8;
pub const _REG_X9: ::c_int = 9;
pub const _REG_X10: ::c_int = 10;
pub const _REG_X11: ::c_int = 11;
pub const _REG_X12: ::c_int = 12;
pub const _REG_X13: ::c_int = 13;
pub const _REG_X14: ::c_int = 14;
pub const _REG_X15: ::c_int = 15;
pub const _REG_X16: ::c_int = 16;
pub const _REG_X17: ::c_int = 17;
pub const _REG_X18: ::c_int = 18;
pub const _REG_X19: ::c_int = 19;
pub const _REG_X20: ::c_int = 20;
pub const _REG_X21: ::c_int = 21;
pub const _REG_X22: ::c_int = 22;
pub const _REG_X23: ::c_int = 23;
pub const _REG_X24: ::c_int = 24;
pub const _REG_X25: ::c_int = 25;
pub const _REG_X26: ::c_int = 26;
pub const _REG_X27: ::c_int = 27;
pub const _REG_X28: ::c_int = 28;
pub const _REG_X29: ::c_int = 29;
pub const _REG_X30: ::c_int = 30;
pub const _REG_X31: ::c_int = 31;
pub const _REG_ELR: ::c_int = 32;
pub const _REG_SPSR: ::c_int = 33;
pub const _REG_TIPDR: ::c_int = 34;
pub const _REG_RV: ::c_int = _REG_X0;
pub const _REG_FP: ::c_int = _REG_X29;
pub const _REG_LR: ::c_int = _REG_X30;
pub const _REG_SP: ::c_int = _REG_X31;
pub const _REG_PC: ::c_int = _REG_ELR;

View file

@ -0,0 +1,81 @@
use PT_FIRSTMACH;
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = u8;
pub type __cpu_simple_lock_nv_t = ::c_int;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
pub const _REG_R0: ::c_int = 0;
pub const _REG_R1: ::c_int = 1;
pub const _REG_R2: ::c_int = 2;
pub const _REG_R3: ::c_int = 3;
pub const _REG_R4: ::c_int = 4;
pub const _REG_R5: ::c_int = 5;
pub const _REG_R6: ::c_int = 6;
pub const _REG_R7: ::c_int = 7;
pub const _REG_R8: ::c_int = 8;
pub const _REG_R9: ::c_int = 9;
pub const _REG_R10: ::c_int = 10;
pub const _REG_R11: ::c_int = 11;
pub const _REG_R12: ::c_int = 12;
pub const _REG_R13: ::c_int = 13;
pub const _REG_R14: ::c_int = 14;
pub const _REG_R15: ::c_int = 15;
pub const _REG_CPSR: ::c_int = 16;
pub const _REG_X0: ::c_int = 0;
pub const _REG_X1: ::c_int = 1;
pub const _REG_X2: ::c_int = 2;
pub const _REG_X3: ::c_int = 3;
pub const _REG_X4: ::c_int = 4;
pub const _REG_X5: ::c_int = 5;
pub const _REG_X6: ::c_int = 6;
pub const _REG_X7: ::c_int = 7;
pub const _REG_X8: ::c_int = 8;
pub const _REG_X9: ::c_int = 9;
pub const _REG_X10: ::c_int = 10;
pub const _REG_X11: ::c_int = 11;
pub const _REG_X12: ::c_int = 12;
pub const _REG_X13: ::c_int = 13;
pub const _REG_X14: ::c_int = 14;
pub const _REG_X15: ::c_int = 15;
pub const _REG_X16: ::c_int = 16;
pub const _REG_X17: ::c_int = 17;
pub const _REG_X18: ::c_int = 18;
pub const _REG_X19: ::c_int = 19;
pub const _REG_X20: ::c_int = 20;
pub const _REG_X21: ::c_int = 21;
pub const _REG_X22: ::c_int = 22;
pub const _REG_X23: ::c_int = 23;
pub const _REG_X24: ::c_int = 24;
pub const _REG_X25: ::c_int = 25;
pub const _REG_X26: ::c_int = 26;
pub const _REG_X27: ::c_int = 27;
pub const _REG_X28: ::c_int = 28;
pub const _REG_X29: ::c_int = 29;
pub const _REG_X30: ::c_int = 30;
pub const _REG_X31: ::c_int = 31;
pub const _REG_ELR: ::c_int = 32;
pub const _REG_SPSR: ::c_int = 33;
pub const _REG_TIPDR: ::c_int = 34;
pub const _REG_RV: ::c_int = _REG_R0;
pub const _REG_FP: ::c_int = _REG_R11;
pub const _REG_LR: ::c_int = _REG_R13;
pub const _REG_SP: ::c_int = _REG_R14;
pub const _REG_PC: ::c_int = _REG_R15;

View file

@ -0,0 +1,21 @@
use PT_FIRSTMACH;
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = i8;
pub type __cpu_simple_lock_nv_t = ::c_int;
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,21 @@
use PT_FIRSTMACH;
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = u8;
pub type __cpu_simple_lock_nv_t = ::c_int;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;

View file

@ -0,0 +1,21 @@
use PT_FIRSTMACH;
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;
pub type __cpu_simple_lock_nv_t = ::c_int;
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;

View file

@ -0,0 +1,8 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;
pub type __cpu_simple_lock_nv_t = ::c_uchar;
// should be pub(crate), but that requires Rust 1.18.0
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 0xf;

View file

@ -0,0 +1,15 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = i8;
pub type __cpu_simple_lock_nv_t = ::c_uchar;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 4 - 1;
}
}

View file

@ -0,0 +1,67 @@
use PT_FIRSTMACH;
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;
pub type c___greg_t = u64;
pub type __cpu_simple_lock_nv_t = ::c_uchar;
s! {
pub struct mcontext_t {
pub __gregs: [c___greg_t; 26],
pub _mc_tlsbase: c___greg_t,
pub __fpregs: [[::c_char;32]; 16],
}
pub struct ucontext_t {
pub uc_flags: ::c_uint,
pub uc_link: *mut ::ucontext_t,
pub uc_sigmask: ::sigset_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: ::mcontext_t,
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
pub const _REG_RDI: ::c_int = 0;
pub const _REG_RSI: ::c_int = 1;
pub const _REG_RDX: ::c_int = 2;
pub const _REG_RCX: ::c_int = 3;
pub const _REG_R8: ::c_int = 4;
pub const _REG_R9: ::c_int = 5;
pub const _REG_R10: ::c_int = 6;
pub const _REG_R11: ::c_int = 7;
pub const _REG_R12: ::c_int = 8;
pub const _REG_R13: ::c_int = 9;
pub const _REG_R14: ::c_int = 10;
pub const _REG_R15: ::c_int = 11;
pub const _REG_RBP: ::c_int = 12;
pub const _REG_RBX: ::c_int = 13;
pub const _REG_RAX: ::c_int = 14;
pub const _REG_GS: ::c_int = 15;
pub const _REG_FS: ::c_int = 16;
pub const _REG_ES: ::c_int = 17;
pub const _REG_DS: ::c_int = 18;
pub const _REG_TRAPNO: ::c_int = 19;
pub const _REG_ERR: ::c_int = 20;
pub const _REG_RIP: ::c_int = 21;
pub const _REG_CS: ::c_int = 22;
pub const _REG_RFLAGS: ::c_int = 23;
pub const _REG_RSP: ::c_int = 24;
pub const _REG_SS: ::c_int = 25;

View file

@ -0,0 +1,30 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;
pub type ucontext_t = sigcontext;
s! {
pub struct sigcontext {
__sc_unused: ::c_int,
pub sc_mask: ::c_int,
pub sc_sp: ::c_ulong,
pub sc_lr: ::c_ulong,
pub sc_elr: ::c_ulong,
pub sc_spsr: ::c_ulong,
pub sc_x: [::c_ulong; 30],
pub sc_cookie: ::c_long,
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const _MAX_PAGE_SHIFT: u32 = 12;

View file

@ -0,0 +1,16 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = u8;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const _MAX_PAGE_SHIFT: u32 = 12;

View file

@ -0,0 +1,8 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 7;
pub const _MAX_PAGE_SHIFT: u32 = 14;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,16 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = u8;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const _MAX_PAGE_SHIFT: u32 = 12;

View file

@ -0,0 +1,16 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const _MAX_PAGE_SHIFT: u32 = 12;

View file

@ -0,0 +1,35 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;
pub type ucontext_t = sigcontext;
s! {
pub struct sigcontext {
__sc_unused: ::c_int,
pub sc_mask: ::c_int,
pub sc_ra: ::c_long,
pub sc_sp: ::c_long,
pub sc_gp: ::c_long,
pub sc_tp: ::c_long,
pub sc_t: [::c_long; 7],
pub sc_s: [::c_long; 12],
pub sc_a: [::c_long; 8],
pub sc_sepc: ::c_long,
pub sc_f: [::c_long; 32],
pub sc_fcsr: ::c_long,
pub sc_cookie: ::c_long,
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const _MAX_PAGE_SHIFT: u32 = 12;

View file

@ -0,0 +1,8 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 0xf;
pub const _MAX_PAGE_SHIFT: u32 = 13;

View file

@ -0,0 +1,16 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = i8;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 4 - 1;
}
}
pub const _MAX_PAGE_SHIFT: u32 = 12;

View file

@ -0,0 +1,130 @@
use PT_FIRSTMACH;
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;
pub type ucontext_t = sigcontext;
s! {
pub struct sigcontext {
pub sc_rdi: ::c_long,
pub sc_rsi: ::c_long,
pub sc_rdx: ::c_long,
pub sc_rcx: ::c_long,
pub sc_r8: ::c_long,
pub sc_r9: ::c_long,
pub sc_r10: ::c_long,
pub sc_r11: ::c_long,
pub sc_r12: ::c_long,
pub sc_r13: ::c_long,
pub sc_r14: ::c_long,
pub sc_r15: ::c_long,
pub sc_rbp: ::c_long,
pub sc_rbx: ::c_long,
pub sc_rax: ::c_long,
pub sc_gs: ::c_long,
pub sc_fs: ::c_long,
pub sc_es: ::c_long,
pub sc_ds: ::c_long,
pub sc_trapno: ::c_long,
pub sc_err: ::c_long,
pub sc_rip: ::c_long,
pub sc_cs: ::c_long,
pub sc_rflags: ::c_long,
pub sc_rsp: ::c_long,
pub sc_ss: ::c_long,
pub sc_fpstate: *mut fxsave64,
__sc_unused: ::c_int,
pub sc_mask: ::c_int,
pub sc_cookie: ::c_long,
}
}
s_no_extra_traits! {
#[repr(packed)]
pub struct fxsave64 {
pub fx_fcw: u16,
pub fx_fsw: u16,
pub fx_ftw: u8,
__fx_unused1: u8,
pub fx_fop: u16,
pub fx_rip: u64,
pub fx_rdp: u64,
pub fx_mxcsr: u32,
pub fx_mxcsr_mask: u32,
pub fx_st: [[u64; 2]; 8],
pub fx_xmm: [[u64; 2]; 16],
__fx_unused3: [u8; 96],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
// `fxsave64` is packed, so field access is unaligned.
// use {x} to create temporary storage, copy field to it, and do aligned access.
impl PartialEq for fxsave64 {
fn eq(&self, other: &fxsave64) -> bool {
return {self.fx_fcw} == {other.fx_fcw} &&
{self.fx_fsw} == {other.fx_fsw} &&
{self.fx_ftw} == {other.fx_ftw} &&
{self.fx_fop} == {other.fx_fop} &&
{self.fx_rip} == {other.fx_rip} &&
{self.fx_rdp} == {other.fx_rdp} &&
{self.fx_mxcsr} == {other.fx_mxcsr} &&
{self.fx_mxcsr_mask} == {other.fx_mxcsr_mask} &&
{self.fx_st}.iter().zip({other.fx_st}.iter()).all(|(a,b)| a == b) &&
{self.fx_xmm}.iter().zip({other.fx_xmm}.iter()).all(|(a,b)| a == b)
}
}
impl Eq for fxsave64 {}
impl ::fmt::Debug for fxsave64 {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("fxsave64")
.field("fx_fcw", &{self.fx_fcw})
.field("fx_fsw", &{self.fx_fsw})
.field("fx_ftw", &{self.fx_ftw})
.field("fx_fop", &{self.fx_fop})
.field("fx_rip", &{self.fx_rip})
.field("fx_rdp", &{self.fx_rdp})
.field("fx_mxcsr", &{self.fx_mxcsr})
.field("fx_mxcsr_mask", &{self.fx_mxcsr_mask})
// FIXME: .field("fx_st", &{self.fx_st})
// FIXME: .field("fx_xmm", &{self.fx_xmm})
.finish()
}
}
impl ::hash::Hash for fxsave64 {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
{self.fx_fcw}.hash(state);
{self.fx_fsw}.hash(state);
{self.fx_ftw}.hash(state);
{self.fx_fop}.hash(state);
{self.fx_rip}.hash(state);
{self.fx_rdp}.hash(state);
{self.fx_mxcsr}.hash(state);
{self.fx_mxcsr_mask}.hash(state);
{self.fx_st}.hash(state);
{self.fx_xmm}.hash(state);
}
}
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const _MAX_PAGE_SHIFT: u32 = 12;
pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;

20
vendor/libc/src/unix/haiku/b32.rs vendored Normal file
View file

@ -0,0 +1,20 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type time_t = i32;
pub type Elf_Addr = ::Elf32_Addr;
pub type Elf_Half = ::Elf32_Half;
pub type Elf_Phdr = ::Elf32_Phdr;
s! {
pub struct Elf32_Phdr {
pub p_type: ::Elf32_Word,
pub p_offset: ::Elf32_Off,
pub p_vaddr: ::Elf32_Addr,
pub p_paddr: ::Elf32_Addr,
pub p_filesz: ::Elf32_Word,
pub p_memsz: ::Elf32_Word,
pub p_flags: ::Elf32_Word,
pub p_align: ::Elf32_Word,
}
}

20
vendor/libc/src/unix/haiku/b64.rs vendored Normal file
View file

@ -0,0 +1,20 @@
pub type c_ulong = u64;
pub type c_long = i64;
pub type time_t = i64;
pub type Elf_Addr = ::Elf64_Addr;
pub type Elf_Half = ::Elf64_Half;
pub type Elf_Phdr = ::Elf64_Phdr;
s! {
pub struct Elf64_Phdr {
pub p_type: ::Elf64_Word,
pub p_flags: ::Elf64_Word,
pub p_offset: ::Elf64_Off,
pub p_vaddr: ::Elf64_Addr,
pub p_paddr: ::Elf64_Addr,
pub p_filesz: ::Elf64_Xword,
pub p_memsz: ::Elf64_Xword,
pub p_align: ::Elf64_Xword,
}
}

2186
vendor/libc/src/unix/haiku/mod.rs vendored Normal file

File diff suppressed because it is too large Load diff

1489
vendor/libc/src/unix/haiku/native.rs vendored Normal file

File diff suppressed because it is too large Load diff

264
vendor/libc/src/unix/haiku/x86_64.rs vendored Normal file
View file

@ -0,0 +1,264 @@
s_no_extra_traits! {
pub struct fpu_state {
pub control: ::c_ushort,
pub status: ::c_ushort,
pub tag: ::c_ushort,
pub opcode: ::c_ushort,
pub rip: ::c_ulong,
pub rdp: ::c_ulong,
pub mxcsr: ::c_uint,
pub mscsr_mask: ::c_uint,
pub _fpreg: [[::c_uchar; 8]; 16],
pub _xmm: [[::c_uchar; 16]; 16],
pub _reserved_416_511: [::c_uchar; 96],
}
pub struct xstate_hdr {
pub bv: ::c_ulong,
pub xcomp_bv: ::c_ulong,
pub _reserved: [::c_uchar; 48],
}
pub struct savefpu {
pub fp_fxsave: fpu_state,
pub fp_xstate: xstate_hdr,
pub _fp_ymm: [[::c_uchar; 16]; 16],
}
pub struct mcontext_t {
pub rax: ::c_ulong,
pub rbx: ::c_ulong,
pub rcx: ::c_ulong,
pub rdx: ::c_ulong,
pub rdi: ::c_ulong,
pub rsi: ::c_ulong,
pub rbp: ::c_ulong,
pub r8: ::c_ulong,
pub r9: ::c_ulong,
pub r10: ::c_ulong,
pub r11: ::c_ulong,
pub r12: ::c_ulong,
pub r13: ::c_ulong,
pub r14: ::c_ulong,
pub r15: ::c_ulong,
pub rsp: ::c_ulong,
pub rip: ::c_ulong,
pub rflags: ::c_ulong,
pub fpu: savefpu,
}
pub struct ucontext_t {
pub uc_link: *mut ucontext_t,
pub uc_sigmask: ::sigset_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: mcontext_t,
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for fpu_state {
fn eq(&self, other: &fpu_state) -> bool {
self.control == other.control
&& self.status == other.status
&& self.tag == other.tag
&& self.opcode == other.opcode
&& self.rip == other.rip
&& self.rdp == other.rdp
&& self.mxcsr == other.mxcsr
&& self.mscsr_mask == other.mscsr_mask
&& self._fpreg.iter().zip(other._fpreg.iter()).all(|(a, b)| a == b)
&& self._xmm.iter().zip(other._xmm.iter()).all(|(a, b)| a == b)
&& self._reserved_416_511.
iter().
zip(other._reserved_416_511.iter()).
all(|(a, b)| a == b)
}
}
impl Eq for fpu_state {}
impl ::fmt::Debug for fpu_state {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("fpu_state")
.field("control", &self.control)
.field("status", &self.status)
.field("tag", &self.tag)
.field("opcode", &self.opcode)
.field("rip", &self.rip)
.field("rdp", &self.rdp)
.field("mxcsr", &self.mxcsr)
.field("mscsr_mask", &self.mscsr_mask)
// FIXME: .field("_fpreg", &self._fpreg)
// FIXME: .field("_xmm", &self._xmm)
// FIXME: .field("_reserved_416_511", &self._reserved_416_511)
.finish()
}
}
impl ::hash::Hash for fpu_state {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.control.hash(state);
self.status.hash(state);
self.tag.hash(state);
self.opcode.hash(state);
self.rip.hash(state);
self.rdp.hash(state);
self.mxcsr.hash(state);
self.mscsr_mask.hash(state);
self._fpreg.hash(state);
self._xmm.hash(state);
self._reserved_416_511.hash(state);
}
}
impl PartialEq for xstate_hdr {
fn eq(&self, other: &xstate_hdr) -> bool {
self.bv == other.bv
&& self.xcomp_bv == other.xcomp_bv
&& self._reserved.iter().zip(other._reserved.iter()).all(|(a, b)| a == b)
}
}
impl Eq for xstate_hdr {}
impl ::fmt::Debug for xstate_hdr {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("xstate_hdr")
.field("bv", &self.bv)
.field("xcomp_bv", &self.xcomp_bv)
// FIXME: .field("_reserved", &field._reserved)
.finish()
}
}
impl ::hash::Hash for xstate_hdr {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.bv.hash(state);
self.xcomp_bv.hash(state);
self._reserved.hash(state);
}
}
impl PartialEq for savefpu {
fn eq(&self, other: &savefpu) -> bool {
self.fp_fxsave == other.fp_fxsave
&& self.fp_xstate == other.fp_xstate
&& self._fp_ymm.iter().zip(other._fp_ymm.iter()).all(|(a, b)| a == b)
}
}
impl Eq for savefpu {}
impl ::fmt::Debug for savefpu {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("savefpu")
.field("fp_fxsave", &self.fp_fxsave)
.field("fp_xstate", &self.fp_xstate)
// FIXME: .field("_fp_ymm", &field._fp_ymm)
.finish()
}
}
impl ::hash::Hash for savefpu {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.fp_fxsave.hash(state);
self.fp_xstate.hash(state);
self._fp_ymm.hash(state);
}
}
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.rax == other.rax
&& self.rbx == other.rbx
&& self.rbx == other.rbx
&& self.rcx == other.rcx
&& self.rdx == other.rdx
&& self.rdi == other.rdi
&& self.rsi == other.rsi
&& self.r8 == other.r8
&& self.r9 == other.r9
&& self.r10 == other.r10
&& self.r11 == other.r11
&& self.r12 == other.r12
&& self.r13 == other.r13
&& self.r14 == other.r14
&& self.r15 == other.r15
&& self.rsp == other.rsp
&& self.rip == other.rip
&& self.rflags == other.rflags
&& self.fpu == other.fpu
}
}
impl Eq for mcontext_t {}
impl ::fmt::Debug for mcontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("mcontext_t")
.field("rax", &self.rax)
.field("rbx", &self.rbx)
.field("rcx", &self.rcx)
.field("rdx", &self.rdx)
.field("rdi", &self.rdi)
.field("rsi", &self.rsi)
.field("rbp", &self.rbp)
.field("r8", &self.r8)
.field("r9", &self.r9)
.field("r10", &self.r10)
.field("r11", &self.r11)
.field("r12", &self.r12)
.field("r13", &self.r13)
.field("r14", &self.r14)
.field("r15", &self.r15)
.field("rsp", &self.rsp)
.field("rip", &self.rip)
.field("rflags", &self.rflags)
.field("fpu", &self.fpu)
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.rax.hash(state);
self.rbx.hash(state);
self.rcx.hash(state);
self.rdx.hash(state);
self.rdi.hash(state);
self.rsi.hash(state);
self.rbp.hash(state);
self.r8.hash(state);
self.r9.hash(state);
self.r10.hash(state);
self.r11.hash(state);
self.r12.hash(state);
self.r13.hash(state);
self.r14.hash(state);
self.r15.hash(state);
self.rsp.hash(state);
self.rip.hash(state);
self.rflags.hash(state);
self.fpu.hash(state);
}
}
impl PartialEq for ucontext_t {
fn eq(&self, other: &ucontext_t) -> bool {
self.uc_link == other.uc_link
&& self.uc_sigmask == other.uc_sigmask
&& self.uc_stack == other.uc_stack
&& self.uc_mcontext == other.uc_mcontext
}
}
impl Eq for ucontext_t {}
impl ::fmt::Debug for ucontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ucontext_t")
.field("uc_link", &self.uc_link)
.field("uc_sigmask", &self.uc_sigmask)
.field("uc_stack", &self.uc_stack)
.field("uc_mcontext", &self.uc_mcontext)
.finish()
}
}
impl ::hash::Hash for ucontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.uc_link.hash(state);
self.uc_sigmask.hash(state);
self.uc_stack.hash(state);
self.uc_mcontext.hash(state);
}
}
}
}

1
vendor/libc/src/unix/hurd/align.rs vendored Normal file
View file

@ -0,0 +1 @@
// Placeholder file

93
vendor/libc/src/unix/hurd/b32.rs vendored Normal file
View file

@ -0,0 +1,93 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type __int64_t = ::c_longlong;
pub type __uint64_t = ::c_ulonglong;
pub type int_fast16_t = ::c_int;
pub type int_fast32_t = ::c_int;
pub type int_fast64_t = ::c_longlong;
pub type uint_fast16_t = ::c_uint;
pub type uint_fast32_t = ::c_uint;
pub type uint_fast64_t = ::c_ulonglong;
pub type __quad_t = ::c_longlong;
pub type __u_quad_t = ::c_ulonglong;
pub type __intmax_t = ::c_longlong;
pub type __uintmax_t = ::c_ulonglong;
pub type __squad_type = ::__int64_t;
pub type __uquad_type = ::__uint64_t;
pub type __sword_type = ::c_int;
pub type __uword_type = ::c_uint;
pub type __slong32_type = ::c_long;
pub type __ulong32_type = ::c_ulong;
pub type __s64_type = ::__int64_t;
pub type __u64_type = ::__uint64_t;
pub type __ipc_pid_t = ::c_ushort;
pub type Elf32_Half = u16;
pub type Elf32_Word = u32;
pub type Elf32_Off = u32;
pub type Elf32_Addr = u32;
pub type Elf32_Section = u16;
pub type Elf_Addr = ::Elf32_Addr;
pub type Elf_Half = ::Elf32_Half;
pub type Elf_Ehdr = ::Elf32_Ehdr;
pub type Elf_Phdr = ::Elf32_Phdr;
pub type Elf_Shdr = ::Elf32_Shdr;
pub type Elf_Sym = ::Elf32_Sym;
s! {
pub struct Elf32_Ehdr {
pub e_ident: [::c_uchar; 16],
pub e_type: Elf32_Half,
pub e_machine: Elf32_Half,
pub e_version: Elf32_Word,
pub e_entry: Elf32_Addr,
pub e_phoff: Elf32_Off,
pub e_shoff: Elf32_Off,
pub e_flags: Elf32_Word,
pub e_ehsize: Elf32_Half,
pub e_phentsize: Elf32_Half,
pub e_phnum: Elf32_Half,
pub e_shentsize: Elf32_Half,
pub e_shnum: Elf32_Half,
pub e_shstrndx: Elf32_Half,
}
pub struct Elf32_Shdr {
pub sh_name: Elf32_Word,
pub sh_type: Elf32_Word,
pub sh_flags: Elf32_Word,
pub sh_addr: Elf32_Addr,
pub sh_offset: Elf32_Off,
pub sh_size: Elf32_Word,
pub sh_link: Elf32_Word,
pub sh_info: Elf32_Word,
pub sh_addralign: Elf32_Word,
pub sh_entsize: Elf32_Word,
}
pub struct Elf32_Sym {
pub st_name: Elf32_Word,
pub st_value: Elf32_Addr,
pub st_size: Elf32_Word,
pub st_info: ::c_uchar,
pub st_other: ::c_uchar,
pub st_shndx: Elf32_Section,
}
pub struct Elf32_Phdr {
pub p_type: ::Elf32_Word,
pub p_offset: ::Elf32_Off,
pub p_vaddr: ::Elf32_Addr,
pub p_paddr: ::Elf32_Addr,
pub p_filesz: ::Elf32_Word,
pub p_memsz: ::Elf32_Word,
pub p_flags: ::Elf32_Word,
pub p_align: ::Elf32_Word,
}
}

95
vendor/libc/src/unix/hurd/b64.rs vendored Normal file
View file

@ -0,0 +1,95 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type __int64_t = ::c_long;
pub type __uint64_t = ::c_ulong;
pub type int_fast16_t = ::c_long;
pub type int_fast32_t = ::c_long;
pub type int_fast64_t = ::c_long;
pub type uint_fast16_t = ::c_ulong;
pub type uint_fast32_t = ::c_ulong;
pub type uint_fast64_t = ::c_ulong;
pub type __quad_t = ::c_long;
pub type __u_quad_t = ::c_ulong;
pub type __intmax_t = ::c_long;
pub type __uintmax_t = ::c_ulong;
pub type __squad_type = ::c_long;
pub type __uquad_type = ::c_ulong;
pub type __sword_type = ::c_long;
pub type __uword_type = ::c_ulong;
pub type __slong32_type = ::c_int;
pub type __ulong32_type = ::c_uint;
pub type __s64_type = ::c_long;
pub type __u64_type = ::c_ulong;
pub type __ipc_pid_t = ::c_int;
pub type Elf64_Half = u16;
pub type Elf64_Word = u32;
pub type Elf64_Off = u64;
pub type Elf64_Addr = u64;
pub type Elf64_Xword = u64;
pub type Elf64_Sxword = i64;
pub type Elf64_Section = u16;
pub type Elf_Addr = ::Elf64_Addr;
pub type Elf_Half = ::Elf64_Half;
pub type Elf_Ehdr = ::Elf64_Ehdr;
pub type Elf_Phdr = ::Elf64_Phdr;
pub type Elf_Shdr = ::Elf64_Shdr;
pub type Elf_Sym = ::Elf64_Sym;
s! {
pub struct Elf64_Ehdr {
pub e_ident: [::c_uchar; 16],
pub e_type: Elf64_Half,
pub e_machine: Elf64_Half,
pub e_version: Elf64_Word,
pub e_entry: Elf64_Addr,
pub e_phoff: Elf64_Off,
pub e_shoff: Elf64_Off,
pub e_flags: Elf64_Word,
pub e_ehsize: Elf64_Half,
pub e_phentsize: Elf64_Half,
pub e_phnum: Elf64_Half,
pub e_shentsize: Elf64_Half,
pub e_shnum: Elf64_Half,
pub e_shstrndx: Elf64_Half,
}
pub struct Elf64_Shdr {
pub sh_name: Elf64_Word,
pub sh_type: Elf64_Word,
pub sh_flags: Elf64_Xword,
pub sh_addr: Elf64_Addr,
pub sh_offset: Elf64_Off,
pub sh_size: Elf64_Xword,
pub sh_link: Elf64_Word,
pub sh_info: Elf64_Word,
pub sh_addralign: Elf64_Xword,
pub sh_entsize: Elf64_Xword,
}
pub struct Elf64_Sym {
pub st_name: Elf64_Word,
pub st_info: ::c_uchar,
pub st_other: ::c_uchar,
pub st_shndx: Elf64_Section,
pub st_value: Elf64_Addr,
pub st_size: Elf64_Xword,
}
pub struct Elf64_Phdr {
pub p_type: ::Elf64_Word,
pub p_flags: ::Elf64_Word,
pub p_offset: ::Elf64_Off,
pub p_vaddr: ::Elf64_Addr,
pub p_paddr: ::Elf64_Addr,
pub p_filesz: ::Elf64_Xword,
pub p_memsz: ::Elf64_Xword,
pub p_align: ::Elf64_Xword,
}
}

4696
vendor/libc/src/unix/hurd/mod.rs vendored Normal file

File diff suppressed because it is too large Load diff

1
vendor/libc/src/unix/hurd/no_align.rs vendored Normal file
View file

@ -0,0 +1 @@
// Placeholder file

View file

@ -0,0 +1,553 @@
pub type c_char = u8;
pub type wchar_t = u32;
pub type greg_t = i32;
pub type mcontext_t = sigcontext;
s! {
pub struct sigcontext {
pub trap_no: ::c_ulong,
pub error_code: ::c_ulong,
pub oldmask: ::c_ulong,
pub arm_r0: ::c_ulong,
pub arm_r1: ::c_ulong,
pub arm_r2: ::c_ulong,
pub arm_r3: ::c_ulong,
pub arm_r4: ::c_ulong,
pub arm_r5: ::c_ulong,
pub arm_r6: ::c_ulong,
pub arm_r7: ::c_ulong,
pub arm_r8: ::c_ulong,
pub arm_r9: ::c_ulong,
pub arm_r10: ::c_ulong,
pub arm_fp: ::c_ulong,
pub arm_ip: ::c_ulong,
pub arm_sp: ::c_ulong,
pub arm_lr: ::c_ulong,
pub arm_pc: ::c_ulong,
pub arm_cpsr: ::c_ulong,
pub fault_address: ::c_ulong,
}
}
cfg_if! {
if #[cfg(libc_union)] {
s_no_extra_traits! {
pub struct __c_anonymous_uc_sigmask_with_padding {
pub uc_sigmask: ::sigset_t,
/* Android has a wrong (smaller) sigset_t on x86. */
__padding_rt_sigset: u32,
}
pub union __c_anonymous_uc_sigmask {
uc_sigmask: __c_anonymous_uc_sigmask_with_padding,
uc_sigmask64: ::sigset64_t,
}
pub struct ucontext_t {
pub uc_flags: ::c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: mcontext_t,
pub uc_sigmask__c_anonymous_union: __c_anonymous_uc_sigmask,
/* The kernel adds extra padding after uc_sigmask to match
* glibc sigset_t on ARM. */
__padding: [c_char; 120],
__align: [::c_longlong; 0],
uc_regspace: [::c_ulong; 128],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for __c_anonymous_uc_sigmask_with_padding {
fn eq(
&self, other: &__c_anonymous_uc_sigmask_with_padding
) -> bool {
self.uc_sigmask == other.uc_sigmask
// Ignore padding
}
}
impl Eq for __c_anonymous_uc_sigmask_with_padding {}
impl ::fmt::Debug for __c_anonymous_uc_sigmask_with_padding {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("uc_sigmask_with_padding")
.field("uc_sigmask_with_padding", &self.uc_sigmask)
// Ignore padding
.finish()
}
}
impl ::hash::Hash for __c_anonymous_uc_sigmask_with_padding {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.uc_sigmask.hash(state)
// Ignore padding
}
}
impl PartialEq for __c_anonymous_uc_sigmask {
fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool {
unsafe { self.uc_sigmask == other.uc_sigmask }
}
}
impl Eq for __c_anonymous_uc_sigmask {}
impl ::fmt::Debug for __c_anonymous_uc_sigmask {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("uc_sigmask")
.field("uc_sigmask", unsafe { &self.uc_sigmask })
.finish()
}
}
impl ::hash::Hash for __c_anonymous_uc_sigmask {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
unsafe { self.uc_sigmask.hash(state) }
}
}
impl PartialEq for ucontext_t {
fn eq(&self, other: &Self) -> bool {
self.uc_flags == other.uc_flags
&& self.uc_link == other.uc_link
&& self.uc_stack == other.uc_stack
&& self.uc_mcontext == other.uc_mcontext
&& self.uc_sigmask__c_anonymous_union
== other.uc_sigmask__c_anonymous_union
&& &self.uc_regspace[..] == &other.uc_regspace[..]
// Ignore padding field
}
}
impl Eq for ucontext_t {}
impl ::fmt::Debug for ucontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ucontext_t")
.field("uc_flags", &self.uc_flags)
.field("uc_link", &self.uc_link)
.field("uc_stack", &self.uc_stack)
.field("uc_mcontext", &self.uc_mcontext)
.field(
"uc_sigmask__c_anonymous_union",
&self.uc_sigmask__c_anonymous_union
)
.field("uc_regspace", &&self.uc_regspace[..])
// Ignore padding field
.finish()
}
}
impl ::hash::Hash for ucontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.uc_flags.hash(state);
self.uc_link.hash(state);
self.uc_stack.hash(state);
self.uc_mcontext.hash(state);
self.uc_sigmask__c_anonymous_union.hash(state);
self.uc_regspace[..].hash(state);
// Ignore padding field
}
}
}
}
}
}
pub const O_DIRECT: ::c_int = 0x10000;
pub const O_DIRECTORY: ::c_int = 0x4000;
pub const O_NOFOLLOW: ::c_int = 0x8000;
pub const O_LARGEFILE: ::c_int = 0o400000;
pub const SYS_restart_syscall: ::c_long = 0;
pub const SYS_exit: ::c_long = 1;
pub const SYS_fork: ::c_long = 2;
pub const SYS_read: ::c_long = 3;
pub const SYS_write: ::c_long = 4;
pub const SYS_open: ::c_long = 5;
pub const SYS_close: ::c_long = 6;
pub const SYS_creat: ::c_long = 8;
pub const SYS_link: ::c_long = 9;
pub const SYS_unlink: ::c_long = 10;
pub const SYS_execve: ::c_long = 11;
pub const SYS_chdir: ::c_long = 12;
pub const SYS_mknod: ::c_long = 14;
pub const SYS_chmod: ::c_long = 15;
pub const SYS_lchown: ::c_long = 16;
pub const SYS_lseek: ::c_long = 19;
pub const SYS_getpid: ::c_long = 20;
pub const SYS_mount: ::c_long = 21;
pub const SYS_setuid: ::c_long = 23;
pub const SYS_getuid: ::c_long = 24;
pub const SYS_ptrace: ::c_long = 26;
pub const SYS_pause: ::c_long = 29;
pub const SYS_access: ::c_long = 33;
pub const SYS_nice: ::c_long = 34;
pub const SYS_sync: ::c_long = 36;
pub const SYS_kill: ::c_long = 37;
pub const SYS_rename: ::c_long = 38;
pub const SYS_mkdir: ::c_long = 39;
pub const SYS_rmdir: ::c_long = 40;
pub const SYS_dup: ::c_long = 41;
pub const SYS_pipe: ::c_long = 42;
pub const SYS_times: ::c_long = 43;
pub const SYS_brk: ::c_long = 45;
pub const SYS_setgid: ::c_long = 46;
pub const SYS_getgid: ::c_long = 47;
pub const SYS_geteuid: ::c_long = 49;
pub const SYS_getegid: ::c_long = 50;
pub const SYS_acct: ::c_long = 51;
pub const SYS_umount2: ::c_long = 52;
pub const SYS_ioctl: ::c_long = 54;
pub const SYS_fcntl: ::c_long = 55;
pub const SYS_setpgid: ::c_long = 57;
pub const SYS_umask: ::c_long = 60;
pub const SYS_chroot: ::c_long = 61;
pub const SYS_ustat: ::c_long = 62;
pub const SYS_dup2: ::c_long = 63;
pub const SYS_getppid: ::c_long = 64;
pub const SYS_getpgrp: ::c_long = 65;
pub const SYS_setsid: ::c_long = 66;
pub const SYS_sigaction: ::c_long = 67;
pub const SYS_setreuid: ::c_long = 70;
pub const SYS_setregid: ::c_long = 71;
pub const SYS_sigsuspend: ::c_long = 72;
pub const SYS_sigpending: ::c_long = 73;
pub const SYS_sethostname: ::c_long = 74;
pub const SYS_setrlimit: ::c_long = 75;
pub const SYS_getrusage: ::c_long = 77;
pub const SYS_gettimeofday: ::c_long = 78;
pub const SYS_settimeofday: ::c_long = 79;
pub const SYS_getgroups: ::c_long = 80;
pub const SYS_setgroups: ::c_long = 81;
pub const SYS_symlink: ::c_long = 83;
pub const SYS_readlink: ::c_long = 85;
pub const SYS_uselib: ::c_long = 86;
pub const SYS_swapon: ::c_long = 87;
pub const SYS_reboot: ::c_long = 88;
pub const SYS_munmap: ::c_long = 91;
pub const SYS_truncate: ::c_long = 92;
pub const SYS_ftruncate: ::c_long = 93;
pub const SYS_fchmod: ::c_long = 94;
pub const SYS_fchown: ::c_long = 95;
pub const SYS_getpriority: ::c_long = 96;
pub const SYS_setpriority: ::c_long = 97;
pub const SYS_statfs: ::c_long = 99;
pub const SYS_fstatfs: ::c_long = 100;
pub const SYS_syslog: ::c_long = 103;
pub const SYS_setitimer: ::c_long = 104;
pub const SYS_getitimer: ::c_long = 105;
pub const SYS_stat: ::c_long = 106;
pub const SYS_lstat: ::c_long = 107;
pub const SYS_fstat: ::c_long = 108;
pub const SYS_vhangup: ::c_long = 111;
pub const SYS_wait4: ::c_long = 114;
pub const SYS_swapoff: ::c_long = 115;
pub const SYS_sysinfo: ::c_long = 116;
pub const SYS_fsync: ::c_long = 118;
pub const SYS_sigreturn: ::c_long = 119;
pub const SYS_clone: ::c_long = 120;
pub const SYS_setdomainname: ::c_long = 121;
pub const SYS_uname: ::c_long = 122;
pub const SYS_adjtimex: ::c_long = 124;
pub const SYS_mprotect: ::c_long = 125;
pub const SYS_sigprocmask: ::c_long = 126;
pub const SYS_init_module: ::c_long = 128;
pub const SYS_delete_module: ::c_long = 129;
pub const SYS_quotactl: ::c_long = 131;
pub const SYS_getpgid: ::c_long = 132;
pub const SYS_fchdir: ::c_long = 133;
pub const SYS_bdflush: ::c_long = 134;
pub const SYS_sysfs: ::c_long = 135;
pub const SYS_personality: ::c_long = 136;
pub const SYS_setfsuid: ::c_long = 138;
pub const SYS_setfsgid: ::c_long = 139;
pub const SYS_getdents: ::c_long = 141;
pub const SYS_flock: ::c_long = 143;
pub const SYS_msync: ::c_long = 144;
pub const SYS_readv: ::c_long = 145;
pub const SYS_writev: ::c_long = 146;
pub const SYS_getsid: ::c_long = 147;
pub const SYS_fdatasync: ::c_long = 148;
pub const SYS_mlock: ::c_long = 150;
pub const SYS_munlock: ::c_long = 151;
pub const SYS_mlockall: ::c_long = 152;
pub const SYS_munlockall: ::c_long = 153;
pub const SYS_sched_setparam: ::c_long = 154;
pub const SYS_sched_getparam: ::c_long = 155;
pub const SYS_sched_setscheduler: ::c_long = 156;
pub const SYS_sched_getscheduler: ::c_long = 157;
pub const SYS_sched_yield: ::c_long = 158;
pub const SYS_sched_get_priority_max: ::c_long = 159;
pub const SYS_sched_get_priority_min: ::c_long = 160;
pub const SYS_sched_rr_get_interval: ::c_long = 161;
pub const SYS_nanosleep: ::c_long = 162;
pub const SYS_mremap: ::c_long = 163;
pub const SYS_setresuid: ::c_long = 164;
pub const SYS_getresuid: ::c_long = 165;
pub const SYS_poll: ::c_long = 168;
pub const SYS_nfsservctl: ::c_long = 169;
pub const SYS_setresgid: ::c_long = 170;
pub const SYS_getresgid: ::c_long = 171;
pub const SYS_prctl: ::c_long = 172;
pub const SYS_rt_sigreturn: ::c_long = 173;
pub const SYS_rt_sigaction: ::c_long = 174;
pub const SYS_rt_sigprocmask: ::c_long = 175;
pub const SYS_rt_sigpending: ::c_long = 176;
pub const SYS_rt_sigtimedwait: ::c_long = 177;
pub const SYS_rt_sigqueueinfo: ::c_long = 178;
pub const SYS_rt_sigsuspend: ::c_long = 179;
pub const SYS_pread64: ::c_long = 180;
pub const SYS_pwrite64: ::c_long = 181;
pub const SYS_chown: ::c_long = 182;
pub const SYS_getcwd: ::c_long = 183;
pub const SYS_capget: ::c_long = 184;
pub const SYS_capset: ::c_long = 185;
pub const SYS_sigaltstack: ::c_long = 186;
pub const SYS_sendfile: ::c_long = 187;
pub const SYS_vfork: ::c_long = 190;
pub const SYS_ugetrlimit: ::c_long = 191;
pub const SYS_mmap2: ::c_long = 192;
pub const SYS_truncate64: ::c_long = 193;
pub const SYS_ftruncate64: ::c_long = 194;
pub const SYS_stat64: ::c_long = 195;
pub const SYS_lstat64: ::c_long = 196;
pub const SYS_fstat64: ::c_long = 197;
pub const SYS_lchown32: ::c_long = 198;
pub const SYS_getuid32: ::c_long = 199;
pub const SYS_getgid32: ::c_long = 200;
pub const SYS_geteuid32: ::c_long = 201;
pub const SYS_getegid32: ::c_long = 202;
pub const SYS_setreuid32: ::c_long = 203;
pub const SYS_setregid32: ::c_long = 204;
pub const SYS_getgroups32: ::c_long = 205;
pub const SYS_setgroups32: ::c_long = 206;
pub const SYS_fchown32: ::c_long = 207;
pub const SYS_setresuid32: ::c_long = 208;
pub const SYS_getresuid32: ::c_long = 209;
pub const SYS_setresgid32: ::c_long = 210;
pub const SYS_getresgid32: ::c_long = 211;
pub const SYS_chown32: ::c_long = 212;
pub const SYS_setuid32: ::c_long = 213;
pub const SYS_setgid32: ::c_long = 214;
pub const SYS_setfsuid32: ::c_long = 215;
pub const SYS_setfsgid32: ::c_long = 216;
pub const SYS_getdents64: ::c_long = 217;
pub const SYS_pivot_root: ::c_long = 218;
pub const SYS_mincore: ::c_long = 219;
pub const SYS_madvise: ::c_long = 220;
pub const SYS_fcntl64: ::c_long = 221;
pub const SYS_gettid: ::c_long = 224;
pub const SYS_readahead: ::c_long = 225;
pub const SYS_setxattr: ::c_long = 226;
pub const SYS_lsetxattr: ::c_long = 227;
pub const SYS_fsetxattr: ::c_long = 228;
pub const SYS_getxattr: ::c_long = 229;
pub const SYS_lgetxattr: ::c_long = 230;
pub const SYS_fgetxattr: ::c_long = 231;
pub const SYS_listxattr: ::c_long = 232;
pub const SYS_llistxattr: ::c_long = 233;
pub const SYS_flistxattr: ::c_long = 234;
pub const SYS_removexattr: ::c_long = 235;
pub const SYS_lremovexattr: ::c_long = 236;
pub const SYS_fremovexattr: ::c_long = 237;
pub const SYS_tkill: ::c_long = 238;
pub const SYS_sendfile64: ::c_long = 239;
pub const SYS_futex: ::c_long = 240;
pub const SYS_sched_setaffinity: ::c_long = 241;
pub const SYS_sched_getaffinity: ::c_long = 242;
pub const SYS_io_setup: ::c_long = 243;
pub const SYS_io_destroy: ::c_long = 244;
pub const SYS_io_getevents: ::c_long = 245;
pub const SYS_io_submit: ::c_long = 246;
pub const SYS_io_cancel: ::c_long = 247;
pub const SYS_exit_group: ::c_long = 248;
pub const SYS_lookup_dcookie: ::c_long = 249;
pub const SYS_epoll_create: ::c_long = 250;
pub const SYS_epoll_ctl: ::c_long = 251;
pub const SYS_epoll_wait: ::c_long = 252;
pub const SYS_remap_file_pages: ::c_long = 253;
pub const SYS_set_tid_address: ::c_long = 256;
pub const SYS_timer_create: ::c_long = 257;
pub const SYS_timer_settime: ::c_long = 258;
pub const SYS_timer_gettime: ::c_long = 259;
pub const SYS_timer_getoverrun: ::c_long = 260;
pub const SYS_timer_delete: ::c_long = 261;
pub const SYS_clock_settime: ::c_long = 262;
pub const SYS_clock_gettime: ::c_long = 263;
pub const SYS_clock_getres: ::c_long = 264;
pub const SYS_clock_nanosleep: ::c_long = 265;
pub const SYS_statfs64: ::c_long = 266;
pub const SYS_fstatfs64: ::c_long = 267;
pub const SYS_tgkill: ::c_long = 268;
pub const SYS_utimes: ::c_long = 269;
pub const SYS_arm_fadvise64_64: ::c_long = 270;
pub const SYS_pciconfig_iobase: ::c_long = 271;
pub const SYS_pciconfig_read: ::c_long = 272;
pub const SYS_pciconfig_write: ::c_long = 273;
pub const SYS_mq_open: ::c_long = 274;
pub const SYS_mq_unlink: ::c_long = 275;
pub const SYS_mq_timedsend: ::c_long = 276;
pub const SYS_mq_timedreceive: ::c_long = 277;
pub const SYS_mq_notify: ::c_long = 278;
pub const SYS_mq_getsetattr: ::c_long = 279;
pub const SYS_waitid: ::c_long = 280;
pub const SYS_socket: ::c_long = 281;
pub const SYS_bind: ::c_long = 282;
pub const SYS_connect: ::c_long = 283;
pub const SYS_listen: ::c_long = 284;
pub const SYS_accept: ::c_long = 285;
pub const SYS_getsockname: ::c_long = 286;
pub const SYS_getpeername: ::c_long = 287;
pub const SYS_socketpair: ::c_long = 288;
pub const SYS_send: ::c_long = 289;
pub const SYS_sendto: ::c_long = 290;
pub const SYS_recv: ::c_long = 291;
pub const SYS_recvfrom: ::c_long = 292;
pub const SYS_shutdown: ::c_long = 293;
pub const SYS_setsockopt: ::c_long = 294;
pub const SYS_getsockopt: ::c_long = 295;
pub const SYS_sendmsg: ::c_long = 296;
pub const SYS_recvmsg: ::c_long = 297;
pub const SYS_semop: ::c_long = 298;
pub const SYS_semget: ::c_long = 299;
pub const SYS_semctl: ::c_long = 300;
pub const SYS_msgsnd: ::c_long = 301;
pub const SYS_msgrcv: ::c_long = 302;
pub const SYS_msgget: ::c_long = 303;
pub const SYS_msgctl: ::c_long = 304;
pub const SYS_shmat: ::c_long = 305;
pub const SYS_shmdt: ::c_long = 306;
pub const SYS_shmget: ::c_long = 307;
pub const SYS_shmctl: ::c_long = 308;
pub const SYS_add_key: ::c_long = 309;
pub const SYS_request_key: ::c_long = 310;
pub const SYS_keyctl: ::c_long = 311;
pub const SYS_semtimedop: ::c_long = 312;
pub const SYS_vserver: ::c_long = 313;
pub const SYS_ioprio_set: ::c_long = 314;
pub const SYS_ioprio_get: ::c_long = 315;
pub const SYS_inotify_init: ::c_long = 316;
pub const SYS_inotify_add_watch: ::c_long = 317;
pub const SYS_inotify_rm_watch: ::c_long = 318;
pub const SYS_mbind: ::c_long = 319;
pub const SYS_get_mempolicy: ::c_long = 320;
pub const SYS_set_mempolicy: ::c_long = 321;
pub const SYS_openat: ::c_long = 322;
pub const SYS_mkdirat: ::c_long = 323;
pub const SYS_mknodat: ::c_long = 324;
pub const SYS_fchownat: ::c_long = 325;
pub const SYS_futimesat: ::c_long = 326;
pub const SYS_fstatat64: ::c_long = 327;
pub const SYS_unlinkat: ::c_long = 328;
pub const SYS_renameat: ::c_long = 329;
pub const SYS_linkat: ::c_long = 330;
pub const SYS_symlinkat: ::c_long = 331;
pub const SYS_readlinkat: ::c_long = 332;
pub const SYS_fchmodat: ::c_long = 333;
pub const SYS_faccessat: ::c_long = 334;
pub const SYS_pselect6: ::c_long = 335;
pub const SYS_ppoll: ::c_long = 336;
pub const SYS_unshare: ::c_long = 337;
pub const SYS_set_robust_list: ::c_long = 338;
pub const SYS_get_robust_list: ::c_long = 339;
pub const SYS_splice: ::c_long = 340;
pub const SYS_arm_sync_file_range: ::c_long = 341;
pub const SYS_tee: ::c_long = 342;
pub const SYS_vmsplice: ::c_long = 343;
pub const SYS_move_pages: ::c_long = 344;
pub const SYS_getcpu: ::c_long = 345;
pub const SYS_epoll_pwait: ::c_long = 346;
pub const SYS_kexec_load: ::c_long = 347;
pub const SYS_utimensat: ::c_long = 348;
pub const SYS_signalfd: ::c_long = 349;
pub const SYS_timerfd_create: ::c_long = 350;
pub const SYS_eventfd: ::c_long = 351;
pub const SYS_fallocate: ::c_long = 352;
pub const SYS_timerfd_settime: ::c_long = 353;
pub const SYS_timerfd_gettime: ::c_long = 354;
pub const SYS_signalfd4: ::c_long = 355;
pub const SYS_eventfd2: ::c_long = 356;
pub const SYS_epoll_create1: ::c_long = 357;
pub const SYS_dup3: ::c_long = 358;
pub const SYS_pipe2: ::c_long = 359;
pub const SYS_inotify_init1: ::c_long = 360;
pub const SYS_preadv: ::c_long = 361;
pub const SYS_pwritev: ::c_long = 362;
pub const SYS_rt_tgsigqueueinfo: ::c_long = 363;
pub const SYS_perf_event_open: ::c_long = 364;
pub const SYS_recvmmsg: ::c_long = 365;
pub const SYS_accept4: ::c_long = 366;
pub const SYS_fanotify_init: ::c_long = 367;
pub const SYS_fanotify_mark: ::c_long = 368;
pub const SYS_prlimit64: ::c_long = 369;
pub const SYS_name_to_handle_at: ::c_long = 370;
pub const SYS_open_by_handle_at: ::c_long = 371;
pub const SYS_clock_adjtime: ::c_long = 372;
pub const SYS_syncfs: ::c_long = 373;
pub const SYS_sendmmsg: ::c_long = 374;
pub const SYS_setns: ::c_long = 375;
pub const SYS_process_vm_readv: ::c_long = 376;
pub const SYS_process_vm_writev: ::c_long = 377;
pub const SYS_kcmp: ::c_long = 378;
pub const SYS_finit_module: ::c_long = 379;
pub const SYS_sched_setattr: ::c_long = 380;
pub const SYS_sched_getattr: ::c_long = 381;
pub const SYS_renameat2: ::c_long = 382;
pub const SYS_seccomp: ::c_long = 383;
pub const SYS_getrandom: ::c_long = 384;
pub const SYS_memfd_create: ::c_long = 385;
pub const SYS_bpf: ::c_long = 386;
pub const SYS_execveat: ::c_long = 387;
pub const SYS_userfaultfd: ::c_long = 388;
pub const SYS_membarrier: ::c_long = 389;
pub const SYS_mlock2: ::c_long = 390;
pub const SYS_copy_file_range: ::c_long = 391;
pub const SYS_preadv2: ::c_long = 392;
pub const SYS_pwritev2: ::c_long = 393;
pub const SYS_pkey_mprotect: ::c_long = 394;
pub const SYS_pkey_alloc: ::c_long = 395;
pub const SYS_pkey_free: ::c_long = 396;
pub const SYS_statx: ::c_long = 397;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
pub const SYS_open_tree: ::c_long = 428;
pub const SYS_move_mount: ::c_long = 429;
pub const SYS_fsopen: ::c_long = 430;
pub const SYS_fsconfig: ::c_long = 431;
pub const SYS_fsmount: ::c_long = 432;
pub const SYS_fspick: ::c_long = 433;
// offsets in mcontext_t.gregs from sys/ucontext.h
pub const REG_R0: ::c_int = 0;
pub const REG_R1: ::c_int = 1;
pub const REG_R2: ::c_int = 2;
pub const REG_R3: ::c_int = 3;
pub const REG_R4: ::c_int = 4;
pub const REG_R5: ::c_int = 5;
pub const REG_R6: ::c_int = 6;
pub const REG_R7: ::c_int = 7;
pub const REG_R8: ::c_int = 8;
pub const REG_R9: ::c_int = 9;
pub const REG_R10: ::c_int = 10;
pub const REG_R11: ::c_int = 11;
pub const REG_R12: ::c_int = 12;
pub const REG_R13: ::c_int = 13;
pub const REG_R14: ::c_int = 14;
pub const REG_R15: ::c_int = 15;
pub const NGREG: ::c_int = 18;
// From NDK's asm/auxvec.h
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
f! {
// Sadly, Android before 5.0 (API level 21), the accept4 syscall is not
// exposed by the libc. As work-around, we implement it through `syscall`
// directly. This workaround can be removed if the minimum version of
// Android is bumped. When the workaround is removed, `accept4` can be
// moved back to `linux_like/mod.rs`
pub fn accept4(
fd: ::c_int,
addr: *mut ::sockaddr,
len: *mut ::socklen_t,
flg: ::c_int
) -> ::c_int {
::syscall(SYS_accept4, fd, addr, len, flg) as ::c_int
}
}

View file

@ -0,0 +1,244 @@
// The following definitions are correct for arm and i686,
// but may be wrong for mips
pub type c_long = i32;
pub type c_ulong = u32;
pub type mode_t = u16;
pub type off64_t = ::c_longlong;
pub type sigset_t = ::c_ulong;
pub type socklen_t = i32;
pub type time64_t = i64;
pub type __u64 = ::c_ulonglong;
s! {
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
}
pub struct rlimit64 {
pub rlim_cur: u64,
pub rlim_max: u64,
}
pub struct stat {
pub st_dev: ::c_ulonglong,
__pad0: [::c_uchar; 4],
__st_ino: ::ino_t,
pub st_mode: ::c_uint,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::c_ulonglong,
__pad3: [::c_uchar; 4],
pub st_size: ::c_longlong,
pub st_blksize: ::blksize_t,
pub st_blocks: ::c_ulonglong,
pub st_atime: ::c_long,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::c_long,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::c_long,
pub st_ctime_nsec: ::c_long,
pub st_ino: ::c_ulonglong,
}
pub struct stat64 {
pub st_dev: ::c_ulonglong,
__pad0: [::c_uchar; 4],
__st_ino: ::ino_t,
pub st_mode: ::c_uint,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::c_ulonglong,
__pad3: [::c_uchar; 4],
pub st_size: ::c_longlong,
pub st_blksize: ::blksize_t,
pub st_blocks: ::c_ulonglong,
pub st_atime: ::c_long,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::c_long,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::c_long,
pub st_ctime_nsec: ::c_long,
pub st_ino: ::c_ulonglong,
}
pub struct statfs64 {
pub f_type: u32,
pub f_bsize: u32,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_fsid: ::__fsid_t,
pub f_namelen: u32,
pub f_frsize: u32,
pub f_flags: u32,
pub f_spare: [u32; 4],
}
pub struct statvfs64 {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: ::c_ulong,
pub f_bfree: ::c_ulong,
pub f_bavail: ::c_ulong,
pub f_files: ::c_ulong,
pub f_ffree: ::c_ulong,
pub f_favail: ::c_ulong,
pub f_fsid: ::c_ulong,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
}
pub struct pthread_attr_t {
pub flags: u32,
pub stack_base: *mut ::c_void,
pub stack_size: ::size_t,
pub guard_size: ::size_t,
pub sched_policy: i32,
pub sched_priority: i32,
}
pub struct pthread_mutex_t { value: ::c_int }
pub struct pthread_cond_t { value: ::c_int }
pub struct pthread_rwlock_t {
lock: pthread_mutex_t,
cond: pthread_cond_t,
numLocks: ::c_int,
writerThreadId: ::c_int,
pendingReaders: ::c_int,
pendingWriters: ::c_int,
attr: i32,
__reserved: [::c_char; 12],
}
pub struct pthread_barrier_t {
__private: [i32; 8],
}
pub struct pthread_spinlock_t {
__private: [i32; 2],
}
pub struct passwd {
pub pw_name: *mut ::c_char,
pub pw_passwd: *mut ::c_char,
pub pw_uid: ::uid_t,
pub pw_gid: ::gid_t,
pub pw_dir: *mut ::c_char,
pub pw_shell: *mut ::c_char,
}
pub struct statfs {
pub f_type: u32,
pub f_bsize: u32,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_fsid: ::__fsid_t,
pub f_namelen: u32,
pub f_frsize: u32,
pub f_flags: u32,
pub f_spare: [u32; 4],
}
pub struct sysinfo {
pub uptime: ::c_long,
pub loads: [::c_ulong; 3],
pub totalram: ::c_ulong,
pub freeram: ::c_ulong,
pub sharedram: ::c_ulong,
pub bufferram: ::c_ulong,
pub totalswap: ::c_ulong,
pub freeswap: ::c_ulong,
pub procs: ::c_ushort,
pub pad: ::c_ushort,
pub totalhigh: ::c_ulong,
pub freehigh: ::c_ulong,
pub mem_unit: ::c_uint,
pub _f: [::c_char; 8],
}
}
s_no_extra_traits! {
pub struct sigset64_t {
__bits: [::c_ulong; 2]
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl ::fmt::Debug for sigset64_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sigset64_t")
.field("__bits", &self.__bits)
.finish()
}
}
}
}
// These constants must be of the same type of sigaction.sa_flags
pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
pub const SA_NODEFER: ::c_int = 0x40000000;
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_RESETHAND: ::c_int = 0x80000000;
pub const SA_RESTART: ::c_int = 0x10000000;
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const RTLD_GLOBAL: ::c_int = 2;
pub const RTLD_NOW: ::c_int = 0;
pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
pub const PTRACE_GETFPREGS: ::c_int = 14;
pub const PTRACE_SETFPREGS: ::c_int = 15;
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { value: 0 };
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { value: 0 };
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
lock: PTHREAD_MUTEX_INITIALIZER,
cond: PTHREAD_COND_INITIALIZER,
numLocks: 0,
writerThreadId: 0,
pendingReaders: 0,
pendingWriters: 0,
attr: 0,
__reserved: [0; 12],
};
pub const PTHREAD_STACK_MIN: ::size_t = 4096 * 2;
pub const CPU_SETSIZE: ::size_t = 32;
pub const __CPU_BITS: ::size_t = 32;
pub const UT_LINESIZE: usize = 8;
pub const UT_NAMESIZE: usize = 8;
pub const UT_HOSTSIZE: usize = 16;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
extern "C" {
pub fn timegm64(tm: *const ::tm) -> ::time64_t;
}
cfg_if! {
if #[cfg(target_arch = "x86")] {
mod x86;
pub use self::x86::*;
} else if #[cfg(target_arch = "arm")] {
mod arm;
pub use self::arm::*;
} else {
// Unknown target_arch
}
}

View file

@ -0,0 +1,7 @@
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(8))]
pub struct max_align_t {
priv_: [f64; 2]
}
}

View file

@ -0,0 +1,627 @@
pub type c_char = i8;
pub type wchar_t = i32;
pub type greg_t = i32;
s! {
pub struct _libc_fpreg {
pub significand: [u16; 4],
pub exponent: u16,
}
pub struct _libc_fpstate {
pub cw: ::c_ulong,
pub sw: ::c_ulong,
pub tag: ::c_ulong,
pub ipoff: ::c_ulong,
pub cssel: ::c_ulong,
pub dataoff: ::c_ulong,
pub datasel: ::c_ulong,
pub _st: [_libc_fpreg; 8],
pub status: ::c_ulong,
}
pub struct mcontext_t {
pub gregs: [greg_t; 19],
pub fpregs: *mut _libc_fpstate,
pub oldmask: ::c_ulong,
pub cr2: ::c_ulong,
}
}
cfg_if! {
if #[cfg(libc_union)] {
s_no_extra_traits! {
pub struct __c_anonymous_uc_sigmask_with_padding {
pub uc_sigmask: ::sigset_t,
/* Android has a wrong (smaller) sigset_t on x86. */
__padding_rt_sigset: u32,
}
pub union __c_anonymous_uc_sigmask {
uc_sigmask: __c_anonymous_uc_sigmask_with_padding,
uc_sigmask64: ::sigset64_t,
}
pub struct ucontext_t {
pub uc_flags: ::c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: mcontext_t,
pub uc_sigmask__c_anonymous_union: __c_anonymous_uc_sigmask,
__padding_rt_sigset: u32,
__fpregs_mem: _libc_fpstate,
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for __c_anonymous_uc_sigmask_with_padding {
fn eq(
&self, other: &__c_anonymous_uc_sigmask_with_padding
) -> bool {
self.uc_sigmask == other.uc_sigmask
// Ignore padding
}
}
impl Eq for __c_anonymous_uc_sigmask_with_padding {}
impl ::fmt::Debug for __c_anonymous_uc_sigmask_with_padding {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("uc_sigmask_with_padding")
.field("uc_sigmask_with_padding", &self.uc_sigmask)
// Ignore padding
.finish()
}
}
impl ::hash::Hash for __c_anonymous_uc_sigmask_with_padding {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.uc_sigmask.hash(state)
// Ignore padding
}
}
impl PartialEq for __c_anonymous_uc_sigmask {
fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool {
unsafe { self.uc_sigmask == other.uc_sigmask }
}
}
impl Eq for __c_anonymous_uc_sigmask {}
impl ::fmt::Debug for __c_anonymous_uc_sigmask {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("uc_sigmask")
.field("uc_sigmask", unsafe { &self.uc_sigmask })
.finish()
}
}
impl ::hash::Hash for __c_anonymous_uc_sigmask {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
unsafe { self.uc_sigmask.hash(state) }
}
}
impl PartialEq for ucontext_t {
fn eq(&self, other: &Self) -> bool {
self.uc_flags == other.uc_flags
&& self.uc_link == other.uc_link
&& self.uc_stack == other.uc_stack
&& self.uc_mcontext == other.uc_mcontext
&& self.uc_sigmask__c_anonymous_union
== other.uc_sigmask__c_anonymous_union
// Ignore padding field
}
}
impl Eq for ucontext_t {}
impl ::fmt::Debug for ucontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ucontext_t")
.field("uc_flags", &self.uc_flags)
.field("uc_link", &self.uc_link)
.field("uc_stack", &self.uc_stack)
.field("uc_mcontext", &self.uc_mcontext)
.field(
"uc_sigmask__c_anonymous_union",
&self.uc_sigmask__c_anonymous_union
)
// Ignore padding field
.finish()
}
}
impl ::hash::Hash for ucontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.uc_flags.hash(state);
self.uc_link.hash(state);
self.uc_stack.hash(state);
self.uc_mcontext.hash(state);
self.uc_sigmask__c_anonymous_union.hash(state);
// Ignore padding field
}
}
}
}
}
}
pub const O_DIRECT: ::c_int = 0x4000;
pub const O_DIRECTORY: ::c_int = 0x10000;
pub const O_NOFOLLOW: ::c_int = 0x20000;
pub const O_LARGEFILE: ::c_int = 0o0100000;
pub const MAP_32BIT: ::c_int = 0x40;
// Syscall table
pub const SYS_restart_syscall: ::c_long = 0;
pub const SYS_exit: ::c_long = 1;
pub const SYS_fork: ::c_long = 2;
pub const SYS_read: ::c_long = 3;
pub const SYS_write: ::c_long = 4;
pub const SYS_open: ::c_long = 5;
pub const SYS_close: ::c_long = 6;
pub const SYS_waitpid: ::c_long = 7;
pub const SYS_creat: ::c_long = 8;
pub const SYS_link: ::c_long = 9;
pub const SYS_unlink: ::c_long = 10;
pub const SYS_execve: ::c_long = 11;
pub const SYS_chdir: ::c_long = 12;
pub const SYS_time: ::c_long = 13;
pub const SYS_mknod: ::c_long = 14;
pub const SYS_chmod: ::c_long = 15;
pub const SYS_lchown: ::c_long = 16;
pub const SYS_break: ::c_long = 17;
pub const SYS_oldstat: ::c_long = 18;
pub const SYS_lseek: ::c_long = 19;
pub const SYS_getpid: ::c_long = 20;
pub const SYS_mount: ::c_long = 21;
pub const SYS_umount: ::c_long = 22;
pub const SYS_setuid: ::c_long = 23;
pub const SYS_getuid: ::c_long = 24;
pub const SYS_stime: ::c_long = 25;
pub const SYS_ptrace: ::c_long = 26;
pub const SYS_alarm: ::c_long = 27;
pub const SYS_oldfstat: ::c_long = 28;
pub const SYS_pause: ::c_long = 29;
pub const SYS_utime: ::c_long = 30;
pub const SYS_stty: ::c_long = 31;
pub const SYS_gtty: ::c_long = 32;
pub const SYS_access: ::c_long = 33;
pub const SYS_nice: ::c_long = 34;
pub const SYS_ftime: ::c_long = 35;
pub const SYS_sync: ::c_long = 36;
pub const SYS_kill: ::c_long = 37;
pub const SYS_rename: ::c_long = 38;
pub const SYS_mkdir: ::c_long = 39;
pub const SYS_rmdir: ::c_long = 40;
pub const SYS_dup: ::c_long = 41;
pub const SYS_pipe: ::c_long = 42;
pub const SYS_times: ::c_long = 43;
pub const SYS_prof: ::c_long = 44;
pub const SYS_brk: ::c_long = 45;
pub const SYS_setgid: ::c_long = 46;
pub const SYS_getgid: ::c_long = 47;
pub const SYS_signal: ::c_long = 48;
pub const SYS_geteuid: ::c_long = 49;
pub const SYS_getegid: ::c_long = 50;
pub const SYS_acct: ::c_long = 51;
pub const SYS_umount2: ::c_long = 52;
pub const SYS_lock: ::c_long = 53;
pub const SYS_ioctl: ::c_long = 54;
pub const SYS_fcntl: ::c_long = 55;
pub const SYS_mpx: ::c_long = 56;
pub const SYS_setpgid: ::c_long = 57;
pub const SYS_ulimit: ::c_long = 58;
pub const SYS_oldolduname: ::c_long = 59;
pub const SYS_umask: ::c_long = 60;
pub const SYS_chroot: ::c_long = 61;
pub const SYS_ustat: ::c_long = 62;
pub const SYS_dup2: ::c_long = 63;
pub const SYS_getppid: ::c_long = 64;
pub const SYS_getpgrp: ::c_long = 65;
pub const SYS_setsid: ::c_long = 66;
pub const SYS_sigaction: ::c_long = 67;
pub const SYS_sgetmask: ::c_long = 68;
pub const SYS_ssetmask: ::c_long = 69;
pub const SYS_setreuid: ::c_long = 70;
pub const SYS_setregid: ::c_long = 71;
pub const SYS_sigsuspend: ::c_long = 72;
pub const SYS_sigpending: ::c_long = 73;
pub const SYS_sethostname: ::c_long = 74;
pub const SYS_setrlimit: ::c_long = 75;
pub const SYS_getrlimit: ::c_long = 76;
pub const SYS_getrusage: ::c_long = 77;
pub const SYS_gettimeofday: ::c_long = 78;
pub const SYS_settimeofday: ::c_long = 79;
pub const SYS_getgroups: ::c_long = 80;
pub const SYS_setgroups: ::c_long = 81;
pub const SYS_select: ::c_long = 82;
pub const SYS_symlink: ::c_long = 83;
pub const SYS_oldlstat: ::c_long = 84;
pub const SYS_readlink: ::c_long = 85;
pub const SYS_uselib: ::c_long = 86;
pub const SYS_swapon: ::c_long = 87;
pub const SYS_reboot: ::c_long = 88;
pub const SYS_readdir: ::c_long = 89;
pub const SYS_mmap: ::c_long = 90;
pub const SYS_munmap: ::c_long = 91;
pub const SYS_truncate: ::c_long = 92;
pub const SYS_ftruncate: ::c_long = 93;
pub const SYS_fchmod: ::c_long = 94;
pub const SYS_fchown: ::c_long = 95;
pub const SYS_getpriority: ::c_long = 96;
pub const SYS_setpriority: ::c_long = 97;
pub const SYS_profil: ::c_long = 98;
pub const SYS_statfs: ::c_long = 99;
pub const SYS_fstatfs: ::c_long = 100;
pub const SYS_ioperm: ::c_long = 101;
pub const SYS_socketcall: ::c_long = 102;
pub const SYS_syslog: ::c_long = 103;
pub const SYS_setitimer: ::c_long = 104;
pub const SYS_getitimer: ::c_long = 105;
pub const SYS_stat: ::c_long = 106;
pub const SYS_lstat: ::c_long = 107;
pub const SYS_fstat: ::c_long = 108;
pub const SYS_olduname: ::c_long = 109;
pub const SYS_iopl: ::c_long = 110;
pub const SYS_vhangup: ::c_long = 111;
pub const SYS_idle: ::c_long = 112;
pub const SYS_vm86old: ::c_long = 113;
pub const SYS_wait4: ::c_long = 114;
pub const SYS_swapoff: ::c_long = 115;
pub const SYS_sysinfo: ::c_long = 116;
pub const SYS_ipc: ::c_long = 117;
pub const SYS_fsync: ::c_long = 118;
pub const SYS_sigreturn: ::c_long = 119;
pub const SYS_clone: ::c_long = 120;
pub const SYS_setdomainname: ::c_long = 121;
pub const SYS_uname: ::c_long = 122;
pub const SYS_modify_ldt: ::c_long = 123;
pub const SYS_adjtimex: ::c_long = 124;
pub const SYS_mprotect: ::c_long = 125;
pub const SYS_sigprocmask: ::c_long = 126;
pub const SYS_create_module: ::c_long = 127;
pub const SYS_init_module: ::c_long = 128;
pub const SYS_delete_module: ::c_long = 129;
pub const SYS_get_kernel_syms: ::c_long = 130;
pub const SYS_quotactl: ::c_long = 131;
pub const SYS_getpgid: ::c_long = 132;
pub const SYS_fchdir: ::c_long = 133;
pub const SYS_bdflush: ::c_long = 134;
pub const SYS_sysfs: ::c_long = 135;
pub const SYS_personality: ::c_long = 136;
pub const SYS_afs_syscall: ::c_long = 137;
pub const SYS_setfsuid: ::c_long = 138;
pub const SYS_setfsgid: ::c_long = 139;
// FIXME: SYS__llseek is in the NDK sources but for some reason is
// not available in the tests
// pub const SYS__llseek: ::c_long = 140;
pub const SYS_getdents: ::c_long = 141;
// FIXME: SYS__newselect is in the NDK sources but for some reason is
// not available in the tests
// pub const SYS__newselect: ::c_long = 142;
pub const SYS_flock: ::c_long = 143;
pub const SYS_msync: ::c_long = 144;
pub const SYS_readv: ::c_long = 145;
pub const SYS_writev: ::c_long = 146;
pub const SYS_getsid: ::c_long = 147;
pub const SYS_fdatasync: ::c_long = 148;
// FIXME: SYS__llseek is in the NDK sources but for some reason is
// not available in the tests
// pub const SYS__sysctl: ::c_long = 149;
pub const SYS_mlock: ::c_long = 150;
pub const SYS_munlock: ::c_long = 151;
pub const SYS_mlockall: ::c_long = 152;
pub const SYS_munlockall: ::c_long = 153;
pub const SYS_sched_setparam: ::c_long = 154;
pub const SYS_sched_getparam: ::c_long = 155;
pub const SYS_sched_setscheduler: ::c_long = 156;
pub const SYS_sched_getscheduler: ::c_long = 157;
pub const SYS_sched_yield: ::c_long = 158;
pub const SYS_sched_get_priority_max: ::c_long = 159;
pub const SYS_sched_get_priority_min: ::c_long = 160;
pub const SYS_sched_rr_get_interval: ::c_long = 161;
pub const SYS_nanosleep: ::c_long = 162;
pub const SYS_mremap: ::c_long = 163;
pub const SYS_setresuid: ::c_long = 164;
pub const SYS_getresuid: ::c_long = 165;
pub const SYS_vm86: ::c_long = 166;
pub const SYS_query_module: ::c_long = 167;
pub const SYS_poll: ::c_long = 168;
pub const SYS_nfsservctl: ::c_long = 169;
pub const SYS_setresgid: ::c_long = 170;
pub const SYS_getresgid: ::c_long = 171;
pub const SYS_prctl: ::c_long = 172;
pub const SYS_rt_sigreturn: ::c_long = 173;
pub const SYS_rt_sigaction: ::c_long = 174;
pub const SYS_rt_sigprocmask: ::c_long = 175;
pub const SYS_rt_sigpending: ::c_long = 176;
pub const SYS_rt_sigtimedwait: ::c_long = 177;
pub const SYS_rt_sigqueueinfo: ::c_long = 178;
pub const SYS_rt_sigsuspend: ::c_long = 179;
pub const SYS_pread64: ::c_long = 180;
pub const SYS_pwrite64: ::c_long = 181;
pub const SYS_chown: ::c_long = 182;
pub const SYS_getcwd: ::c_long = 183;
pub const SYS_capget: ::c_long = 184;
pub const SYS_capset: ::c_long = 185;
pub const SYS_sigaltstack: ::c_long = 186;
pub const SYS_sendfile: ::c_long = 187;
pub const SYS_getpmsg: ::c_long = 188;
pub const SYS_putpmsg: ::c_long = 189;
pub const SYS_vfork: ::c_long = 190;
pub const SYS_ugetrlimit: ::c_long = 191;
pub const SYS_mmap2: ::c_long = 192;
pub const SYS_truncate64: ::c_long = 193;
pub const SYS_ftruncate64: ::c_long = 194;
pub const SYS_stat64: ::c_long = 195;
pub const SYS_lstat64: ::c_long = 196;
pub const SYS_fstat64: ::c_long = 197;
pub const SYS_lchown32: ::c_long = 198;
pub const SYS_getuid32: ::c_long = 199;
pub const SYS_getgid32: ::c_long = 200;
pub const SYS_geteuid32: ::c_long = 201;
pub const SYS_getegid32: ::c_long = 202;
pub const SYS_setreuid32: ::c_long = 203;
pub const SYS_setregid32: ::c_long = 204;
pub const SYS_getgroups32: ::c_long = 205;
pub const SYS_setgroups32: ::c_long = 206;
pub const SYS_fchown32: ::c_long = 207;
pub const SYS_setresuid32: ::c_long = 208;
pub const SYS_getresuid32: ::c_long = 209;
pub const SYS_setresgid32: ::c_long = 210;
pub const SYS_getresgid32: ::c_long = 211;
pub const SYS_chown32: ::c_long = 212;
pub const SYS_setuid32: ::c_long = 213;
pub const SYS_setgid32: ::c_long = 214;
pub const SYS_setfsuid32: ::c_long = 215;
pub const SYS_setfsgid32: ::c_long = 216;
pub const SYS_pivot_root: ::c_long = 217;
pub const SYS_mincore: ::c_long = 218;
pub const SYS_madvise: ::c_long = 219;
pub const SYS_getdents64: ::c_long = 220;
pub const SYS_fcntl64: ::c_long = 221;
pub const SYS_gettid: ::c_long = 224;
pub const SYS_readahead: ::c_long = 225;
pub const SYS_setxattr: ::c_long = 226;
pub const SYS_lsetxattr: ::c_long = 227;
pub const SYS_fsetxattr: ::c_long = 228;
pub const SYS_getxattr: ::c_long = 229;
pub const SYS_lgetxattr: ::c_long = 230;
pub const SYS_fgetxattr: ::c_long = 231;
pub const SYS_listxattr: ::c_long = 232;
pub const SYS_llistxattr: ::c_long = 233;
pub const SYS_flistxattr: ::c_long = 234;
pub const SYS_removexattr: ::c_long = 235;
pub const SYS_lremovexattr: ::c_long = 236;
pub const SYS_fremovexattr: ::c_long = 237;
pub const SYS_tkill: ::c_long = 238;
pub const SYS_sendfile64: ::c_long = 239;
pub const SYS_futex: ::c_long = 240;
pub const SYS_sched_setaffinity: ::c_long = 241;
pub const SYS_sched_getaffinity: ::c_long = 242;
pub const SYS_set_thread_area: ::c_long = 243;
pub const SYS_get_thread_area: ::c_long = 244;
pub const SYS_io_setup: ::c_long = 245;
pub const SYS_io_destroy: ::c_long = 246;
pub const SYS_io_getevents: ::c_long = 247;
pub const SYS_io_submit: ::c_long = 248;
pub const SYS_io_cancel: ::c_long = 249;
pub const SYS_fadvise64: ::c_long = 250;
pub const SYS_exit_group: ::c_long = 252;
pub const SYS_lookup_dcookie: ::c_long = 253;
pub const SYS_epoll_create: ::c_long = 254;
pub const SYS_epoll_ctl: ::c_long = 255;
pub const SYS_epoll_wait: ::c_long = 256;
pub const SYS_remap_file_pages: ::c_long = 257;
pub const SYS_set_tid_address: ::c_long = 258;
pub const SYS_timer_create: ::c_long = 259;
pub const SYS_timer_settime: ::c_long = 260;
pub const SYS_timer_gettime: ::c_long = 261;
pub const SYS_timer_getoverrun: ::c_long = 262;
pub const SYS_timer_delete: ::c_long = 263;
pub const SYS_clock_settime: ::c_long = 264;
pub const SYS_clock_gettime: ::c_long = 265;
pub const SYS_clock_getres: ::c_long = 266;
pub const SYS_clock_nanosleep: ::c_long = 267;
pub const SYS_statfs64: ::c_long = 268;
pub const SYS_fstatfs64: ::c_long = 269;
pub const SYS_tgkill: ::c_long = 270;
pub const SYS_utimes: ::c_long = 271;
pub const SYS_fadvise64_64: ::c_long = 272;
pub const SYS_vserver: ::c_long = 273;
pub const SYS_mbind: ::c_long = 274;
pub const SYS_get_mempolicy: ::c_long = 275;
pub const SYS_set_mempolicy: ::c_long = 276;
pub const SYS_mq_open: ::c_long = 277;
pub const SYS_mq_unlink: ::c_long = 278;
pub const SYS_mq_timedsend: ::c_long = 279;
pub const SYS_mq_timedreceive: ::c_long = 280;
pub const SYS_mq_notify: ::c_long = 281;
pub const SYS_mq_getsetattr: ::c_long = 282;
pub const SYS_kexec_load: ::c_long = 283;
pub const SYS_waitid: ::c_long = 284;
pub const SYS_add_key: ::c_long = 286;
pub const SYS_request_key: ::c_long = 287;
pub const SYS_keyctl: ::c_long = 288;
pub const SYS_ioprio_set: ::c_long = 289;
pub const SYS_ioprio_get: ::c_long = 290;
pub const SYS_inotify_init: ::c_long = 291;
pub const SYS_inotify_add_watch: ::c_long = 292;
pub const SYS_inotify_rm_watch: ::c_long = 293;
pub const SYS_migrate_pages: ::c_long = 294;
pub const SYS_openat: ::c_long = 295;
pub const SYS_mkdirat: ::c_long = 296;
pub const SYS_mknodat: ::c_long = 297;
pub const SYS_fchownat: ::c_long = 298;
pub const SYS_futimesat: ::c_long = 299;
pub const SYS_fstatat64: ::c_long = 300;
pub const SYS_unlinkat: ::c_long = 301;
pub const SYS_renameat: ::c_long = 302;
pub const SYS_linkat: ::c_long = 303;
pub const SYS_symlinkat: ::c_long = 304;
pub const SYS_readlinkat: ::c_long = 305;
pub const SYS_fchmodat: ::c_long = 306;
pub const SYS_faccessat: ::c_long = 307;
pub const SYS_pselect6: ::c_long = 308;
pub const SYS_ppoll: ::c_long = 309;
pub const SYS_unshare: ::c_long = 310;
pub const SYS_set_robust_list: ::c_long = 311;
pub const SYS_get_robust_list: ::c_long = 312;
pub const SYS_splice: ::c_long = 313;
pub const SYS_sync_file_range: ::c_long = 314;
pub const SYS_tee: ::c_long = 315;
pub const SYS_vmsplice: ::c_long = 316;
pub const SYS_move_pages: ::c_long = 317;
pub const SYS_getcpu: ::c_long = 318;
pub const SYS_epoll_pwait: ::c_long = 319;
pub const SYS_utimensat: ::c_long = 320;
pub const SYS_signalfd: ::c_long = 321;
pub const SYS_timerfd_create: ::c_long = 322;
pub const SYS_eventfd: ::c_long = 323;
pub const SYS_fallocate: ::c_long = 324;
pub const SYS_timerfd_settime: ::c_long = 325;
pub const SYS_timerfd_gettime: ::c_long = 326;
pub const SYS_signalfd4: ::c_long = 327;
pub const SYS_eventfd2: ::c_long = 328;
pub const SYS_epoll_create1: ::c_long = 329;
pub const SYS_dup3: ::c_long = 330;
pub const SYS_pipe2: ::c_long = 331;
pub const SYS_inotify_init1: ::c_long = 332;
pub const SYS_preadv: ::c_long = 333;
pub const SYS_pwritev: ::c_long = 334;
pub const SYS_rt_tgsigqueueinfo: ::c_long = 335;
pub const SYS_perf_event_open: ::c_long = 336;
pub const SYS_recvmmsg: ::c_long = 337;
pub const SYS_fanotify_init: ::c_long = 338;
pub const SYS_fanotify_mark: ::c_long = 339;
pub const SYS_prlimit64: ::c_long = 340;
pub const SYS_name_to_handle_at: ::c_long = 341;
pub const SYS_open_by_handle_at: ::c_long = 342;
pub const SYS_clock_adjtime: ::c_long = 343;
pub const SYS_syncfs: ::c_long = 344;
pub const SYS_sendmmsg: ::c_long = 345;
pub const SYS_setns: ::c_long = 346;
pub const SYS_process_vm_readv: ::c_long = 347;
pub const SYS_process_vm_writev: ::c_long = 348;
pub const SYS_kcmp: ::c_long = 349;
pub const SYS_finit_module: ::c_long = 350;
pub const SYS_sched_setattr: ::c_long = 351;
pub const SYS_sched_getattr: ::c_long = 352;
pub const SYS_renameat2: ::c_long = 353;
pub const SYS_seccomp: ::c_long = 354;
pub const SYS_getrandom: ::c_long = 355;
pub const SYS_memfd_create: ::c_long = 356;
pub const SYS_bpf: ::c_long = 357;
pub const SYS_execveat: ::c_long = 358;
pub const SYS_socket: ::c_long = 359;
pub const SYS_socketpair: ::c_long = 360;
pub const SYS_bind: ::c_long = 361;
pub const SYS_connect: ::c_long = 362;
pub const SYS_listen: ::c_long = 363;
pub const SYS_accept4: ::c_long = 364;
pub const SYS_getsockopt: ::c_long = 365;
pub const SYS_setsockopt: ::c_long = 366;
pub const SYS_getsockname: ::c_long = 367;
pub const SYS_getpeername: ::c_long = 368;
pub const SYS_sendto: ::c_long = 369;
pub const SYS_sendmsg: ::c_long = 370;
pub const SYS_recvfrom: ::c_long = 371;
pub const SYS_recvmsg: ::c_long = 372;
pub const SYS_shutdown: ::c_long = 373;
pub const SYS_userfaultfd: ::c_long = 374;
pub const SYS_membarrier: ::c_long = 375;
pub const SYS_mlock2: ::c_long = 376;
pub const SYS_copy_file_range: ::c_long = 377;
pub const SYS_preadv2: ::c_long = 378;
pub const SYS_pwritev2: ::c_long = 379;
pub const SYS_pkey_mprotect: ::c_long = 380;
pub const SYS_pkey_alloc: ::c_long = 381;
pub const SYS_pkey_free: ::c_long = 382;
pub const SYS_statx: ::c_long = 383;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
pub const SYS_open_tree: ::c_long = 428;
pub const SYS_move_mount: ::c_long = 429;
pub const SYS_fsopen: ::c_long = 430;
pub const SYS_fsconfig: ::c_long = 431;
pub const SYS_fsmount: ::c_long = 432;
pub const SYS_fspick: ::c_long = 433;
// offsets in user_regs_structs, from sys/reg.h
pub const EBX: ::c_int = 0;
pub const ECX: ::c_int = 1;
pub const EDX: ::c_int = 2;
pub const ESI: ::c_int = 3;
pub const EDI: ::c_int = 4;
pub const EBP: ::c_int = 5;
pub const EAX: ::c_int = 6;
pub const DS: ::c_int = 7;
pub const ES: ::c_int = 8;
pub const FS: ::c_int = 9;
pub const GS: ::c_int = 10;
pub const ORIG_EAX: ::c_int = 11;
pub const EIP: ::c_int = 12;
pub const CS: ::c_int = 13;
pub const EFL: ::c_int = 14;
pub const UESP: ::c_int = 15;
pub const SS: ::c_int = 16;
// offsets in mcontext_t.gregs from sys/ucontext.h
pub const REG_GS: ::c_int = 0;
pub const REG_FS: ::c_int = 1;
pub const REG_ES: ::c_int = 2;
pub const REG_DS: ::c_int = 3;
pub const REG_EDI: ::c_int = 4;
pub const REG_ESI: ::c_int = 5;
pub const REG_EBP: ::c_int = 6;
pub const REG_ESP: ::c_int = 7;
pub const REG_EBX: ::c_int = 8;
pub const REG_EDX: ::c_int = 9;
pub const REG_ECX: ::c_int = 10;
pub const REG_EAX: ::c_int = 11;
pub const REG_TRAPNO: ::c_int = 12;
pub const REG_ERR: ::c_int = 13;
pub const REG_EIP: ::c_int = 14;
pub const REG_CS: ::c_int = 15;
pub const REG_EFL: ::c_int = 16;
pub const REG_UESP: ::c_int = 17;
pub const REG_SS: ::c_int = 18;
// From NDK's asm/auxvec.h
pub const AT_SYSINFO: ::c_ulong = 32;
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 3;
// socketcall values from linux/net.h (only the needed ones, and not public)
const SYS_ACCEPT4: ::c_int = 18;
f! {
// Sadly, Android before 5.0 (API level 21), the accept4 syscall is not
// exposed by the libc. As work-around, we implement it as raw syscall.
// Note that for x86, the `accept4` syscall is not available either,
// and we must use the `socketcall` syscall instead.
// This workaround can be removed if the minimum Android version is bumped.
// When the workaround is removed, `accept4` can be moved back
// to `linux_like/mod.rs`
pub fn accept4(
fd: ::c_int,
addr: *mut ::sockaddr,
len: *mut ::socklen_t,
flg: ::c_int
) -> ::c_int {
// Arguments are passed as array of `long int`
// (which is big enough on x86 for a pointer).
let mut args = [
fd as ::c_long,
addr as ::c_long,
len as ::c_long,
flg as ::c_long,
];
::syscall(SYS_socketcall, SYS_ACCEPT4, args[..].as_mut_ptr())
}
}
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}

View file

@ -0,0 +1,29 @@
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(16))]
pub struct max_align_t {
priv_: [f32; 8]
}
}
s! {
pub struct ucontext_t {
pub uc_flags: ::c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: ::stack_t,
pub uc_sigmask: ::sigset_t,
pub uc_mcontext: mcontext_t,
}
#[repr(align(16))]
pub struct mcontext_t {
pub fault_address: ::c_ulonglong,
pub regs: [::c_ulonglong; 31],
pub sp: ::c_ulonglong,
pub pc: ::c_ulonglong,
pub pstate: ::c_ulonglong,
// nested arrays to get the right size/length while being able to
// auto-derive traits like Debug
__reserved: [[u64; 32]; 16],
}
}

View file

@ -0,0 +1,7 @@
s! {
pub struct user_fpsimd_struct {
pub vregs: [::__uint128_t; 32],
pub fpsr: u32,
pub fpcr: u32,
}
}

View file

@ -0,0 +1,436 @@
pub type c_char = u8;
pub type wchar_t = u32;
pub type __u64 = ::c_ulonglong;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::c_uint,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
__pad1: ::c_ulong,
pub st_size: ::off64_t,
pub st_blksize: ::c_int,
__pad2: ::c_int,
pub st_blocks: ::c_long,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__unused4: ::c_uint,
__unused5: ::c_uint,
}
pub struct stat64 {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::c_uint,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
__pad1: ::c_ulong,
pub st_size: ::off64_t,
pub st_blksize: ::c_int,
__pad2: ::c_int,
pub st_blocks: ::c_long,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__unused4: ::c_uint,
__unused5: ::c_uint,
}
pub struct user_regs_struct {
pub regs: [u64; 31],
pub sp: u64,
pub pc: u64,
pub pstate: u64,
}
}
pub const O_DIRECT: ::c_int = 0x10000;
pub const O_DIRECTORY: ::c_int = 0x4000;
pub const O_NOFOLLOW: ::c_int = 0x8000;
pub const O_LARGEFILE: ::c_int = 0o400000;
pub const SIGSTKSZ: ::size_t = 16384;
pub const MINSIGSTKSZ: ::size_t = 5120;
// From NDK's asm/hwcap.h
pub const HWCAP_FP: ::c_ulong = 1 << 0;
pub const HWCAP_ASIMD: ::c_ulong = 1 << 1;
pub const HWCAP_EVTSTRM: ::c_ulong = 1 << 2;
pub const HWCAP_AES: ::c_ulong = 1 << 3;
pub const HWCAP_PMULL: ::c_ulong = 1 << 4;
pub const HWCAP_SHA1: ::c_ulong = 1 << 5;
pub const HWCAP_SHA2: ::c_ulong = 1 << 6;
pub const HWCAP_CRC32: ::c_ulong = 1 << 7;
pub const HWCAP_ATOMICS: ::c_ulong = 1 << 8;
pub const HWCAP_FPHP: ::c_ulong = 1 << 9;
pub const HWCAP_ASIMDHP: ::c_ulong = 1 << 10;
pub const HWCAP_CPUID: ::c_ulong = 1 << 11;
pub const HWCAP_ASIMDRDM: ::c_ulong = 1 << 12;
pub const HWCAP_JSCVT: ::c_ulong = 1 << 13;
pub const HWCAP_FCMA: ::c_ulong = 1 << 14;
pub const HWCAP_LRCPC: ::c_ulong = 1 << 15;
pub const HWCAP_DCPOP: ::c_ulong = 1 << 16;
pub const HWCAP_SHA3: ::c_ulong = 1 << 17;
pub const HWCAP_SM3: ::c_ulong = 1 << 18;
pub const HWCAP_SM4: ::c_ulong = 1 << 19;
pub const HWCAP_ASIMDDP: ::c_ulong = 1 << 20;
pub const HWCAP_SHA512: ::c_ulong = 1 << 21;
pub const HWCAP_SVE: ::c_ulong = 1 << 22;
pub const HWCAP_ASIMDFHM: ::c_ulong = 1 << 23;
pub const HWCAP_DIT: ::c_ulong = 1 << 24;
pub const HWCAP_USCAT: ::c_ulong = 1 << 25;
pub const HWCAP_ILRCPC: ::c_ulong = 1 << 26;
pub const HWCAP_FLAGM: ::c_ulong = 1 << 27;
pub const HWCAP_SSBS: ::c_ulong = 1 << 28;
pub const HWCAP_SB: ::c_ulong = 1 << 29;
pub const HWCAP_PACA: ::c_ulong = 1 << 30;
pub const HWCAP_PACG: ::c_ulong = 1 << 31;
pub const HWCAP2_DCPODP: ::c_ulong = 1 << 0;
pub const HWCAP2_SVE2: ::c_ulong = 1 << 1;
pub const HWCAP2_SVEAES: ::c_ulong = 1 << 2;
pub const HWCAP2_SVEPMULL: ::c_ulong = 1 << 3;
pub const HWCAP2_SVEBITPERM: ::c_ulong = 1 << 4;
pub const HWCAP2_SVESHA3: ::c_ulong = 1 << 5;
pub const HWCAP2_SVESM4: ::c_ulong = 1 << 6;
pub const HWCAP2_FLAGM2: ::c_ulong = 1 << 7;
pub const HWCAP2_FRINT: ::c_ulong = 1 << 8;
pub const HWCAP2_SVEI8MM: ::c_ulong = 1 << 9;
pub const HWCAP2_SVEF32MM: ::c_ulong = 1 << 10;
pub const HWCAP2_SVEF64MM: ::c_ulong = 1 << 11;
pub const HWCAP2_SVEBF16: ::c_ulong = 1 << 12;
pub const HWCAP2_I8MM: ::c_ulong = 1 << 13;
pub const HWCAP2_BF16: ::c_ulong = 1 << 14;
pub const HWCAP2_DGH: ::c_ulong = 1 << 15;
pub const HWCAP2_RNG: ::c_ulong = 1 << 16;
pub const HWCAP2_BTI: ::c_ulong = 1 << 17;
pub const HWCAP2_MTE: ::c_ulong = 1 << 18;
pub const HWCAP2_ECV: ::c_ulong = 1 << 19;
pub const HWCAP2_AFP: ::c_ulong = 1 << 20;
pub const HWCAP2_RPRES: ::c_ulong = 1 << 21;
pub const HWCAP2_MTE3: ::c_ulong = 1 << 22;
pub const HWCAP2_SME: ::c_ulong = 1 << 23;
pub const HWCAP2_SME_I16I64: ::c_ulong = 1 << 24;
pub const HWCAP2_SME_F64F64: ::c_ulong = 1 << 25;
pub const HWCAP2_SME_I8I32: ::c_ulong = 1 << 26;
pub const HWCAP2_SME_F16F32: ::c_ulong = 1 << 27;
pub const HWCAP2_SME_B16F32: ::c_ulong = 1 << 28;
pub const HWCAP2_SME_F32F32: ::c_ulong = 1 << 29;
pub const HWCAP2_SME_FA64: ::c_ulong = 1 << 30;
pub const HWCAP2_WFXT: ::c_ulong = 1 << 31;
pub const HWCAP2_EBF16: ::c_ulong = 1 << 32;
pub const HWCAP2_SVE_EBF16: ::c_ulong = 1 << 33;
pub const SYS_io_setup: ::c_long = 0;
pub const SYS_io_destroy: ::c_long = 1;
pub const SYS_io_submit: ::c_long = 2;
pub const SYS_io_cancel: ::c_long = 3;
pub const SYS_io_getevents: ::c_long = 4;
pub const SYS_setxattr: ::c_long = 5;
pub const SYS_lsetxattr: ::c_long = 6;
pub const SYS_fsetxattr: ::c_long = 7;
pub const SYS_getxattr: ::c_long = 8;
pub const SYS_lgetxattr: ::c_long = 9;
pub const SYS_fgetxattr: ::c_long = 10;
pub const SYS_listxattr: ::c_long = 11;
pub const SYS_llistxattr: ::c_long = 12;
pub const SYS_flistxattr: ::c_long = 13;
pub const SYS_removexattr: ::c_long = 14;
pub const SYS_lremovexattr: ::c_long = 15;
pub const SYS_fremovexattr: ::c_long = 16;
pub const SYS_getcwd: ::c_long = 17;
pub const SYS_lookup_dcookie: ::c_long = 18;
pub const SYS_eventfd2: ::c_long = 19;
pub const SYS_epoll_create1: ::c_long = 20;
pub const SYS_epoll_ctl: ::c_long = 21;
pub const SYS_epoll_pwait: ::c_long = 22;
pub const SYS_dup: ::c_long = 23;
pub const SYS_dup3: ::c_long = 24;
pub const SYS_fcntl: ::c_long = 25;
pub const SYS_inotify_init1: ::c_long = 26;
pub const SYS_inotify_add_watch: ::c_long = 27;
pub const SYS_inotify_rm_watch: ::c_long = 28;
pub const SYS_ioctl: ::c_long = 29;
pub const SYS_ioprio_set: ::c_long = 30;
pub const SYS_ioprio_get: ::c_long = 31;
pub const SYS_flock: ::c_long = 32;
pub const SYS_mknodat: ::c_long = 33;
pub const SYS_mkdirat: ::c_long = 34;
pub const SYS_unlinkat: ::c_long = 35;
pub const SYS_symlinkat: ::c_long = 36;
pub const SYS_linkat: ::c_long = 37;
pub const SYS_renameat: ::c_long = 38;
pub const SYS_umount2: ::c_long = 39;
pub const SYS_mount: ::c_long = 40;
pub const SYS_pivot_root: ::c_long = 41;
pub const SYS_nfsservctl: ::c_long = 42;
pub const SYS_fallocate: ::c_long = 47;
pub const SYS_faccessat: ::c_long = 48;
pub const SYS_chdir: ::c_long = 49;
pub const SYS_fchdir: ::c_long = 50;
pub const SYS_chroot: ::c_long = 51;
pub const SYS_fchmod: ::c_long = 52;
pub const SYS_fchmodat: ::c_long = 53;
pub const SYS_fchownat: ::c_long = 54;
pub const SYS_fchown: ::c_long = 55;
pub const SYS_openat: ::c_long = 56;
pub const SYS_close: ::c_long = 57;
pub const SYS_vhangup: ::c_long = 58;
pub const SYS_pipe2: ::c_long = 59;
pub const SYS_quotactl: ::c_long = 60;
pub const SYS_getdents64: ::c_long = 61;
pub const SYS_lseek: ::c_long = 62;
pub const SYS_read: ::c_long = 63;
pub const SYS_write: ::c_long = 64;
pub const SYS_readv: ::c_long = 65;
pub const SYS_writev: ::c_long = 66;
pub const SYS_pread64: ::c_long = 67;
pub const SYS_pwrite64: ::c_long = 68;
pub const SYS_preadv: ::c_long = 69;
pub const SYS_pwritev: ::c_long = 70;
pub const SYS_pselect6: ::c_long = 72;
pub const SYS_ppoll: ::c_long = 73;
pub const SYS_signalfd4: ::c_long = 74;
pub const SYS_vmsplice: ::c_long = 75;
pub const SYS_splice: ::c_long = 76;
pub const SYS_tee: ::c_long = 77;
pub const SYS_readlinkat: ::c_long = 78;
pub const SYS_sync: ::c_long = 81;
pub const SYS_fsync: ::c_long = 82;
pub const SYS_fdatasync: ::c_long = 83;
pub const SYS_sync_file_range: ::c_long = 84;
pub const SYS_timerfd_create: ::c_long = 85;
pub const SYS_timerfd_settime: ::c_long = 86;
pub const SYS_timerfd_gettime: ::c_long = 87;
pub const SYS_utimensat: ::c_long = 88;
pub const SYS_acct: ::c_long = 89;
pub const SYS_capget: ::c_long = 90;
pub const SYS_capset: ::c_long = 91;
pub const SYS_personality: ::c_long = 92;
pub const SYS_exit: ::c_long = 93;
pub const SYS_exit_group: ::c_long = 94;
pub const SYS_waitid: ::c_long = 95;
pub const SYS_set_tid_address: ::c_long = 96;
pub const SYS_unshare: ::c_long = 97;
pub const SYS_futex: ::c_long = 98;
pub const SYS_set_robust_list: ::c_long = 99;
pub const SYS_get_robust_list: ::c_long = 100;
pub const SYS_nanosleep: ::c_long = 101;
pub const SYS_getitimer: ::c_long = 102;
pub const SYS_setitimer: ::c_long = 103;
pub const SYS_kexec_load: ::c_long = 104;
pub const SYS_init_module: ::c_long = 105;
pub const SYS_delete_module: ::c_long = 106;
pub const SYS_timer_create: ::c_long = 107;
pub const SYS_timer_gettime: ::c_long = 108;
pub const SYS_timer_getoverrun: ::c_long = 109;
pub const SYS_timer_settime: ::c_long = 110;
pub const SYS_timer_delete: ::c_long = 111;
pub const SYS_clock_settime: ::c_long = 112;
pub const SYS_clock_gettime: ::c_long = 113;
pub const SYS_clock_getres: ::c_long = 114;
pub const SYS_clock_nanosleep: ::c_long = 115;
pub const SYS_syslog: ::c_long = 116;
pub const SYS_ptrace: ::c_long = 117;
pub const SYS_sched_setparam: ::c_long = 118;
pub const SYS_sched_setscheduler: ::c_long = 119;
pub const SYS_sched_getscheduler: ::c_long = 120;
pub const SYS_sched_getparam: ::c_long = 121;
pub const SYS_sched_setaffinity: ::c_long = 122;
pub const SYS_sched_getaffinity: ::c_long = 123;
pub const SYS_sched_yield: ::c_long = 124;
pub const SYS_sched_get_priority_max: ::c_long = 125;
pub const SYS_sched_get_priority_min: ::c_long = 126;
pub const SYS_sched_rr_get_interval: ::c_long = 127;
pub const SYS_restart_syscall: ::c_long = 128;
pub const SYS_kill: ::c_long = 129;
pub const SYS_tkill: ::c_long = 130;
pub const SYS_tgkill: ::c_long = 131;
pub const SYS_sigaltstack: ::c_long = 132;
pub const SYS_rt_sigsuspend: ::c_long = 133;
pub const SYS_rt_sigaction: ::c_long = 134;
pub const SYS_rt_sigprocmask: ::c_long = 135;
pub const SYS_rt_sigpending: ::c_long = 136;
pub const SYS_rt_sigtimedwait: ::c_long = 137;
pub const SYS_rt_sigqueueinfo: ::c_long = 138;
pub const SYS_rt_sigreturn: ::c_long = 139;
pub const SYS_setpriority: ::c_long = 140;
pub const SYS_getpriority: ::c_long = 141;
pub const SYS_reboot: ::c_long = 142;
pub const SYS_setregid: ::c_long = 143;
pub const SYS_setgid: ::c_long = 144;
pub const SYS_setreuid: ::c_long = 145;
pub const SYS_setuid: ::c_long = 146;
pub const SYS_setresuid: ::c_long = 147;
pub const SYS_getresuid: ::c_long = 148;
pub const SYS_setresgid: ::c_long = 149;
pub const SYS_getresgid: ::c_long = 150;
pub const SYS_setfsuid: ::c_long = 151;
pub const SYS_setfsgid: ::c_long = 152;
pub const SYS_times: ::c_long = 153;
pub const SYS_setpgid: ::c_long = 154;
pub const SYS_getpgid: ::c_long = 155;
pub const SYS_getsid: ::c_long = 156;
pub const SYS_setsid: ::c_long = 157;
pub const SYS_getgroups: ::c_long = 158;
pub const SYS_setgroups: ::c_long = 159;
pub const SYS_uname: ::c_long = 160;
pub const SYS_sethostname: ::c_long = 161;
pub const SYS_setdomainname: ::c_long = 162;
pub const SYS_getrlimit: ::c_long = 163;
pub const SYS_setrlimit: ::c_long = 164;
pub const SYS_getrusage: ::c_long = 165;
pub const SYS_umask: ::c_long = 166;
pub const SYS_prctl: ::c_long = 167;
pub const SYS_getcpu: ::c_long = 168;
pub const SYS_gettimeofday: ::c_long = 169;
pub const SYS_settimeofday: ::c_long = 170;
pub const SYS_adjtimex: ::c_long = 171;
pub const SYS_getpid: ::c_long = 172;
pub const SYS_getppid: ::c_long = 173;
pub const SYS_getuid: ::c_long = 174;
pub const SYS_geteuid: ::c_long = 175;
pub const SYS_getgid: ::c_long = 176;
pub const SYS_getegid: ::c_long = 177;
pub const SYS_gettid: ::c_long = 178;
pub const SYS_sysinfo: ::c_long = 179;
pub const SYS_mq_open: ::c_long = 180;
pub const SYS_mq_unlink: ::c_long = 181;
pub const SYS_mq_timedsend: ::c_long = 182;
pub const SYS_mq_timedreceive: ::c_long = 183;
pub const SYS_mq_notify: ::c_long = 184;
pub const SYS_mq_getsetattr: ::c_long = 185;
pub const SYS_msgget: ::c_long = 186;
pub const SYS_msgctl: ::c_long = 187;
pub const SYS_msgrcv: ::c_long = 188;
pub const SYS_msgsnd: ::c_long = 189;
pub const SYS_semget: ::c_long = 190;
pub const SYS_semctl: ::c_long = 191;
pub const SYS_semtimedop: ::c_long = 192;
pub const SYS_semop: ::c_long = 193;
pub const SYS_shmget: ::c_long = 194;
pub const SYS_shmctl: ::c_long = 195;
pub const SYS_shmat: ::c_long = 196;
pub const SYS_shmdt: ::c_long = 197;
pub const SYS_socket: ::c_long = 198;
pub const SYS_socketpair: ::c_long = 199;
pub const SYS_bind: ::c_long = 200;
pub const SYS_listen: ::c_long = 201;
pub const SYS_accept: ::c_long = 202;
pub const SYS_connect: ::c_long = 203;
pub const SYS_getsockname: ::c_long = 204;
pub const SYS_getpeername: ::c_long = 205;
pub const SYS_sendto: ::c_long = 206;
pub const SYS_recvfrom: ::c_long = 207;
pub const SYS_setsockopt: ::c_long = 208;
pub const SYS_getsockopt: ::c_long = 209;
pub const SYS_shutdown: ::c_long = 210;
pub const SYS_sendmsg: ::c_long = 211;
pub const SYS_recvmsg: ::c_long = 212;
pub const SYS_readahead: ::c_long = 213;
pub const SYS_brk: ::c_long = 214;
pub const SYS_munmap: ::c_long = 215;
pub const SYS_mremap: ::c_long = 216;
pub const SYS_add_key: ::c_long = 217;
pub const SYS_request_key: ::c_long = 218;
pub const SYS_keyctl: ::c_long = 219;
pub const SYS_clone: ::c_long = 220;
pub const SYS_execve: ::c_long = 221;
pub const SYS_mmap: ::c_long = 222;
pub const SYS_swapon: ::c_long = 224;
pub const SYS_swapoff: ::c_long = 225;
pub const SYS_mprotect: ::c_long = 226;
pub const SYS_msync: ::c_long = 227;
pub const SYS_mlock: ::c_long = 228;
pub const SYS_munlock: ::c_long = 229;
pub const SYS_mlockall: ::c_long = 230;
pub const SYS_munlockall: ::c_long = 231;
pub const SYS_mincore: ::c_long = 232;
pub const SYS_madvise: ::c_long = 233;
pub const SYS_remap_file_pages: ::c_long = 234;
pub const SYS_mbind: ::c_long = 235;
pub const SYS_get_mempolicy: ::c_long = 236;
pub const SYS_set_mempolicy: ::c_long = 237;
pub const SYS_migrate_pages: ::c_long = 238;
pub const SYS_move_pages: ::c_long = 239;
pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
pub const SYS_perf_event_open: ::c_long = 241;
pub const SYS_accept4: ::c_long = 242;
pub const SYS_recvmmsg: ::c_long = 243;
pub const SYS_arch_specific_syscall: ::c_long = 244;
pub const SYS_wait4: ::c_long = 260;
pub const SYS_prlimit64: ::c_long = 261;
pub const SYS_fanotify_init: ::c_long = 262;
pub const SYS_fanotify_mark: ::c_long = 263;
pub const SYS_name_to_handle_at: ::c_long = 264;
pub const SYS_open_by_handle_at: ::c_long = 265;
pub const SYS_clock_adjtime: ::c_long = 266;
pub const SYS_syncfs: ::c_long = 267;
pub const SYS_setns: ::c_long = 268;
pub const SYS_sendmmsg: ::c_long = 269;
pub const SYS_process_vm_readv: ::c_long = 270;
pub const SYS_process_vm_writev: ::c_long = 271;
pub const SYS_kcmp: ::c_long = 272;
pub const SYS_finit_module: ::c_long = 273;
pub const SYS_sched_setattr: ::c_long = 274;
pub const SYS_sched_getattr: ::c_long = 275;
pub const SYS_renameat2: ::c_long = 276;
pub const SYS_seccomp: ::c_long = 277;
pub const SYS_getrandom: ::c_long = 278;
pub const SYS_memfd_create: ::c_long = 279;
pub const SYS_bpf: ::c_long = 280;
pub const SYS_execveat: ::c_long = 281;
pub const SYS_userfaultfd: ::c_long = 282;
pub const SYS_membarrier: ::c_long = 283;
pub const SYS_mlock2: ::c_long = 284;
pub const SYS_copy_file_range: ::c_long = 285;
pub const SYS_preadv2: ::c_long = 286;
pub const SYS_pwritev2: ::c_long = 287;
pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
pub const SYS_statx: ::c_long = 291;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
pub const SYS_open_tree: ::c_long = 428;
pub const SYS_move_mount: ::c_long = 429;
pub const SYS_fsopen: ::c_long = 430;
pub const SYS_fsconfig: ::c_long = 431;
pub const SYS_fsmount: ::c_long = 432;
pub const SYS_fspick: ::c_long = 433;
pub const SYS_syscalls: ::c_long = 436;
pub const PROT_BTI: ::c_int = 0x10;
pub const PROT_MTE: ::c_int = 0x20;
// From NDK's asm/auxvec.h
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 2;
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}
cfg_if! {
if #[cfg(libc_int128)] {
mod int128;
pub use self::int128::*;
}
}

View file

@ -0,0 +1,330 @@
// The following definitions are correct for aarch64 and x86_64,
// but may be wrong for mips64
pub type c_long = i64;
pub type c_ulong = u64;
pub type mode_t = u32;
pub type off64_t = i64;
pub type socklen_t = u32;
s! {
pub struct sigset_t {
__val: [::c_ulong; 1],
}
pub struct sigaction {
pub sa_flags: ::c_int,
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_restorer: ::Option<extern fn()>,
}
pub struct rlimit64 {
pub rlim_cur: ::c_ulonglong,
pub rlim_max: ::c_ulonglong,
}
pub struct pthread_attr_t {
pub flags: u32,
pub stack_base: *mut ::c_void,
pub stack_size: ::size_t,
pub guard_size: ::size_t,
pub sched_policy: i32,
pub sched_priority: i32,
__reserved: [::c_char; 16],
}
pub struct passwd {
pub pw_name: *mut ::c_char,
pub pw_passwd: *mut ::c_char,
pub pw_uid: ::uid_t,
pub pw_gid: ::gid_t,
pub pw_gecos: *mut ::c_char,
pub pw_dir: *mut ::c_char,
pub pw_shell: *mut ::c_char,
}
pub struct statfs {
pub f_type: u64,
pub f_bsize: u64,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_fsid: ::__fsid_t,
pub f_namelen: u64,
pub f_frsize: u64,
pub f_flags: u64,
pub f_spare: [u64; 4],
}
pub struct sysinfo {
pub uptime: ::c_long,
pub loads: [::c_ulong; 3],
pub totalram: ::c_ulong,
pub freeram: ::c_ulong,
pub sharedram: ::c_ulong,
pub bufferram: ::c_ulong,
pub totalswap: ::c_ulong,
pub freeswap: ::c_ulong,
pub procs: ::c_ushort,
pub pad: ::c_ushort,
pub totalhigh: ::c_ulong,
pub freehigh: ::c_ulong,
pub mem_unit: ::c_uint,
pub _f: [::c_char; 0],
}
pub struct statfs64 {
pub f_type: u64,
pub f_bsize: u64,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_fsid: ::__fsid_t,
pub f_namelen: u64,
pub f_frsize: u64,
pub f_flags: u64,
pub f_spare: [u64; 4],
}
pub struct statvfs64 {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_favail: u64,
pub f_fsid: ::c_ulong,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
pub struct pthread_barrier_t {
__private: [i64; 4],
}
pub struct pthread_spinlock_t {
__private: i64,
}
}
s_no_extra_traits! {
pub struct pthread_mutex_t {
value: ::c_int,
__reserved: [::c_char; 36],
}
pub struct pthread_cond_t {
value: ::c_int,
__reserved: [::c_char; 44],
}
pub struct pthread_rwlock_t {
numLocks: ::c_int,
writerThreadId: ::c_int,
pendingReaders: ::c_int,
pendingWriters: ::c_int,
attr: i32,
__reserved: [::c_char; 36],
}
pub struct sigset64_t {
__bits: [::c_ulong; 1]
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for pthread_mutex_t {
fn eq(&self, other: &pthread_mutex_t) -> bool {
self.value == other.value
&& self
.__reserved
.iter()
.zip(other.__reserved.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_mutex_t {}
impl ::fmt::Debug for pthread_mutex_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_mutex_t")
.field("value", &self.value)
// FIXME: .field("__reserved", &self.__reserved)
.finish()
}
}
impl ::hash::Hash for pthread_mutex_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.value.hash(state);
self.__reserved.hash(state);
}
}
impl PartialEq for pthread_cond_t {
fn eq(&self, other: &pthread_cond_t) -> bool {
self.value == other.value
&& self
.__reserved
.iter()
.zip(other.__reserved.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_cond_t {}
impl ::fmt::Debug for pthread_cond_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_cond_t")
.field("value", &self.value)
// FIXME: .field("__reserved", &self.__reserved)
.finish()
}
}
impl ::hash::Hash for pthread_cond_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.value.hash(state);
self.__reserved.hash(state);
}
}
impl PartialEq for pthread_rwlock_t {
fn eq(&self, other: &pthread_rwlock_t) -> bool {
self.numLocks == other.numLocks
&& self.writerThreadId == other.writerThreadId
&& self.pendingReaders == other.pendingReaders
&& self.pendingWriters == other.pendingWriters
&& self.attr == other.attr
&& self
.__reserved
.iter()
.zip(other.__reserved.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_rwlock_t {}
impl ::fmt::Debug for pthread_rwlock_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_rwlock_t")
.field("numLocks", &self.numLocks)
.field("writerThreadId", &self.writerThreadId)
.field("pendingReaders", &self.pendingReaders)
.field("pendingWriters", &self.pendingWriters)
.field("attr", &self.attr)
// FIXME: .field("__reserved", &self.__reserved)
.finish()
}
}
impl ::hash::Hash for pthread_rwlock_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.numLocks.hash(state);
self.writerThreadId.hash(state);
self.pendingReaders.hash(state);
self.pendingWriters.hash(state);
self.attr.hash(state);
self.__reserved.hash(state);
}
}
impl ::fmt::Debug for sigset64_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sigset64_t")
.field("__bits", &self.__bits)
.finish()
}
}
}
}
// These constants must be of the same type of sigaction.sa_flags
pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
pub const SA_NODEFER: ::c_int = 0x40000000;
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_RESETHAND: ::c_int = 0x80000000;
pub const SA_RESTART: ::c_int = 0x10000000;
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const RTLD_GLOBAL: ::c_int = 0x00100;
pub const RTLD_NOW: ::c_int = 2;
pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
value: 0,
__reserved: [0; 36],
};
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
value: 0,
__reserved: [0; 44],
};
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
numLocks: 0,
writerThreadId: 0,
pendingReaders: 0,
pendingWriters: 0,
attr: 0,
__reserved: [0; 36],
};
pub const PTHREAD_STACK_MIN: ::size_t = 4096 * 4;
pub const CPU_SETSIZE: ::size_t = 1024;
pub const __CPU_BITS: ::size_t = 64;
pub const UT_LINESIZE: usize = 32;
pub const UT_NAMESIZE: usize = 32;
pub const UT_HOSTSIZE: usize = 256;
f! {
// Sadly, Android before 5.0 (API level 21), the accept4 syscall is not
// exposed by the libc. As work-around, we implement it through `syscall`
// directly. This workaround can be removed if the minimum version of
// Android is bumped. When the workaround is removed, `accept4` can be
// moved back to `linux_like/mod.rs`
pub fn accept4(
fd: ::c_int,
addr: *mut ::sockaddr,
len: *mut ::socklen_t,
flg: ::c_int
) -> ::c_int {
::syscall(SYS_accept4, fd, addr, len, flg) as ::c_int
}
}
extern "C" {
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
pub fn __system_property_wait(
pi: *const ::prop_info,
__old_serial: u32,
__new_serial_ptr: *mut u32,
__relative_timeout: *const ::timespec,
) -> bool;
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
} else if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else if #[cfg(target_arch = "riscv64")] {
mod riscv64;
pub use self::riscv64::*;
} else {
// Unknown target_arch
}
}

View file

@ -0,0 +1,7 @@
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(16))]
pub struct max_align_t {
priv_: [f32; 8]
}
}

View file

@ -0,0 +1,365 @@
pub type c_char = i8;
pub type wchar_t = u32;
pub type greg_t = i64;
pub type __u64 = ::c_ulonglong;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::c_uint,
pub st_nlink: ::c_uint,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
__pad1: ::c_ulong,
pub st_size: ::off64_t,
pub st_blksize: ::c_int,
__pad2: ::c_int,
pub st_blocks: ::c_long,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__unused4: ::c_uint,
__unused5: ::c_uint,
}
pub struct stat64 {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::c_uint,
pub st_nlink: ::c_uint,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
__pad1: ::c_ulong,
pub st_size: ::off64_t,
pub st_blksize: ::c_int,
__pad2: ::c_int,
pub st_blocks: ::c_long,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__unused4: ::c_uint,
__unused5: ::c_uint,
}
}
pub const O_DIRECT: ::c_int = 0x40000;
pub const O_DIRECTORY: ::c_int = 0x200000;
pub const O_NOFOLLOW: ::c_int = 0x400000;
pub const O_LARGEFILE: ::c_int = 0x100000;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
// From NDK's asm/hwcap.h
pub const COMPAT_HWCAP_ISA_I: ::c_ulong = 1 << (b'I' - b'A');
pub const COMPAT_HWCAP_ISA_M: ::c_ulong = 1 << (b'M' - b'A');
pub const COMPAT_HWCAP_ISA_A: ::c_ulong = 1 << (b'A' - b'A');
pub const COMPAT_HWCAP_ISA_F: ::c_ulong = 1 << (b'F' - b'A');
pub const COMPAT_HWCAP_ISA_D: ::c_ulong = 1 << (b'D' - b'A');
pub const COMPAT_HWCAP_ISA_C: ::c_ulong = 1 << (b'C' - b'A');
pub const SYS_io_setup: ::c_long = 0;
pub const SYS_io_destroy: ::c_long = 1;
pub const SYS_io_submit: ::c_long = 2;
pub const SYS_io_cancel: ::c_long = 3;
pub const SYS_io_getevents: ::c_long = 4;
pub const SYS_setxattr: ::c_long = 5;
pub const SYS_lsetxattr: ::c_long = 6;
pub const SYS_fsetxattr: ::c_long = 7;
pub const SYS_getxattr: ::c_long = 8;
pub const SYS_lgetxattr: ::c_long = 9;
pub const SYS_fgetxattr: ::c_long = 10;
pub const SYS_listxattr: ::c_long = 11;
pub const SYS_llistxattr: ::c_long = 12;
pub const SYS_flistxattr: ::c_long = 13;
pub const SYS_removexattr: ::c_long = 14;
pub const SYS_lremovexattr: ::c_long = 15;
pub const SYS_fremovexattr: ::c_long = 16;
pub const SYS_getcwd: ::c_long = 17;
pub const SYS_lookup_dcookie: ::c_long = 18;
pub const SYS_eventfd2: ::c_long = 19;
pub const SYS_epoll_create1: ::c_long = 20;
pub const SYS_epoll_ctl: ::c_long = 21;
pub const SYS_epoll_pwait: ::c_long = 22;
pub const SYS_dup: ::c_long = 23;
pub const SYS_dup3: ::c_long = 24;
pub const SYS_inotify_init1: ::c_long = 26;
pub const SYS_inotify_add_watch: ::c_long = 27;
pub const SYS_inotify_rm_watch: ::c_long = 28;
pub const SYS_ioctl: ::c_long = 29;
pub const SYS_ioprio_set: ::c_long = 30;
pub const SYS_ioprio_get: ::c_long = 31;
pub const SYS_flock: ::c_long = 32;
pub const SYS_mknodat: ::c_long = 33;
pub const SYS_mkdirat: ::c_long = 34;
pub const SYS_unlinkat: ::c_long = 35;
pub const SYS_symlinkat: ::c_long = 36;
pub const SYS_linkat: ::c_long = 37;
pub const SYS_renameat: ::c_long = 38;
pub const SYS_umount2: ::c_long = 39;
pub const SYS_mount: ::c_long = 40;
pub const SYS_pivot_root: ::c_long = 41;
pub const SYS_nfsservctl: ::c_long = 42;
pub const SYS_fallocate: ::c_long = 47;
pub const SYS_faccessat: ::c_long = 48;
pub const SYS_chdir: ::c_long = 49;
pub const SYS_fchdir: ::c_long = 50;
pub const SYS_chroot: ::c_long = 51;
pub const SYS_fchmod: ::c_long = 52;
pub const SYS_fchmodat: ::c_long = 53;
pub const SYS_fchownat: ::c_long = 54;
pub const SYS_fchown: ::c_long = 55;
pub const SYS_openat: ::c_long = 56;
pub const SYS_close: ::c_long = 57;
pub const SYS_vhangup: ::c_long = 58;
pub const SYS_pipe2: ::c_long = 59;
pub const SYS_quotactl: ::c_long = 60;
pub const SYS_getdents64: ::c_long = 61;
pub const SYS_read: ::c_long = 63;
pub const SYS_write: ::c_long = 64;
pub const SYS_readv: ::c_long = 65;
pub const SYS_writev: ::c_long = 66;
pub const SYS_pread64: ::c_long = 67;
pub const SYS_pwrite64: ::c_long = 68;
pub const SYS_preadv: ::c_long = 69;
pub const SYS_pwritev: ::c_long = 70;
pub const SYS_pselect6: ::c_long = 72;
pub const SYS_ppoll: ::c_long = 73;
pub const SYS_signalfd4: ::c_long = 74;
pub const SYS_vmsplice: ::c_long = 75;
pub const SYS_splice: ::c_long = 76;
pub const SYS_tee: ::c_long = 77;
pub const SYS_readlinkat: ::c_long = 78;
pub const SYS_sync: ::c_long = 81;
pub const SYS_fsync: ::c_long = 82;
pub const SYS_fdatasync: ::c_long = 83;
pub const SYS_sync_file_range: ::c_long = 84;
pub const SYS_timerfd_create: ::c_long = 85;
pub const SYS_timerfd_settime: ::c_long = 86;
pub const SYS_timerfd_gettime: ::c_long = 87;
pub const SYS_utimensat: ::c_long = 88;
pub const SYS_acct: ::c_long = 89;
pub const SYS_capget: ::c_long = 90;
pub const SYS_capset: ::c_long = 91;
pub const SYS_personality: ::c_long = 92;
pub const SYS_exit: ::c_long = 93;
pub const SYS_exit_group: ::c_long = 94;
pub const SYS_waitid: ::c_long = 95;
pub const SYS_set_tid_address: ::c_long = 96;
pub const SYS_unshare: ::c_long = 97;
pub const SYS_futex: ::c_long = 98;
pub const SYS_set_robust_list: ::c_long = 99;
pub const SYS_get_robust_list: ::c_long = 100;
pub const SYS_nanosleep: ::c_long = 101;
pub const SYS_getitimer: ::c_long = 102;
pub const SYS_setitimer: ::c_long = 103;
pub const SYS_kexec_load: ::c_long = 104;
pub const SYS_init_module: ::c_long = 105;
pub const SYS_delete_module: ::c_long = 106;
pub const SYS_timer_create: ::c_long = 107;
pub const SYS_timer_gettime: ::c_long = 108;
pub const SYS_timer_getoverrun: ::c_long = 109;
pub const SYS_timer_settime: ::c_long = 110;
pub const SYS_timer_delete: ::c_long = 111;
pub const SYS_clock_settime: ::c_long = 112;
pub const SYS_clock_gettime: ::c_long = 113;
pub const SYS_clock_getres: ::c_long = 114;
pub const SYS_clock_nanosleep: ::c_long = 115;
pub const SYS_syslog: ::c_long = 116;
pub const SYS_ptrace: ::c_long = 117;
pub const SYS_sched_setparam: ::c_long = 118;
pub const SYS_sched_setscheduler: ::c_long = 119;
pub const SYS_sched_getscheduler: ::c_long = 120;
pub const SYS_sched_getparam: ::c_long = 121;
pub const SYS_sched_setaffinity: ::c_long = 122;
pub const SYS_sched_getaffinity: ::c_long = 123;
pub const SYS_sched_yield: ::c_long = 124;
pub const SYS_sched_get_priority_max: ::c_long = 125;
pub const SYS_sched_get_priority_min: ::c_long = 126;
pub const SYS_sched_rr_get_interval: ::c_long = 127;
pub const SYS_restart_syscall: ::c_long = 128;
pub const SYS_kill: ::c_long = 129;
pub const SYS_tkill: ::c_long = 130;
pub const SYS_tgkill: ::c_long = 131;
pub const SYS_sigaltstack: ::c_long = 132;
pub const SYS_rt_sigsuspend: ::c_long = 133;
pub const SYS_rt_sigaction: ::c_long = 134;
pub const SYS_rt_sigprocmask: ::c_long = 135;
pub const SYS_rt_sigpending: ::c_long = 136;
pub const SYS_rt_sigtimedwait: ::c_long = 137;
pub const SYS_rt_sigqueueinfo: ::c_long = 138;
pub const SYS_rt_sigreturn: ::c_long = 139;
pub const SYS_setpriority: ::c_long = 140;
pub const SYS_getpriority: ::c_long = 141;
pub const SYS_reboot: ::c_long = 142;
pub const SYS_setregid: ::c_long = 143;
pub const SYS_setgid: ::c_long = 144;
pub const SYS_setreuid: ::c_long = 145;
pub const SYS_setuid: ::c_long = 146;
pub const SYS_setresuid: ::c_long = 147;
pub const SYS_getresuid: ::c_long = 148;
pub const SYS_setresgid: ::c_long = 149;
pub const SYS_getresgid: ::c_long = 150;
pub const SYS_setfsuid: ::c_long = 151;
pub const SYS_setfsgid: ::c_long = 152;
pub const SYS_times: ::c_long = 153;
pub const SYS_setpgid: ::c_long = 154;
pub const SYS_getpgid: ::c_long = 155;
pub const SYS_getsid: ::c_long = 156;
pub const SYS_setsid: ::c_long = 157;
pub const SYS_getgroups: ::c_long = 158;
pub const SYS_setgroups: ::c_long = 159;
pub const SYS_uname: ::c_long = 160;
pub const SYS_sethostname: ::c_long = 161;
pub const SYS_setdomainname: ::c_long = 162;
pub const SYS_getrlimit: ::c_long = 163;
pub const SYS_setrlimit: ::c_long = 164;
pub const SYS_getrusage: ::c_long = 165;
pub const SYS_umask: ::c_long = 166;
pub const SYS_prctl: ::c_long = 167;
pub const SYS_getcpu: ::c_long = 168;
pub const SYS_gettimeofday: ::c_long = 169;
pub const SYS_settimeofday: ::c_long = 170;
pub const SYS_adjtimex: ::c_long = 171;
pub const SYS_getpid: ::c_long = 172;
pub const SYS_getppid: ::c_long = 173;
pub const SYS_getuid: ::c_long = 174;
pub const SYS_geteuid: ::c_long = 175;
pub const SYS_getgid: ::c_long = 176;
pub const SYS_getegid: ::c_long = 177;
pub const SYS_gettid: ::c_long = 178;
pub const SYS_sysinfo: ::c_long = 179;
pub const SYS_mq_open: ::c_long = 180;
pub const SYS_mq_unlink: ::c_long = 181;
pub const SYS_mq_timedsend: ::c_long = 182;
pub const SYS_mq_timedreceive: ::c_long = 183;
pub const SYS_mq_notify: ::c_long = 184;
pub const SYS_mq_getsetattr: ::c_long = 185;
pub const SYS_msgget: ::c_long = 186;
pub const SYS_msgctl: ::c_long = 187;
pub const SYS_msgrcv: ::c_long = 188;
pub const SYS_msgsnd: ::c_long = 189;
pub const SYS_semget: ::c_long = 190;
pub const SYS_semctl: ::c_long = 191;
pub const SYS_semtimedop: ::c_long = 192;
pub const SYS_semop: ::c_long = 193;
pub const SYS_shmget: ::c_long = 194;
pub const SYS_shmctl: ::c_long = 195;
pub const SYS_shmat: ::c_long = 196;
pub const SYS_shmdt: ::c_long = 197;
pub const SYS_socket: ::c_long = 198;
pub const SYS_socketpair: ::c_long = 199;
pub const SYS_bind: ::c_long = 200;
pub const SYS_listen: ::c_long = 201;
pub const SYS_accept: ::c_long = 202;
pub const SYS_connect: ::c_long = 203;
pub const SYS_getsockname: ::c_long = 204;
pub const SYS_getpeername: ::c_long = 205;
pub const SYS_sendto: ::c_long = 206;
pub const SYS_recvfrom: ::c_long = 207;
pub const SYS_setsockopt: ::c_long = 208;
pub const SYS_getsockopt: ::c_long = 209;
pub const SYS_shutdown: ::c_long = 210;
pub const SYS_sendmsg: ::c_long = 211;
pub const SYS_recvmsg: ::c_long = 212;
pub const SYS_readahead: ::c_long = 213;
pub const SYS_brk: ::c_long = 214;
pub const SYS_munmap: ::c_long = 215;
pub const SYS_mremap: ::c_long = 216;
pub const SYS_add_key: ::c_long = 217;
pub const SYS_request_key: ::c_long = 218;
pub const SYS_keyctl: ::c_long = 219;
pub const SYS_clone: ::c_long = 220;
pub const SYS_execve: ::c_long = 221;
pub const SYS_swapon: ::c_long = 224;
pub const SYS_swapoff: ::c_long = 225;
pub const SYS_mprotect: ::c_long = 226;
pub const SYS_msync: ::c_long = 227;
pub const SYS_mlock: ::c_long = 228;
pub const SYS_munlock: ::c_long = 229;
pub const SYS_mlockall: ::c_long = 230;
pub const SYS_munlockall: ::c_long = 231;
pub const SYS_mincore: ::c_long = 232;
pub const SYS_madvise: ::c_long = 233;
pub const SYS_remap_file_pages: ::c_long = 234;
pub const SYS_mbind: ::c_long = 235;
pub const SYS_get_mempolicy: ::c_long = 236;
pub const SYS_set_mempolicy: ::c_long = 237;
pub const SYS_migrate_pages: ::c_long = 238;
pub const SYS_move_pages: ::c_long = 239;
pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
pub const SYS_perf_event_open: ::c_long = 241;
pub const SYS_accept4: ::c_long = 242;
pub const SYS_recvmmsg: ::c_long = 243;
pub const SYS_arch_specific_syscall: ::c_long = 244;
pub const SYS_wait4: ::c_long = 260;
pub const SYS_prlimit64: ::c_long = 261;
pub const SYS_fanotify_init: ::c_long = 262;
pub const SYS_fanotify_mark: ::c_long = 263;
pub const SYS_name_to_handle_at: ::c_long = 264;
pub const SYS_open_by_handle_at: ::c_long = 265;
pub const SYS_clock_adjtime: ::c_long = 266;
pub const SYS_syncfs: ::c_long = 267;
pub const SYS_setns: ::c_long = 268;
pub const SYS_sendmmsg: ::c_long = 269;
pub const SYS_process_vm_readv: ::c_long = 270;
pub const SYS_process_vm_writev: ::c_long = 271;
pub const SYS_kcmp: ::c_long = 272;
pub const SYS_finit_module: ::c_long = 273;
pub const SYS_sched_setattr: ::c_long = 274;
pub const SYS_sched_getattr: ::c_long = 275;
pub const SYS_renameat2: ::c_long = 276;
pub const SYS_seccomp: ::c_long = 277;
pub const SYS_getrandom: ::c_long = 278;
pub const SYS_memfd_create: ::c_long = 279;
pub const SYS_bpf: ::c_long = 280;
pub const SYS_execveat: ::c_long = 281;
pub const SYS_userfaultfd: ::c_long = 282;
pub const SYS_membarrier: ::c_long = 283;
pub const SYS_mlock2: ::c_long = 284;
pub const SYS_copy_file_range: ::c_long = 285;
pub const SYS_preadv2: ::c_long = 286;
pub const SYS_pwritev2: ::c_long = 287;
pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
pub const SYS_statx: ::c_long = 291;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
pub const SYS_open_tree: ::c_long = 428;
pub const SYS_move_mount: ::c_long = 429;
pub const SYS_fsopen: ::c_long = 430;
pub const SYS_fsconfig: ::c_long = 431;
pub const SYS_fsmount: ::c_long = 432;
pub const SYS_fspick: ::c_long = 433;
pub const SYS_syscalls: ::c_long = 436;
// From NDK's asm/auxvec.h
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
pub const AT_L1I_CACHESIZE: ::c_ulong = 40;
pub const AT_L1I_CACHEGEOMETRY: ::c_ulong = 41;
pub const AT_L1D_CACHESIZE: ::c_ulong = 42;
pub const AT_L1D_CACHEGEOMETRY: ::c_ulong = 43;
pub const AT_L2_CACHESIZE: ::c_ulong = 44;
pub const AT_L2_CACHEGEOMETRY: ::c_ulong = 45;
pub const AT_L3_CACHESIZE: ::c_ulong = 46;
pub const AT_L3_CACHEGEOMETRY: ::c_ulong = 47;
pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 9;
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}

View file

@ -0,0 +1,7 @@
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 4]
}
}

View file

@ -0,0 +1,806 @@
pub type c_char = i8;
pub type wchar_t = i32;
pub type greg_t = i64;
pub type __u64 = ::c_ulonglong;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::c_ulong,
pub st_mode: ::c_uint,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_size: ::off64_t,
pub st_blksize: ::c_long,
pub st_blocks: ::c_long,
pub st_atime: ::c_long,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::c_long,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::c_long,
pub st_ctime_nsec: ::c_long,
__unused: [::c_long; 3],
}
pub struct stat64 {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::c_ulong,
pub st_mode: ::c_uint,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_size: ::off64_t,
pub st_blksize: ::c_long,
pub st_blocks: ::c_long,
pub st_atime: ::c_long,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::c_long,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::c_long,
pub st_ctime_nsec: ::c_long,
__unused: [::c_long; 3],
}
pub struct _libc_xmmreg {
pub element: [u32; 4],
}
pub struct user_regs_struct {
pub r15: ::c_ulong,
pub r14: ::c_ulong,
pub r13: ::c_ulong,
pub r12: ::c_ulong,
pub rbp: ::c_ulong,
pub rbx: ::c_ulong,
pub r11: ::c_ulong,
pub r10: ::c_ulong,
pub r9: ::c_ulong,
pub r8: ::c_ulong,
pub rax: ::c_ulong,
pub rcx: ::c_ulong,
pub rdx: ::c_ulong,
pub rsi: ::c_ulong,
pub rdi: ::c_ulong,
pub orig_rax: ::c_ulong,
pub rip: ::c_ulong,
pub cs: ::c_ulong,
pub eflags: ::c_ulong,
pub rsp: ::c_ulong,
pub ss: ::c_ulong,
pub fs_base: ::c_ulong,
pub gs_base: ::c_ulong,
pub ds: ::c_ulong,
pub es: ::c_ulong,
pub fs: ::c_ulong,
pub gs: ::c_ulong,
}
pub struct user {
pub regs: user_regs_struct,
pub u_fpvalid: ::c_int,
pub i387: user_fpregs_struct,
pub u_tsize: ::c_ulong,
pub u_dsize: ::c_ulong,
pub u_ssize: ::c_ulong,
pub start_code: ::c_ulong,
pub start_stack: ::c_ulong,
pub signal: ::c_long,
__reserved: ::c_int,
#[cfg(target_pointer_width = "32")]
__pad1: u32,
pub u_ar0: *mut user_regs_struct,
#[cfg(target_pointer_width = "32")]
__pad2: u32,
pub u_fpstate: *mut user_fpregs_struct,
pub magic: ::c_ulong,
pub u_comm: [::c_char; 32],
pub u_debugreg: [::c_ulong; 8],
pub error_code: ::c_ulong,
pub fault_address: ::c_ulong,
}
}
cfg_if! {
if #[cfg(libc_union)] {
s_no_extra_traits! {
pub union __c_anonymous_uc_sigmask {
uc_sigmask: ::sigset_t,
uc_sigmask64: ::sigset64_t,
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for __c_anonymous_uc_sigmask {
fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool {
unsafe { self.uc_sigmask == other.uc_sigmask }
}
}
impl Eq for __c_anonymous_uc_sigmask {}
impl ::fmt::Debug for __c_anonymous_uc_sigmask {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("uc_sigmask")
.field("uc_sigmask", unsafe { &self.uc_sigmask })
.finish()
}
}
impl ::hash::Hash for __c_anonymous_uc_sigmask {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
unsafe { self.uc_sigmask.hash(state) }
}
}
}
}
}
}
s_no_extra_traits! {
pub struct _libc_fpxreg {
pub significand: [u16; 4],
pub exponent: u16,
__padding: [u16; 3],
}
pub struct _libc_fpstate {
pub cwd: u16,
pub swd: u16,
pub ftw: u16,
pub fop: u16,
pub rip: u64,
pub rdp: u64,
pub mxcsr: u32,
pub mxcr_mask: u32,
pub _st: [_libc_fpxreg; 8],
pub _xmm: [_libc_xmmreg; 16],
__private: [u32; 24],
}
pub struct mcontext_t {
pub gregs: [greg_t; 23],
pub fpregs: *mut _libc_fpstate,
__private: [u64; 8],
}
pub struct ucontext_t {
pub uc_flags: ::c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: mcontext_t,
pub uc_sigmask64: __c_anonymous_uc_sigmask,
__fpregs_mem: _libc_fpstate,
}
pub struct user_fpregs_struct {
pub cwd: ::c_ushort,
pub swd: ::c_ushort,
pub ftw: ::c_ushort,
pub fop: ::c_ushort,
pub rip: ::c_ulong,
pub rdp: ::c_ulong,
pub mxcsr: ::c_uint,
pub mxcr_mask: ::c_uint,
pub st_space: [::c_uint; 32],
pub xmm_space: [::c_uint; 64],
padding: [::c_uint; 24],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for _libc_fpxreg {
fn eq(&self, other: &Self) -> bool {
self.significand == other.significand
&& self.exponent == other.exponent
// Ignore padding field
}
}
impl Eq for _libc_fpxreg {}
impl ::fmt::Debug for _libc_fpxreg {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("_libc_fpxreg")
.field("significand", &self.significand)
.field("exponent", &self.exponent)
// Ignore padding field
.finish()
}
}
impl ::hash::Hash for _libc_fpxreg {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.significand.hash(state);
self.exponent.hash(state);
// Ignore padding field
}
}
impl PartialEq for _libc_fpstate {
fn eq(&self, other: &Self) -> bool {
self.cwd == other.cwd
&& self.swd == other.swd
&& self.ftw == other.ftw
&& self.fop == other.fop
&& self.rip == other.rip
&& self.rdp == other.rdp
&& self.mxcsr == other.mxcsr
&& self.mxcr_mask == other.mxcr_mask
&& self._st == other._st
&& self._xmm == other._xmm
// Ignore padding field
}
}
impl Eq for _libc_fpstate {}
impl ::fmt::Debug for _libc_fpstate {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("_libc_fpstate")
.field("cwd", &self.cwd)
.field("swd", &self.swd)
.field("ftw", &self.ftw)
.field("fop", &self.fop)
.field("rip", &self.rip)
.field("rdp", &self.rdp)
.field("mxcsr", &self.mxcsr)
.field("mxcr_mask", &self.mxcr_mask)
.field("_st", &self._st)
.field("_xmm", &self._xmm)
// Ignore padding field
.finish()
}
}
impl ::hash::Hash for _libc_fpstate {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.cwd.hash(state);
self.swd.hash(state);
self.ftw.hash(state);
self.fop.hash(state);
self.rip.hash(state);
self.rdp.hash(state);
self.mxcsr.hash(state);
self.mxcr_mask.hash(state);
self._st.hash(state);
self._xmm.hash(state);
// Ignore padding field
}
}
impl PartialEq for mcontext_t {
fn eq(&self, other: &Self) -> bool {
self.gregs == other.gregs
&& self.fpregs == other.fpregs
// Ignore padding field
}
}
impl Eq for mcontext_t {}
impl ::fmt::Debug for mcontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("mcontext_t")
.field("gregs", &self.gregs)
.field("fpregs", &self.fpregs)
// Ignore padding field
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.gregs.hash(state);
self.fpregs.hash(state);
// Ignore padding field
}
}
impl PartialEq for ucontext_t {
fn eq(&self, other: &Self) -> bool {
self.uc_flags == other.uc_flags
&& self.uc_link == other.uc_link
&& self.uc_stack == other.uc_stack
&& self.uc_mcontext == other.uc_mcontext
&& self.uc_sigmask64 == other.uc_sigmask64
// Ignore padding field
}
}
impl Eq for ucontext_t {}
impl ::fmt::Debug for ucontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ucontext_t")
.field("uc_flags", &self.uc_flags)
.field("uc_link", &self.uc_link)
.field("uc_stack", &self.uc_stack)
.field("uc_mcontext", &self.uc_mcontext)
.field("uc_sigmask64", &self.uc_sigmask64)
// Ignore padding field
.finish()
}
}
impl ::hash::Hash for ucontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.uc_flags.hash(state);
self.uc_link.hash(state);
self.uc_stack.hash(state);
self.uc_mcontext.hash(state);
self.uc_sigmask64.hash(state);
// Ignore padding field
}
}
impl PartialEq for user_fpregs_struct {
fn eq(&self, other: &user_fpregs_struct) -> bool {
self.cwd == other.cwd
&& self.swd == other.swd
&& self.ftw == other.ftw
&& self.fop == other.fop
&& self.rip == other.rip
&& self.rdp == other.rdp
&& self.mxcsr == other.mxcsr
&& self.mxcr_mask == other.mxcr_mask
&& self.st_space == other.st_space
&& self
.xmm_space
.iter()
.zip(other.xmm_space.iter())
.all(|(a,b)| a == b)
// Ignore padding field
}
}
impl Eq for user_fpregs_struct {}
impl ::fmt::Debug for user_fpregs_struct {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("user_fpregs_struct")
.field("cwd", &self.cwd)
.field("swd", &self.swd)
.field("ftw", &self.ftw)
.field("fop", &self.fop)
.field("rip", &self.rip)
.field("rdp", &self.rdp)
.field("mxcsr", &self.mxcsr)
.field("mxcr_mask", &self.mxcr_mask)
.field("st_space", &self.st_space)
// FIXME: .field("xmm_space", &self.xmm_space)
// Ignore padding field
.finish()
}
}
impl ::hash::Hash for user_fpregs_struct {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.cwd.hash(state);
self.swd.hash(state);
self.ftw.hash(state);
self.fop.hash(state);
self.rip.hash(state);
self.rdp.hash(state);
self.mxcsr.hash(state);
self.mxcr_mask.hash(state);
self.st_space.hash(state);
self.xmm_space.hash(state);
// Ignore padding field
}
}
}
}
pub const O_DIRECT: ::c_int = 0x4000;
pub const O_DIRECTORY: ::c_int = 0x10000;
pub const O_NOFOLLOW: ::c_int = 0x20000;
pub const O_LARGEFILE: ::c_int = 0o0100000;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const MAP_32BIT: ::c_int = 0x40;
// Syscall table
pub const SYS_read: ::c_long = 0;
pub const SYS_write: ::c_long = 1;
pub const SYS_open: ::c_long = 2;
pub const SYS_close: ::c_long = 3;
pub const SYS_stat: ::c_long = 4;
pub const SYS_fstat: ::c_long = 5;
pub const SYS_lstat: ::c_long = 6;
pub const SYS_poll: ::c_long = 7;
pub const SYS_lseek: ::c_long = 8;
pub const SYS_mmap: ::c_long = 9;
pub const SYS_mprotect: ::c_long = 10;
pub const SYS_munmap: ::c_long = 11;
pub const SYS_brk: ::c_long = 12;
pub const SYS_rt_sigaction: ::c_long = 13;
pub const SYS_rt_sigprocmask: ::c_long = 14;
pub const SYS_rt_sigreturn: ::c_long = 15;
pub const SYS_ioctl: ::c_long = 16;
pub const SYS_pread64: ::c_long = 17;
pub const SYS_pwrite64: ::c_long = 18;
pub const SYS_readv: ::c_long = 19;
pub const SYS_writev: ::c_long = 20;
pub const SYS_access: ::c_long = 21;
pub const SYS_pipe: ::c_long = 22;
pub const SYS_select: ::c_long = 23;
pub const SYS_sched_yield: ::c_long = 24;
pub const SYS_mremap: ::c_long = 25;
pub const SYS_msync: ::c_long = 26;
pub const SYS_mincore: ::c_long = 27;
pub const SYS_madvise: ::c_long = 28;
pub const SYS_shmget: ::c_long = 29;
pub const SYS_shmat: ::c_long = 30;
pub const SYS_shmctl: ::c_long = 31;
pub const SYS_dup: ::c_long = 32;
pub const SYS_dup2: ::c_long = 33;
pub const SYS_pause: ::c_long = 34;
pub const SYS_nanosleep: ::c_long = 35;
pub const SYS_getitimer: ::c_long = 36;
pub const SYS_alarm: ::c_long = 37;
pub const SYS_setitimer: ::c_long = 38;
pub const SYS_getpid: ::c_long = 39;
pub const SYS_sendfile: ::c_long = 40;
pub const SYS_socket: ::c_long = 41;
pub const SYS_connect: ::c_long = 42;
pub const SYS_accept: ::c_long = 43;
pub const SYS_sendto: ::c_long = 44;
pub const SYS_recvfrom: ::c_long = 45;
pub const SYS_sendmsg: ::c_long = 46;
pub const SYS_recvmsg: ::c_long = 47;
pub const SYS_shutdown: ::c_long = 48;
pub const SYS_bind: ::c_long = 49;
pub const SYS_listen: ::c_long = 50;
pub const SYS_getsockname: ::c_long = 51;
pub const SYS_getpeername: ::c_long = 52;
pub const SYS_socketpair: ::c_long = 53;
pub const SYS_setsockopt: ::c_long = 54;
pub const SYS_getsockopt: ::c_long = 55;
pub const SYS_clone: ::c_long = 56;
pub const SYS_fork: ::c_long = 57;
pub const SYS_vfork: ::c_long = 58;
pub const SYS_execve: ::c_long = 59;
pub const SYS_exit: ::c_long = 60;
pub const SYS_wait4: ::c_long = 61;
pub const SYS_kill: ::c_long = 62;
pub const SYS_uname: ::c_long = 63;
pub const SYS_semget: ::c_long = 64;
pub const SYS_semop: ::c_long = 65;
pub const SYS_semctl: ::c_long = 66;
pub const SYS_shmdt: ::c_long = 67;
pub const SYS_msgget: ::c_long = 68;
pub const SYS_msgsnd: ::c_long = 69;
pub const SYS_msgrcv: ::c_long = 70;
pub const SYS_msgctl: ::c_long = 71;
pub const SYS_fcntl: ::c_long = 72;
pub const SYS_flock: ::c_long = 73;
pub const SYS_fsync: ::c_long = 74;
pub const SYS_fdatasync: ::c_long = 75;
pub const SYS_truncate: ::c_long = 76;
pub const SYS_ftruncate: ::c_long = 77;
pub const SYS_getdents: ::c_long = 78;
pub const SYS_getcwd: ::c_long = 79;
pub const SYS_chdir: ::c_long = 80;
pub const SYS_fchdir: ::c_long = 81;
pub const SYS_rename: ::c_long = 82;
pub const SYS_mkdir: ::c_long = 83;
pub const SYS_rmdir: ::c_long = 84;
pub const SYS_creat: ::c_long = 85;
pub const SYS_link: ::c_long = 86;
pub const SYS_unlink: ::c_long = 87;
pub const SYS_symlink: ::c_long = 88;
pub const SYS_readlink: ::c_long = 89;
pub const SYS_chmod: ::c_long = 90;
pub const SYS_fchmod: ::c_long = 91;
pub const SYS_chown: ::c_long = 92;
pub const SYS_fchown: ::c_long = 93;
pub const SYS_lchown: ::c_long = 94;
pub const SYS_umask: ::c_long = 95;
pub const SYS_gettimeofday: ::c_long = 96;
pub const SYS_getrlimit: ::c_long = 97;
pub const SYS_getrusage: ::c_long = 98;
pub const SYS_sysinfo: ::c_long = 99;
pub const SYS_times: ::c_long = 100;
pub const SYS_ptrace: ::c_long = 101;
pub const SYS_getuid: ::c_long = 102;
pub const SYS_syslog: ::c_long = 103;
pub const SYS_getgid: ::c_long = 104;
pub const SYS_setuid: ::c_long = 105;
pub const SYS_setgid: ::c_long = 106;
pub const SYS_geteuid: ::c_long = 107;
pub const SYS_getegid: ::c_long = 108;
pub const SYS_setpgid: ::c_long = 109;
pub const SYS_getppid: ::c_long = 110;
pub const SYS_getpgrp: ::c_long = 111;
pub const SYS_setsid: ::c_long = 112;
pub const SYS_setreuid: ::c_long = 113;
pub const SYS_setregid: ::c_long = 114;
pub const SYS_getgroups: ::c_long = 115;
pub const SYS_setgroups: ::c_long = 116;
pub const SYS_setresuid: ::c_long = 117;
pub const SYS_getresuid: ::c_long = 118;
pub const SYS_setresgid: ::c_long = 119;
pub const SYS_getresgid: ::c_long = 120;
pub const SYS_getpgid: ::c_long = 121;
pub const SYS_setfsuid: ::c_long = 122;
pub const SYS_setfsgid: ::c_long = 123;
pub const SYS_getsid: ::c_long = 124;
pub const SYS_capget: ::c_long = 125;
pub const SYS_capset: ::c_long = 126;
pub const SYS_rt_sigpending: ::c_long = 127;
pub const SYS_rt_sigtimedwait: ::c_long = 128;
pub const SYS_rt_sigqueueinfo: ::c_long = 129;
pub const SYS_rt_sigsuspend: ::c_long = 130;
pub const SYS_sigaltstack: ::c_long = 131;
pub const SYS_utime: ::c_long = 132;
pub const SYS_mknod: ::c_long = 133;
pub const SYS_uselib: ::c_long = 134;
pub const SYS_personality: ::c_long = 135;
pub const SYS_ustat: ::c_long = 136;
pub const SYS_statfs: ::c_long = 137;
pub const SYS_fstatfs: ::c_long = 138;
pub const SYS_sysfs: ::c_long = 139;
pub const SYS_getpriority: ::c_long = 140;
pub const SYS_setpriority: ::c_long = 141;
pub const SYS_sched_setparam: ::c_long = 142;
pub const SYS_sched_getparam: ::c_long = 143;
pub const SYS_sched_setscheduler: ::c_long = 144;
pub const SYS_sched_getscheduler: ::c_long = 145;
pub const SYS_sched_get_priority_max: ::c_long = 146;
pub const SYS_sched_get_priority_min: ::c_long = 147;
pub const SYS_sched_rr_get_interval: ::c_long = 148;
pub const SYS_mlock: ::c_long = 149;
pub const SYS_munlock: ::c_long = 150;
pub const SYS_mlockall: ::c_long = 151;
pub const SYS_munlockall: ::c_long = 152;
pub const SYS_vhangup: ::c_long = 153;
pub const SYS_modify_ldt: ::c_long = 154;
pub const SYS_pivot_root: ::c_long = 155;
// FIXME: SYS__sysctl is in the NDK sources but for some reason is
// not available in the tests
// pub const SYS__sysctl: ::c_long = 156;
pub const SYS_prctl: ::c_long = 157;
pub const SYS_arch_prctl: ::c_long = 158;
pub const SYS_adjtimex: ::c_long = 159;
pub const SYS_setrlimit: ::c_long = 160;
pub const SYS_chroot: ::c_long = 161;
pub const SYS_sync: ::c_long = 162;
pub const SYS_acct: ::c_long = 163;
pub const SYS_settimeofday: ::c_long = 164;
pub const SYS_mount: ::c_long = 165;
pub const SYS_umount2: ::c_long = 166;
pub const SYS_swapon: ::c_long = 167;
pub const SYS_swapoff: ::c_long = 168;
pub const SYS_reboot: ::c_long = 169;
pub const SYS_sethostname: ::c_long = 170;
pub const SYS_setdomainname: ::c_long = 171;
pub const SYS_iopl: ::c_long = 172;
pub const SYS_ioperm: ::c_long = 173;
pub const SYS_create_module: ::c_long = 174;
pub const SYS_init_module: ::c_long = 175;
pub const SYS_delete_module: ::c_long = 176;
pub const SYS_get_kernel_syms: ::c_long = 177;
pub const SYS_query_module: ::c_long = 178;
pub const SYS_quotactl: ::c_long = 179;
pub const SYS_nfsservctl: ::c_long = 180;
pub const SYS_getpmsg: ::c_long = 181;
pub const SYS_putpmsg: ::c_long = 182;
pub const SYS_afs_syscall: ::c_long = 183;
pub const SYS_tuxcall: ::c_long = 184;
pub const SYS_security: ::c_long = 185;
pub const SYS_gettid: ::c_long = 186;
pub const SYS_readahead: ::c_long = 187;
pub const SYS_setxattr: ::c_long = 188;
pub const SYS_lsetxattr: ::c_long = 189;
pub const SYS_fsetxattr: ::c_long = 190;
pub const SYS_getxattr: ::c_long = 191;
pub const SYS_lgetxattr: ::c_long = 192;
pub const SYS_fgetxattr: ::c_long = 193;
pub const SYS_listxattr: ::c_long = 194;
pub const SYS_llistxattr: ::c_long = 195;
pub const SYS_flistxattr: ::c_long = 196;
pub const SYS_removexattr: ::c_long = 197;
pub const SYS_lremovexattr: ::c_long = 198;
pub const SYS_fremovexattr: ::c_long = 199;
pub const SYS_tkill: ::c_long = 200;
pub const SYS_time: ::c_long = 201;
pub const SYS_futex: ::c_long = 202;
pub const SYS_sched_setaffinity: ::c_long = 203;
pub const SYS_sched_getaffinity: ::c_long = 204;
pub const SYS_set_thread_area: ::c_long = 205;
pub const SYS_io_setup: ::c_long = 206;
pub const SYS_io_destroy: ::c_long = 207;
pub const SYS_io_getevents: ::c_long = 208;
pub const SYS_io_submit: ::c_long = 209;
pub const SYS_io_cancel: ::c_long = 210;
pub const SYS_get_thread_area: ::c_long = 211;
pub const SYS_lookup_dcookie: ::c_long = 212;
pub const SYS_epoll_create: ::c_long = 213;
pub const SYS_epoll_ctl_old: ::c_long = 214;
pub const SYS_epoll_wait_old: ::c_long = 215;
pub const SYS_remap_file_pages: ::c_long = 216;
pub const SYS_getdents64: ::c_long = 217;
pub const SYS_set_tid_address: ::c_long = 218;
pub const SYS_restart_syscall: ::c_long = 219;
pub const SYS_semtimedop: ::c_long = 220;
pub const SYS_fadvise64: ::c_long = 221;
pub const SYS_timer_create: ::c_long = 222;
pub const SYS_timer_settime: ::c_long = 223;
pub const SYS_timer_gettime: ::c_long = 224;
pub const SYS_timer_getoverrun: ::c_long = 225;
pub const SYS_timer_delete: ::c_long = 226;
pub const SYS_clock_settime: ::c_long = 227;
pub const SYS_clock_gettime: ::c_long = 228;
pub const SYS_clock_getres: ::c_long = 229;
pub const SYS_clock_nanosleep: ::c_long = 230;
pub const SYS_exit_group: ::c_long = 231;
pub const SYS_epoll_wait: ::c_long = 232;
pub const SYS_epoll_ctl: ::c_long = 233;
pub const SYS_tgkill: ::c_long = 234;
pub const SYS_utimes: ::c_long = 235;
pub const SYS_vserver: ::c_long = 236;
pub const SYS_mbind: ::c_long = 237;
pub const SYS_set_mempolicy: ::c_long = 238;
pub const SYS_get_mempolicy: ::c_long = 239;
pub const SYS_mq_open: ::c_long = 240;
pub const SYS_mq_unlink: ::c_long = 241;
pub const SYS_mq_timedsend: ::c_long = 242;
pub const SYS_mq_timedreceive: ::c_long = 243;
pub const SYS_mq_notify: ::c_long = 244;
pub const SYS_mq_getsetattr: ::c_long = 245;
pub const SYS_kexec_load: ::c_long = 246;
pub const SYS_waitid: ::c_long = 247;
pub const SYS_add_key: ::c_long = 248;
pub const SYS_request_key: ::c_long = 249;
pub const SYS_keyctl: ::c_long = 250;
pub const SYS_ioprio_set: ::c_long = 251;
pub const SYS_ioprio_get: ::c_long = 252;
pub const SYS_inotify_init: ::c_long = 253;
pub const SYS_inotify_add_watch: ::c_long = 254;
pub const SYS_inotify_rm_watch: ::c_long = 255;
pub const SYS_migrate_pages: ::c_long = 256;
pub const SYS_openat: ::c_long = 257;
pub const SYS_mkdirat: ::c_long = 258;
pub const SYS_mknodat: ::c_long = 259;
pub const SYS_fchownat: ::c_long = 260;
pub const SYS_futimesat: ::c_long = 261;
pub const SYS_newfstatat: ::c_long = 262;
pub const SYS_unlinkat: ::c_long = 263;
pub const SYS_renameat: ::c_long = 264;
pub const SYS_linkat: ::c_long = 265;
pub const SYS_symlinkat: ::c_long = 266;
pub const SYS_readlinkat: ::c_long = 267;
pub const SYS_fchmodat: ::c_long = 268;
pub const SYS_faccessat: ::c_long = 269;
pub const SYS_pselect6: ::c_long = 270;
pub const SYS_ppoll: ::c_long = 271;
pub const SYS_unshare: ::c_long = 272;
pub const SYS_set_robust_list: ::c_long = 273;
pub const SYS_get_robust_list: ::c_long = 274;
pub const SYS_splice: ::c_long = 275;
pub const SYS_tee: ::c_long = 276;
pub const SYS_sync_file_range: ::c_long = 277;
pub const SYS_vmsplice: ::c_long = 278;
pub const SYS_move_pages: ::c_long = 279;
pub const SYS_utimensat: ::c_long = 280;
pub const SYS_epoll_pwait: ::c_long = 281;
pub const SYS_signalfd: ::c_long = 282;
pub const SYS_timerfd_create: ::c_long = 283;
pub const SYS_eventfd: ::c_long = 284;
pub const SYS_fallocate: ::c_long = 285;
pub const SYS_timerfd_settime: ::c_long = 286;
pub const SYS_timerfd_gettime: ::c_long = 287;
pub const SYS_accept4: ::c_long = 288;
pub const SYS_signalfd4: ::c_long = 289;
pub const SYS_eventfd2: ::c_long = 290;
pub const SYS_epoll_create1: ::c_long = 291;
pub const SYS_dup3: ::c_long = 292;
pub const SYS_pipe2: ::c_long = 293;
pub const SYS_inotify_init1: ::c_long = 294;
pub const SYS_preadv: ::c_long = 295;
pub const SYS_pwritev: ::c_long = 296;
pub const SYS_rt_tgsigqueueinfo: ::c_long = 297;
pub const SYS_perf_event_open: ::c_long = 298;
pub const SYS_recvmmsg: ::c_long = 299;
pub const SYS_fanotify_init: ::c_long = 300;
pub const SYS_fanotify_mark: ::c_long = 301;
pub const SYS_prlimit64: ::c_long = 302;
pub const SYS_name_to_handle_at: ::c_long = 303;
pub const SYS_open_by_handle_at: ::c_long = 304;
pub const SYS_clock_adjtime: ::c_long = 305;
pub const SYS_syncfs: ::c_long = 306;
pub const SYS_sendmmsg: ::c_long = 307;
pub const SYS_setns: ::c_long = 308;
pub const SYS_getcpu: ::c_long = 309;
pub const SYS_process_vm_readv: ::c_long = 310;
pub const SYS_process_vm_writev: ::c_long = 311;
pub const SYS_kcmp: ::c_long = 312;
pub const SYS_finit_module: ::c_long = 313;
pub const SYS_sched_setattr: ::c_long = 314;
pub const SYS_sched_getattr: ::c_long = 315;
pub const SYS_renameat2: ::c_long = 316;
pub const SYS_seccomp: ::c_long = 317;
pub const SYS_getrandom: ::c_long = 318;
pub const SYS_memfd_create: ::c_long = 319;
pub const SYS_kexec_file_load: ::c_long = 320;
pub const SYS_bpf: ::c_long = 321;
pub const SYS_execveat: ::c_long = 322;
pub const SYS_userfaultfd: ::c_long = 323;
pub const SYS_membarrier: ::c_long = 324;
pub const SYS_mlock2: ::c_long = 325;
pub const SYS_copy_file_range: ::c_long = 326;
pub const SYS_preadv2: ::c_long = 327;
pub const SYS_pwritev2: ::c_long = 328;
pub const SYS_pkey_mprotect: ::c_long = 329;
pub const SYS_pkey_alloc: ::c_long = 330;
pub const SYS_pkey_free: ::c_long = 331;
pub const SYS_statx: ::c_long = 332;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
pub const SYS_open_tree: ::c_long = 428;
pub const SYS_move_mount: ::c_long = 429;
pub const SYS_fsopen: ::c_long = 430;
pub const SYS_fsconfig: ::c_long = 431;
pub const SYS_fsmount: ::c_long = 432;
pub const SYS_fspick: ::c_long = 433;
// offsets in user_regs_structs, from sys/reg.h
pub const R15: ::c_int = 0;
pub const R14: ::c_int = 1;
pub const R13: ::c_int = 2;
pub const R12: ::c_int = 3;
pub const RBP: ::c_int = 4;
pub const RBX: ::c_int = 5;
pub const R11: ::c_int = 6;
pub const R10: ::c_int = 7;
pub const R9: ::c_int = 8;
pub const R8: ::c_int = 9;
pub const RAX: ::c_int = 10;
pub const RCX: ::c_int = 11;
pub const RDX: ::c_int = 12;
pub const RSI: ::c_int = 13;
pub const RDI: ::c_int = 14;
pub const ORIG_RAX: ::c_int = 15;
pub const RIP: ::c_int = 16;
pub const CS: ::c_int = 17;
pub const EFLAGS: ::c_int = 18;
pub const RSP: ::c_int = 19;
pub const SS: ::c_int = 20;
pub const FS_BASE: ::c_int = 21;
pub const GS_BASE: ::c_int = 22;
pub const DS: ::c_int = 23;
pub const ES: ::c_int = 24;
pub const FS: ::c_int = 25;
pub const GS: ::c_int = 26;
// offsets in mcontext_t.gregs from sys/ucontext.h
pub const REG_R8: ::c_int = 0;
pub const REG_R9: ::c_int = 1;
pub const REG_R10: ::c_int = 2;
pub const REG_R11: ::c_int = 3;
pub const REG_R12: ::c_int = 4;
pub const REG_R13: ::c_int = 5;
pub const REG_R14: ::c_int = 6;
pub const REG_R15: ::c_int = 7;
pub const REG_RDI: ::c_int = 8;
pub const REG_RSI: ::c_int = 9;
pub const REG_RBP: ::c_int = 10;
pub const REG_RBX: ::c_int = 11;
pub const REG_RDX: ::c_int = 12;
pub const REG_RAX: ::c_int = 13;
pub const REG_RCX: ::c_int = 14;
pub const REG_RSP: ::c_int = 15;
pub const REG_RIP: ::c_int = 16;
pub const REG_EFL: ::c_int = 17;
pub const REG_CSGSFS: ::c_int = 18;
pub const REG_ERR: ::c_int = 19;
pub const REG_TRAPNO: ::c_int = 20;
pub const REG_OLDMASK: ::c_int = 21;
pub const REG_CR2: ::c_int = 22;
// From NDK's asm/auxvec.h
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 3;
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,74 @@
macro_rules! expand_align {
() => {
s! {
#[allow(missing_debug_implementations)]
#[repr(align(4))]
pub struct pthread_mutex_t {
size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
}
#[repr(align(4))]
pub struct pthread_rwlock_t {
size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
}
#[repr(align(4))]
pub struct pthread_mutexattr_t {
size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
}
#[repr(align(4))]
pub struct pthread_rwlockattr_t {
size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
}
#[repr(align(4))]
pub struct pthread_condattr_t {
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
}
}
s_no_extra_traits! {
#[cfg_attr(target_pointer_width = "32",
repr(align(4)))]
#[cfg_attr(target_pointer_width = "64",
repr(align(8)))]
pub struct pthread_cond_t {
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
}
#[allow(missing_debug_implementations)]
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 4]
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for pthread_cond_t {
fn eq(&self, other: &pthread_cond_t) -> bool {
self.size
.iter()
.zip(other.size.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_cond_t {}
impl ::fmt::Debug for pthread_cond_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_cond_t")
// FIXME: .field("size", &self.size)
.finish()
}
}
impl ::hash::Hash for pthread_cond_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.size.hash(state);
}
}
}
}
};
}

View file

@ -0,0 +1,213 @@
// In-sync with ../linux/musl/lfs64.rs except for fallocate64, prlimit64 and sendfile64
#[inline]
pub unsafe extern "C" fn creat64(path: *const ::c_char, mode: ::mode_t) -> ::c_int {
::creat(path, mode)
}
#[inline]
pub unsafe extern "C" fn fgetpos64(stream: *mut ::FILE, pos: *mut ::fpos64_t) -> ::c_int {
::fgetpos(stream, pos as *mut _)
}
#[inline]
pub unsafe extern "C" fn fopen64(pathname: *const ::c_char, mode: *const ::c_char) -> *mut ::FILE {
::fopen(pathname, mode)
}
#[inline]
pub unsafe extern "C" fn freopen64(
pathname: *const ::c_char,
mode: *const ::c_char,
stream: *mut ::FILE,
) -> *mut ::FILE {
::freopen(pathname, mode, stream)
}
#[inline]
pub unsafe extern "C" fn fseeko64(
stream: *mut ::FILE,
offset: ::off64_t,
whence: ::c_int,
) -> ::c_int {
::fseeko(stream, offset, whence)
}
#[inline]
pub unsafe extern "C" fn fsetpos64(stream: *mut ::FILE, pos: *const ::fpos64_t) -> ::c_int {
::fsetpos(stream, pos as *mut _)
}
#[inline]
pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int {
::fstat(fildes, buf as *mut _)
}
#[inline]
pub unsafe extern "C" fn fstatat64(
fd: ::c_int,
path: *const ::c_char,
buf: *mut ::stat64,
flag: ::c_int,
) -> ::c_int {
::fstatat(fd, path, buf as *mut _, flag)
}
#[inline]
pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int {
::fstatfs(fd, buf as *mut _)
}
#[inline]
pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int {
::fstatvfs(fd, buf as *mut _)
}
#[inline]
pub unsafe extern "C" fn ftello64(stream: *mut ::FILE) -> ::off64_t {
::ftello(stream)
}
#[inline]
pub unsafe extern "C" fn ftruncate64(fd: ::c_int, length: ::off64_t) -> ::c_int {
::ftruncate(fd, length)
}
#[inline]
pub unsafe extern "C" fn getrlimit64(resource: ::c_int, rlim: *mut ::rlimit64) -> ::c_int {
::getrlimit(resource, rlim as *mut _)
}
#[inline]
pub unsafe extern "C" fn lseek64(fd: ::c_int, offset: ::off64_t, whence: ::c_int) -> ::off64_t {
::lseek(fd, offset, whence)
}
#[inline]
pub unsafe extern "C" fn lstat64(path: *const ::c_char, buf: *mut ::stat64) -> ::c_int {
::lstat(path, buf as *mut _)
}
#[inline]
pub unsafe extern "C" fn mmap64(
addr: *mut ::c_void,
length: ::size_t,
prot: ::c_int,
flags: ::c_int,
fd: ::c_int,
offset: ::off64_t,
) -> *mut ::c_void {
::mmap(addr, length, prot, flags, fd, offset)
}
// These functions are variadic in the C ABI since the `mode` argument is "optional". Variadic
// `extern "C"` functions are unstable in Rust so we cannot write a shim function for these
// entrypoints. See https://github.com/rust-lang/rust/issues/44930.
//
// These aliases are mostly fine though, neither function takes a LFS64-namespaced type as an
// argument, nor do their names clash with any declared types.
pub use open as open64;
pub use openat as openat64;
#[inline]
pub unsafe extern "C" fn posix_fadvise64(
fd: ::c_int,
offset: ::off64_t,
len: ::off64_t,
advice: ::c_int,
) -> ::c_int {
::posix_fadvise(fd, offset, len, advice)
}
#[inline]
pub unsafe extern "C" fn posix_fallocate64(
fd: ::c_int,
offset: ::off64_t,
len: ::off64_t,
) -> ::c_int {
::posix_fallocate(fd, offset, len)
}
#[inline]
pub unsafe extern "C" fn pread64(
fd: ::c_int,
buf: *mut ::c_void,
count: ::size_t,
offset: ::off64_t,
) -> ::ssize_t {
::pread(fd, buf, count, offset)
}
#[inline]
pub unsafe extern "C" fn preadv64(
fd: ::c_int,
iov: *const ::iovec,
iovcnt: ::c_int,
offset: ::off64_t,
) -> ::ssize_t {
::preadv(fd, iov, iovcnt, offset)
}
#[inline]
pub unsafe extern "C" fn pwrite64(
fd: ::c_int,
buf: *const ::c_void,
count: ::size_t,
offset: ::off64_t,
) -> ::ssize_t {
::pwrite(fd, buf, count, offset)
}
#[inline]
pub unsafe extern "C" fn pwritev64(
fd: ::c_int,
iov: *const ::iovec,
iovcnt: ::c_int,
offset: ::off64_t,
) -> ::ssize_t {
::pwritev(fd, iov, iovcnt, offset)
}
#[inline]
pub unsafe extern "C" fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64 {
::readdir(dirp) as *mut _
}
#[inline]
pub unsafe extern "C" fn readdir64_r(
dirp: *mut ::DIR,
entry: *mut ::dirent64,
result: *mut *mut ::dirent64,
) -> ::c_int {
::readdir_r(dirp, entry as *mut _, result as *mut _)
}
#[inline]
pub unsafe extern "C" fn setrlimit64(resource: ::c_int, rlim: *const ::rlimit64) -> ::c_int {
::setrlimit(resource, rlim as *mut _)
}
#[inline]
pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int {
::stat(pathname, statbuf as *mut _)
}
#[inline]
pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int {
::statfs(pathname, buf as *mut _)
}
#[inline]
pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int {
::statvfs(path, buf as *mut _)
}
#[inline]
pub unsafe extern "C" fn tmpfile64() -> *mut ::FILE {
::tmpfile()
}
#[inline]
pub unsafe extern "C" fn truncate64(path: *const ::c_char, length: ::off64_t) -> ::c_int {
::truncate(path, length)
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,63 @@
macro_rules! expand_align {
() => {
s! {
pub struct pthread_mutex_t {
__align: [::c_long; 0],
size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
}
pub struct pthread_rwlock_t {
__align: [::c_long; 0],
size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
}
pub struct pthread_mutexattr_t {
__align: [::c_int; 0],
size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
}
pub struct pthread_rwlockattr_t {
__align: [::c_int; 0],
size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
}
pub struct pthread_condattr_t {
__align: [::c_int; 0],
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
}
}
s_no_extra_traits! {
pub struct pthread_cond_t {
__align: [*const ::c_void; 0],
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for pthread_cond_t {
fn eq(&self, other: &pthread_cond_t) -> bool {
self.size
.iter()
.zip(other.size.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_cond_t {}
impl ::fmt::Debug for pthread_cond_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_cond_t")
// FIXME: .field("size", &self.size)
.finish()
}
}
impl ::hash::Hash for pthread_cond_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.size.hash(state);
}
}
}
}
};
}

View file

@ -0,0 +1,223 @@
macro_rules! expand_align {
() => {
s! {
#[cfg_attr(any(target_pointer_width = "32",
target_arch = "x86_64",
target_arch = "powerpc64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "s390x",
target_arch = "sparc64",
target_arch = "aarch64",
target_arch = "riscv64",
target_arch = "riscv32",
target_arch = "loongarch64"),
repr(align(4)))]
#[cfg_attr(not(any(target_pointer_width = "32",
target_arch = "x86_64",
target_arch = "powerpc64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "s390x",
target_arch = "sparc64",
target_arch = "aarch64",
target_arch = "riscv64",
target_arch = "riscv32",
target_arch = "loongarch64")),
repr(align(8)))]
pub struct pthread_mutexattr_t {
#[doc(hidden)]
size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
}
#[cfg_attr(any(target_env = "musl", target_env = "ohos", target_pointer_width = "32"),
repr(align(4)))]
#[cfg_attr(all(not(target_env = "musl"),
not(target_env = "ohos"),
target_pointer_width = "64"),
repr(align(8)))]
pub struct pthread_rwlockattr_t {
#[doc(hidden)]
size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
}
#[repr(align(4))]
pub struct pthread_condattr_t {
#[doc(hidden)]
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
}
#[repr(align(4))]
pub struct pthread_barrierattr_t {
#[doc(hidden)]
size: [u8; ::__SIZEOF_PTHREAD_BARRIERATTR_T],
}
#[repr(align(8))]
pub struct fanotify_event_metadata {
pub event_len: __u32,
pub vers: __u8,
pub reserved: __u8,
pub metadata_len: __u16,
pub mask: __u64,
pub fd: ::c_int,
pub pid: ::c_int,
}
#[repr(align(8))]
pub struct tpacket_rollover_stats {
pub tp_all: ::__u64,
pub tp_huge: ::__u64,
pub tp_failed: ::__u64,
}
#[repr(align(8))]
pub struct tpacket_hdr_v1 {
pub block_status: ::__u32,
pub num_pkts: ::__u32,
pub offset_to_first_pkt: ::__u32,
pub blk_len: ::__u32,
pub seq_num: ::__u64,
pub ts_first_pkt: ::tpacket_bd_ts,
pub ts_last_pkt: ::tpacket_bd_ts,
}
}
s_no_extra_traits! {
#[cfg_attr(all(any(target_env = "musl", target_env = "ohos"),
target_pointer_width = "32"),
repr(align(4)))]
#[cfg_attr(all(any(target_env = "musl", target_env = "ohos"),
target_pointer_width = "64"),
repr(align(8)))]
#[cfg_attr(all(not(any(target_env = "musl", target_env = "ohos")),
target_arch = "x86"),
repr(align(4)))]
#[cfg_attr(all(not(any(target_env = "musl", target_env = "ohos")),
not(target_arch = "x86")),
repr(align(8)))]
pub struct pthread_cond_t {
#[doc(hidden)]
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
}
#[cfg_attr(all(target_pointer_width = "32",
any(target_arch = "mips",
target_arch = "mips32r6",
target_arch = "arm",
target_arch = "hexagon",
target_arch = "m68k",
target_arch = "csky",
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "x86_64",
target_arch = "x86")),
repr(align(4)))]
#[cfg_attr(any(target_pointer_width = "64",
not(any(target_arch = "mips",
target_arch = "mips32r6",
target_arch = "arm",
target_arch = "hexagon",
target_arch = "m68k",
target_arch = "csky",
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "x86_64",
target_arch = "x86"))),
repr(align(8)))]
pub struct pthread_mutex_t {
#[doc(hidden)]
size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
}
#[cfg_attr(all(target_pointer_width = "32",
any(target_arch = "mips",
target_arch = "mips32r6",
target_arch = "arm",
target_arch = "hexagon",
target_arch = "m68k",
target_arch = "csky",
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "x86_64",
target_arch = "x86")),
repr(align(4)))]
#[cfg_attr(any(target_pointer_width = "64",
not(any(target_arch = "mips",
target_arch = "mips32r6",
target_arch = "arm",
target_arch = "hexagon",
target_arch = "m68k",
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "x86_64",
target_arch = "x86"))),
repr(align(8)))]
pub struct pthread_rwlock_t {
size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
}
#[cfg_attr(all(target_pointer_width = "32",
any(target_arch = "mips",
target_arch = "mips32r6",
target_arch = "arm",
target_arch = "hexagon",
target_arch = "m68k",
target_arch = "csky",
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "x86_64",
target_arch = "x86")),
repr(align(4)))]
#[cfg_attr(any(target_pointer_width = "64",
not(any(target_arch = "mips",
target_arch = "mips32r6",
target_arch = "arm",
target_arch = "hexagon",
target_arch = "m68k",
target_arch = "csky",
target_arch = "powerpc",
target_arch = "sparc",
target_arch = "x86_64",
target_arch = "x86"))),
repr(align(8)))]
pub struct pthread_barrier_t {
size: [u8; ::__SIZEOF_PTHREAD_BARRIER_T],
}
// linux/can.h
#[repr(align(8))]
#[allow(missing_debug_implementations)]
pub struct can_frame {
pub can_id: canid_t,
pub can_dlc: u8,
__pad: u8,
__res0: u8,
__res1: u8,
pub data: [u8; CAN_MAX_DLEN],
}
#[repr(align(8))]
#[allow(missing_debug_implementations)]
pub struct canfd_frame {
pub can_id: canid_t,
pub len: u8,
pub flags: u8,
__res0: u8,
__res1: u8,
pub data: [u8; CANFD_MAX_DLEN],
}
#[repr(align(8))]
#[allow(missing_debug_implementations)]
pub struct canxl_frame {
pub prio: canid_t,
pub flags: u8,
pub sdt: u8,
pub len: u16,
pub af: u32,
pub data: [u8; CANXL_MAX_DLEN],
}
}
};
}

View file

@ -0,0 +1,333 @@
s! {
pub struct termios2 {
pub c_iflag: ::tcflag_t,
pub c_oflag: ::tcflag_t,
pub c_cflag: ::tcflag_t,
pub c_lflag: ::tcflag_t,
pub c_line: ::cc_t,
pub c_cc: [::cc_t; 19],
pub c_ispeed: ::speed_t,
pub c_ospeed: ::speed_t,
}
}
// include/uapi/asm-generic/socket.h
// arch/alpha/include/uapi/asm/socket.h
// tools/include/uapi/asm-generic/socket.h
// arch/mips/include/uapi/asm/socket.h
pub const SOL_SOCKET: ::c_int = 1;
// Defined in unix/linux_like/mod.rs
// pub const SO_DEBUG: ::c_int = 1;
pub const SO_REUSEADDR: ::c_int = 2;
pub const SO_TYPE: ::c_int = 3;
pub const SO_ERROR: ::c_int = 4;
pub const SO_DONTROUTE: ::c_int = 5;
pub const SO_BROADCAST: ::c_int = 6;
pub const SO_SNDBUF: ::c_int = 7;
pub const SO_RCVBUF: ::c_int = 8;
pub const SO_KEEPALIVE: ::c_int = 9;
pub const SO_OOBINLINE: ::c_int = 10;
pub const SO_NO_CHECK: ::c_int = 11;
pub const SO_PRIORITY: ::c_int = 12;
pub const SO_LINGER: ::c_int = 13;
pub const SO_BSDCOMPAT: ::c_int = 14;
pub const SO_REUSEPORT: ::c_int = 15;
pub const SO_PASSCRED: ::c_int = 16;
pub const SO_PEERCRED: ::c_int = 17;
pub const SO_RCVLOWAT: ::c_int = 18;
pub const SO_SNDLOWAT: ::c_int = 19;
pub const SO_RCVTIMEO: ::c_int = 20;
pub const SO_SNDTIMEO: ::c_int = 21;
// pub const SO_RCVTIMEO_OLD: ::c_int = 20;
// pub const SO_SNDTIMEO_OLD: ::c_int = 21;
pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
pub const SO_BINDTODEVICE: ::c_int = 25;
pub const SO_ATTACH_FILTER: ::c_int = 26;
pub const SO_DETACH_FILTER: ::c_int = 27;
pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
pub const SO_PEERNAME: ::c_int = 28;
pub const SO_TIMESTAMP: ::c_int = 29;
// pub const SO_TIMESTAMP_OLD: ::c_int = 29;
pub const SO_ACCEPTCONN: ::c_int = 30;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_SNDBUFFORCE: ::c_int = 32;
pub const SO_RCVBUFFORCE: ::c_int = 33;
pub const SO_PASSSEC: ::c_int = 34;
pub const SO_TIMESTAMPNS: ::c_int = 35;
// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
pub const SO_MARK: ::c_int = 36;
pub const SO_TIMESTAMPING: ::c_int = 37;
// pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
pub const SO_PROTOCOL: ::c_int = 38;
pub const SO_DOMAIN: ::c_int = 39;
pub const SO_RXQ_OVFL: ::c_int = 40;
pub const SO_WIFI_STATUS: ::c_int = 41;
pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
pub const SO_PEEK_OFF: ::c_int = 42;
pub const SO_NOFCS: ::c_int = 43;
pub const SO_LOCK_FILTER: ::c_int = 44;
pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
pub const SO_BUSY_POLL: ::c_int = 46;
pub const SO_MAX_PACING_RATE: ::c_int = 47;
pub const SO_BPF_EXTENSIONS: ::c_int = 48;
pub const SO_INCOMING_CPU: ::c_int = 49;
pub const SO_ATTACH_BPF: ::c_int = 50;
pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51;
pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52;
pub const SO_CNX_ADVICE: ::c_int = 53;
pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
pub const SO_MEMINFO: ::c_int = 55;
pub const SO_INCOMING_NAPI_ID: ::c_int = 56;
pub const SO_COOKIE: ::c_int = 57;
pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
pub const SO_PEERGROUPS: ::c_int = 59;
pub const SO_ZEROCOPY: ::c_int = 60;
pub const SO_TXTIME: ::c_int = 61;
pub const SCM_TXTIME: ::c_int = SO_TXTIME;
pub const SO_BINDTOIFINDEX: ::c_int = 62;
cfg_if! {
// Some of these platforms in CI already have these constants.
// But they may still not have those _OLD ones.
if #[cfg(all(any(target_arch = "x86",
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "csky",
target_arch = "loongarch64"),
not(any(target_env = "musl", target_env = "ohos"))))] {
pub const SO_TIMESTAMP_NEW: ::c_int = 63;
pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
pub const SO_RCVTIMEO_NEW: ::c_int = 66;
pub const SO_SNDTIMEO_NEW: ::c_int = 67;
pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
}
}
// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
cfg_if! {
if #[cfg(any(target_arch = "x86",
target_arch = "x86_64",
target_arch = "arm",
target_arch = "aarch64",
target_arch = "riscv64",
target_arch = "s390x",
target_arch = "csky",
target_arch = "loongarch64"))] {
pub const FICLONE: ::c_ulong = 0x40049409;
pub const FICLONERANGE: ::c_ulong = 0x4020940D;
}
}
// Defined in unix/linux_like/mod.rs
// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
// Ioctl Constants
pub const TCGETS: ::Ioctl = 0x5401;
pub const TCSETS: ::Ioctl = 0x5402;
pub const TCSETSW: ::Ioctl = 0x5403;
pub const TCSETSF: ::Ioctl = 0x5404;
pub const TCGETA: ::Ioctl = 0x5405;
pub const TCSETA: ::Ioctl = 0x5406;
pub const TCSETAW: ::Ioctl = 0x5407;
pub const TCSETAF: ::Ioctl = 0x5408;
pub const TCSBRK: ::Ioctl = 0x5409;
pub const TCXONC: ::Ioctl = 0x540A;
pub const TCFLSH: ::Ioctl = 0x540B;
pub const TIOCEXCL: ::Ioctl = 0x540C;
pub const TIOCNXCL: ::Ioctl = 0x540D;
pub const TIOCSCTTY: ::Ioctl = 0x540E;
pub const TIOCGPGRP: ::Ioctl = 0x540F;
pub const TIOCSPGRP: ::Ioctl = 0x5410;
pub const TIOCOUTQ: ::Ioctl = 0x5411;
pub const TIOCSTI: ::Ioctl = 0x5412;
pub const TIOCGWINSZ: ::Ioctl = 0x5413;
pub const TIOCSWINSZ: ::Ioctl = 0x5414;
pub const TIOCMGET: ::Ioctl = 0x5415;
pub const TIOCMBIS: ::Ioctl = 0x5416;
pub const TIOCMBIC: ::Ioctl = 0x5417;
pub const TIOCMSET: ::Ioctl = 0x5418;
pub const TIOCGSOFTCAR: ::Ioctl = 0x5419;
pub const TIOCSSOFTCAR: ::Ioctl = 0x541A;
pub const FIONREAD: ::Ioctl = 0x541B;
pub const TIOCINQ: ::Ioctl = FIONREAD;
pub const TIOCLINUX: ::Ioctl = 0x541C;
pub const TIOCCONS: ::Ioctl = 0x541D;
pub const TIOCGSERIAL: ::Ioctl = 0x541E;
pub const TIOCSSERIAL: ::Ioctl = 0x541F;
pub const TIOCPKT: ::Ioctl = 0x5420;
pub const FIONBIO: ::Ioctl = 0x5421;
pub const TIOCNOTTY: ::Ioctl = 0x5422;
pub const TIOCSETD: ::Ioctl = 0x5423;
pub const TIOCGETD: ::Ioctl = 0x5424;
pub const TCSBRKP: ::Ioctl = 0x5425;
pub const TIOCSBRK: ::Ioctl = 0x5427;
pub const TIOCCBRK: ::Ioctl = 0x5428;
pub const TIOCGSID: ::Ioctl = 0x5429;
pub const TCGETS2: ::Ioctl = 0x802c542a;
pub const TCSETS2: ::Ioctl = 0x402c542b;
pub const TCSETSW2: ::Ioctl = 0x402c542c;
pub const TCSETSF2: ::Ioctl = 0x402c542d;
pub const TIOCGRS485: ::Ioctl = 0x542E;
pub const TIOCSRS485: ::Ioctl = 0x542F;
pub const TIOCGPTN: ::Ioctl = 0x80045430;
pub const TIOCSPTLCK: ::Ioctl = 0x40045431;
pub const TIOCGDEV: ::Ioctl = 0x80045432;
pub const TCGETX: ::Ioctl = 0x5432;
pub const TCSETX: ::Ioctl = 0x5433;
pub const TCSETXF: ::Ioctl = 0x5434;
pub const TCSETXW: ::Ioctl = 0x5435;
pub const TIOCSIG: ::Ioctl = 0x40045436;
pub const TIOCVHANGUP: ::Ioctl = 0x5437;
pub const TIOCGPKT: ::Ioctl = 0x80045438;
pub const TIOCGPTLCK: ::Ioctl = 0x80045439;
pub const TIOCGEXCL: ::Ioctl = 0x80045440;
pub const TIOCGPTPEER: ::Ioctl = 0x5441;
// pub const TIOCGISO7816: ::Ioctl = 0x80285442;
// pub const TIOCSISO7816: ::Ioctl = 0xc0285443;
pub const FIONCLEX: ::Ioctl = 0x5450;
pub const FIOCLEX: ::Ioctl = 0x5451;
pub const FIOASYNC: ::Ioctl = 0x5452;
pub const TIOCSERCONFIG: ::Ioctl = 0x5453;
pub const TIOCSERGWILD: ::Ioctl = 0x5454;
pub const TIOCSERSWILD: ::Ioctl = 0x5455;
pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456;
pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457;
pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458;
pub const TIOCSERGETLSR: ::Ioctl = 0x5459;
pub const TIOCSERGETMULTI: ::Ioctl = 0x545A;
pub const TIOCSERSETMULTI: ::Ioctl = 0x545B;
pub const TIOCMIWAIT: ::Ioctl = 0x545C;
pub const TIOCGICOUNT: ::Ioctl = 0x545D;
pub const BLKIOMIN: ::Ioctl = 0x1278;
pub const BLKIOOPT: ::Ioctl = 0x1279;
pub const BLKSSZGET: ::Ioctl = 0x1268;
pub const BLKPBSZGET: ::Ioctl = 0x127B;
cfg_if! {
// Those type are constructed using the _IOC macro
// DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
// where D stands for direction (either None (00), Read (01) or Write (11))
// where S stands for size (int, long, struct...)
// where T stands for type ('f','v','X'...)
// where N stands for NR (NumbeR)
if #[cfg(any(target_arch = "x86", target_arch = "arm", target_arch = "csky"))] {
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80046601;
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40046602;
pub const FS_IOC_GETVERSION: ::Ioctl = 0x80047601;
pub const FS_IOC_SETVERSION: ::Ioctl = 0x40047602;
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601;
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602;
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601;
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
} else if #[cfg(any(target_arch = "x86_64",
target_arch = "riscv64",
target_arch = "aarch64",
target_arch = "s390x",
target_arch = "loongarch64"))] {
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x80086601;
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x40086602;
pub const FS_IOC_GETVERSION: ::Ioctl = 0x80087601;
pub const FS_IOC_SETVERSION: ::Ioctl = 0x40087602;
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x80046601;
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x40046602;
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x80047601;
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
}
}
cfg_if! {
if #[cfg(any(target_arch = "arm",
target_arch = "s390x"))] {
pub const FIOQSIZE: ::Ioctl = 0x545E;
} else {
pub const FIOQSIZE: ::Ioctl = 0x5460;
}
}
pub const TIOCM_LE: ::c_int = 0x001;
pub const TIOCM_DTR: ::c_int = 0x002;
pub const TIOCM_RTS: ::c_int = 0x004;
pub const TIOCM_ST: ::c_int = 0x008;
pub const TIOCM_SR: ::c_int = 0x010;
pub const TIOCM_CTS: ::c_int = 0x020;
pub const TIOCM_CAR: ::c_int = 0x040;
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
pub const TIOCM_RNG: ::c_int = 0x080;
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
pub const TIOCM_DSR: ::c_int = 0x100;
pub const BOTHER: ::speed_t = 0o010000;
pub const IBSHIFT: ::tcflag_t = 16;
// RLIMIT Constants
cfg_if! {
if #[cfg(any(target_env = "gnu",
target_env = "uclibc"))] {
pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
} else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
pub const RLIMIT_CPU: ::c_int = 0;
pub const RLIMIT_FSIZE: ::c_int = 1;
pub const RLIMIT_DATA: ::c_int = 2;
pub const RLIMIT_STACK: ::c_int = 3;
pub const RLIMIT_CORE: ::c_int = 4;
pub const RLIMIT_RSS: ::c_int = 5;
pub const RLIMIT_NPROC: ::c_int = 6;
pub const RLIMIT_NOFILE: ::c_int = 7;
pub const RLIMIT_MEMLOCK: ::c_int = 8;
pub const RLIMIT_AS: ::c_int = 9;
pub const RLIMIT_LOCKS: ::c_int = 10;
pub const RLIMIT_SIGPENDING: ::c_int = 11;
pub const RLIMIT_MSGQUEUE: ::c_int = 12;
pub const RLIMIT_NICE: ::c_int = 13;
pub const RLIMIT_RTPRIO: ::c_int = 14;
pub const RLIMIT_RTTIME: ::c_int = 15;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::c_int = 15;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS;
}
}
cfg_if! {
if #[cfg(target_env = "gnu")] {
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
}
else if #[cfg(target_env = "uclibc")] {
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::__rlimit_resource_t = 15;
}
}
pub const RLIM_INFINITY: ::rlim_t = !0;

View file

@ -0,0 +1,323 @@
s! {
pub struct termios2 {
pub c_iflag: ::tcflag_t,
pub c_oflag: ::tcflag_t,
pub c_cflag: ::tcflag_t,
pub c_lflag: ::tcflag_t,
pub c_line: ::cc_t,
pub c_cc: [::cc_t; 23],
pub c_ispeed: ::speed_t,
pub c_ospeed: ::speed_t,
}
}
// arch/mips/include/uapi/asm/socket.h
pub const SOL_SOCKET: ::c_int = 0xffff;
// Defined in unix/linux_like/mod.rs
// pub const SO_DEBUG: ::c_int = 0x0001;
pub const SO_REUSEADDR: ::c_int = 0x0004;
pub const SO_KEEPALIVE: ::c_int = 0x0008;
pub const SO_DONTROUTE: ::c_int = 0x0010;
pub const SO_BROADCAST: ::c_int = 0x0020;
pub const SO_LINGER: ::c_int = 0x0080;
pub const SO_OOBINLINE: ::c_int = 0x0100;
pub const SO_REUSEPORT: ::c_int = 0x0200;
pub const SO_TYPE: ::c_int = 0x1008;
// pub const SO_STYLE: ::c_int = SO_TYPE;
pub const SO_ERROR: ::c_int = 0x1007;
pub const SO_SNDBUF: ::c_int = 0x1001;
pub const SO_RCVBUF: ::c_int = 0x1002;
pub const SO_SNDLOWAT: ::c_int = 0x1003;
pub const SO_RCVLOWAT: ::c_int = 0x1004;
// NOTE: These definitions are now being renamed with _OLD postfix,
// but CI haven't support them yet.
// Some related consts could be found in b32.rs and b64.rs
pub const SO_SNDTIMEO: ::c_int = 0x1005;
pub const SO_RCVTIMEO: ::c_int = 0x1006;
// pub const SO_SNDTIMEO_OLD: ::c_int = 0x1005;
// pub const SO_RCVTIMEO_OLD: ::c_int = 0x1006;
pub const SO_ACCEPTCONN: ::c_int = 0x1009;
pub const SO_PROTOCOL: ::c_int = 0x1028;
pub const SO_DOMAIN: ::c_int = 0x1029;
pub const SO_NO_CHECK: ::c_int = 11;
pub const SO_PRIORITY: ::c_int = 12;
pub const SO_BSDCOMPAT: ::c_int = 14;
pub const SO_PASSCRED: ::c_int = 17;
pub const SO_PEERCRED: ::c_int = 18;
pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
pub const SO_BINDTODEVICE: ::c_int = 25;
pub const SO_ATTACH_FILTER: ::c_int = 26;
pub const SO_DETACH_FILTER: ::c_int = 27;
pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
pub const SO_PEERNAME: ::c_int = 28;
pub const SO_PEERSEC: ::c_int = 30;
pub const SO_SNDBUFFORCE: ::c_int = 31;
pub const SO_RCVBUFFORCE: ::c_int = 33;
pub const SO_PASSSEC: ::c_int = 34;
pub const SO_MARK: ::c_int = 36;
pub const SO_RXQ_OVFL: ::c_int = 40;
pub const SO_WIFI_STATUS: ::c_int = 41;
pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
pub const SO_PEEK_OFF: ::c_int = 42;
pub const SO_NOFCS: ::c_int = 43;
pub const SO_LOCK_FILTER: ::c_int = 44;
pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
pub const SO_BUSY_POLL: ::c_int = 46;
pub const SO_MAX_PACING_RATE: ::c_int = 47;
pub const SO_BPF_EXTENSIONS: ::c_int = 48;
pub const SO_INCOMING_CPU: ::c_int = 49;
pub const SO_ATTACH_BPF: ::c_int = 50;
pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51;
pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52;
pub const SO_CNX_ADVICE: ::c_int = 53;
pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
pub const SO_MEMINFO: ::c_int = 55;
pub const SO_INCOMING_NAPI_ID: ::c_int = 56;
pub const SO_COOKIE: ::c_int = 57;
pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
pub const SO_PEERGROUPS: ::c_int = 59;
pub const SO_ZEROCOPY: ::c_int = 60;
pub const SO_TXTIME: ::c_int = 61;
pub const SCM_TXTIME: ::c_int = SO_TXTIME;
pub const SO_BINDTOIFINDEX: ::c_int = 62;
// NOTE: These definitions are now being renamed with _OLD postfix,
// but CI haven't support them yet.
// Some related consts could be found in b32.rs and b64.rs
pub const SO_TIMESTAMP: ::c_int = 29;
pub const SO_TIMESTAMPNS: ::c_int = 35;
pub const SO_TIMESTAMPING: ::c_int = 37;
// pub const SO_TIMESTAMP_OLD: ::c_int = 29;
// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
// pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
// pub const SO_TIMESTAMP_NEW: ::c_int = 63;
// pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
// pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
// pub const SO_RCVTIMEO_NEW: ::c_int = 66;
// pub const SO_SNDTIMEO_NEW: ::c_int = 67;
// pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
pub const FICLONE: ::c_ulong = 0x80049409;
pub const FICLONERANGE: ::c_ulong = 0x8020940D;
// Defined in unix/linux_like/mod.rs
// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
// Ioctl Constants
pub const TCGETS: ::Ioctl = 0x540d;
pub const TCSETS: ::Ioctl = 0x540e;
pub const TCSETSW: ::Ioctl = 0x540f;
pub const TCSETSF: ::Ioctl = 0x5410;
pub const TCGETA: ::Ioctl = 0x5401;
pub const TCSETA: ::Ioctl = 0x5402;
pub const TCSETAW: ::Ioctl = 0x5403;
pub const TCSETAF: ::Ioctl = 0x5404;
pub const TCSBRK: ::Ioctl = 0x5405;
pub const TCXONC: ::Ioctl = 0x5406;
pub const TCFLSH: ::Ioctl = 0x5407;
pub const TIOCEXCL: ::Ioctl = 0x740d;
pub const TIOCNXCL: ::Ioctl = 0x740e;
pub const TIOCSCTTY: ::Ioctl = 0x5480;
pub const TIOCGPGRP: ::Ioctl = 0x40047477;
pub const TIOCSPGRP: ::Ioctl = 0x80047476;
pub const TIOCOUTQ: ::Ioctl = 0x7472;
pub const TIOCSTI: ::Ioctl = 0x5472;
pub const TIOCGWINSZ: ::Ioctl = 0x40087468;
pub const TIOCSWINSZ: ::Ioctl = 0x80087467;
pub const TIOCMGET: ::Ioctl = 0x741d;
pub const TIOCMBIS: ::Ioctl = 0x741b;
pub const TIOCMBIC: ::Ioctl = 0x741c;
pub const TIOCMSET: ::Ioctl = 0x741a;
pub const TIOCGSOFTCAR: ::Ioctl = 0x5481;
pub const TIOCSSOFTCAR: ::Ioctl = 0x5482;
pub const FIONREAD: ::Ioctl = 0x467f;
pub const TIOCINQ: ::Ioctl = FIONREAD;
pub const TIOCLINUX: ::Ioctl = 0x5483;
pub const TIOCCONS: ::Ioctl = 0x80047478;
pub const TIOCGSERIAL: ::Ioctl = 0x5484;
pub const TIOCSSERIAL: ::Ioctl = 0x5485;
pub const TIOCPKT: ::Ioctl = 0x5470;
pub const FIONBIO: ::Ioctl = 0x667e;
pub const TIOCNOTTY: ::Ioctl = 0x5471;
pub const TIOCSETD: ::Ioctl = 0x7401;
pub const TIOCGETD: ::Ioctl = 0x7400;
pub const TCSBRKP: ::Ioctl = 0x5486;
pub const TIOCSBRK: ::Ioctl = 0x5427;
pub const TIOCCBRK: ::Ioctl = 0x5428;
pub const TIOCGSID: ::Ioctl = 0x7416;
pub const TCGETS2: ::Ioctl = 0x4030542a;
pub const TCSETS2: ::Ioctl = 0x8030542b;
pub const TCSETSW2: ::Ioctl = 0x8030542c;
pub const TCSETSF2: ::Ioctl = 0x8030542d;
pub const TIOCGPTN: ::Ioctl = 0x40045430;
pub const TIOCSPTLCK: ::Ioctl = 0x80045431;
pub const TIOCGDEV: ::Ioctl = 0x40045432;
pub const TIOCSIG: ::Ioctl = 0x80045436;
pub const TIOCVHANGUP: ::Ioctl = 0x5437;
pub const TIOCGPKT: ::Ioctl = 0x40045438;
pub const TIOCGPTLCK: ::Ioctl = 0x40045439;
pub const TIOCGEXCL: ::Ioctl = 0x40045440;
pub const TIOCGPTPEER: ::Ioctl = 0x20005441;
//pub const TIOCGISO7816: ::Ioctl = 0x40285442;
//pub const TIOCSISO7816: ::Ioctl = 0xc0285443;
pub const FIONCLEX: ::Ioctl = 0x6602;
pub const FIOCLEX: ::Ioctl = 0x6601;
pub const FIOASYNC: ::Ioctl = 0x667d;
pub const TIOCSERCONFIG: ::Ioctl = 0x5488;
pub const TIOCSERGWILD: ::Ioctl = 0x5489;
pub const TIOCSERSWILD: ::Ioctl = 0x548a;
pub const TIOCGLCKTRMIOS: ::Ioctl = 0x548b;
pub const TIOCSLCKTRMIOS: ::Ioctl = 0x548c;
pub const TIOCSERGSTRUCT: ::Ioctl = 0x548d;
pub const TIOCSERGETLSR: ::Ioctl = 0x548e;
pub const TIOCSERGETMULTI: ::Ioctl = 0x548f;
pub const TIOCSERSETMULTI: ::Ioctl = 0x5490;
pub const TIOCMIWAIT: ::Ioctl = 0x5491;
pub const TIOCGICOUNT: ::Ioctl = 0x5492;
pub const FIOQSIZE: ::Ioctl = 0x667f;
pub const TIOCSLTC: ::Ioctl = 0x7475;
pub const TIOCGETP: ::Ioctl = 0x7408;
pub const TIOCSETP: ::Ioctl = 0x7409;
pub const TIOCSETN: ::Ioctl = 0x740a;
pub const BLKIOMIN: ::Ioctl = 0x20001278;
pub const BLKIOOPT: ::Ioctl = 0x20001279;
pub const BLKSSZGET: ::Ioctl = 0x20001268;
pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
cfg_if! {
// Those type are constructed using the _IOC macro
// DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
// where D stands for direction (either None (00), Read (01) or Write (11))
// where S stands for size (int, long, struct...)
// where T stands for type ('f','v','X'...)
// where N stands for NR (NumbeR)
if #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] {
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601;
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602;
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601;
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602;
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
} else if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))] {
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602;
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601;
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602;
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
}
}
cfg_if! {
if #[cfg(target_env = "musl")] {
pub const TIOCGRS485: ::Ioctl = 0x4020542e;
pub const TIOCSRS485: ::Ioctl = 0xc020542f;
}
}
pub const TIOCM_LE: ::c_int = 0x001;
pub const TIOCM_DTR: ::c_int = 0x002;
pub const TIOCM_RTS: ::c_int = 0x004;
pub const TIOCM_ST: ::c_int = 0x010;
pub const TIOCM_SR: ::c_int = 0x020;
pub const TIOCM_CTS: ::c_int = 0x040;
pub const TIOCM_CAR: ::c_int = 0x100;
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
pub const TIOCM_RNG: ::c_int = 0x200;
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
pub const TIOCM_DSR: ::c_int = 0x400;
pub const BOTHER: ::speed_t = 0o010000;
pub const IBSHIFT: ::tcflag_t = 16;
// RLIMIT Constants
cfg_if! {
if #[cfg(any(target_env = "gnu",
target_env = "uclibc"))] {
pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 5;
pub const RLIMIT_AS: ::__rlimit_resource_t = 6;
pub const RLIMIT_RSS: ::__rlimit_resource_t = 7;
pub const RLIMIT_NPROC: ::__rlimit_resource_t = 8;
pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 9;
pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
} else if #[cfg(target_env = "musl")] {
pub const RLIMIT_CPU: ::c_int = 0;
pub const RLIMIT_FSIZE: ::c_int = 1;
pub const RLIMIT_DATA: ::c_int = 2;
pub const RLIMIT_STACK: ::c_int = 3;
pub const RLIMIT_CORE: ::c_int = 4;
pub const RLIMIT_NOFILE: ::c_int = 5;
pub const RLIMIT_AS: ::c_int = 6;
pub const RLIMIT_RSS: ::c_int = 7;
pub const RLIMIT_NPROC: ::c_int = 8;
pub const RLIMIT_MEMLOCK: ::c_int = 9;
pub const RLIMIT_LOCKS: ::c_int = 10;
pub const RLIMIT_SIGPENDING: ::c_int = 11;
pub const RLIMIT_MSGQUEUE: ::c_int = 12;
pub const RLIMIT_NICE: ::c_int = 13;
pub const RLIMIT_RTPRIO: ::c_int = 14;
pub const RLIMIT_RTTIME: ::c_int = 15;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::c_int = 15;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS;
pub const RLIM_INFINITY: ::rlim_t = !0;
}
}
cfg_if! {
if #[cfg(target_env = "gnu")] {
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
} else if #[cfg(target_env = "uclibc")] {
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::__rlimit_resource_t = 15;
}
}
cfg_if! {
if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"),
any(target_env = "gnu",
target_env = "uclibc"))] {
pub const RLIM_INFINITY: ::rlim_t = !0;
}
}
cfg_if! {
if #[cfg(any(target_arch = "mips", target_arch = "mips32r6"),
any(target_env = "gnu",
target_env = "uclibc"))] {
pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
}
}

View file

@ -0,0 +1,18 @@
cfg_if! {
if #[cfg(any(target_arch = "mips",
target_arch = "mips32r6",
target_arch = "mips64",
target_arch = "mips64r6"))] {
mod mips;
pub use self::mips::*;
} else if #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))] {
mod powerpc;
pub use self::powerpc::*;
} else if #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] {
mod sparc;
pub use self::sparc::*;
} else {
mod generic;
pub use self::generic::*;
}
}

View file

@ -0,0 +1,277 @@
// arch/powerpc/include/uapi/asm/socket.h
pub const SOL_SOCKET: ::c_int = 1;
// Defined in unix/linux_like/mod.rs
// pub const SO_DEBUG: ::c_int = 1;
pub const SO_REUSEADDR: ::c_int = 2;
pub const SO_TYPE: ::c_int = 3;
pub const SO_ERROR: ::c_int = 4;
pub const SO_DONTROUTE: ::c_int = 5;
pub const SO_BROADCAST: ::c_int = 6;
pub const SO_SNDBUF: ::c_int = 7;
pub const SO_RCVBUF: ::c_int = 8;
pub const SO_KEEPALIVE: ::c_int = 9;
pub const SO_OOBINLINE: ::c_int = 10;
pub const SO_NO_CHECK: ::c_int = 11;
pub const SO_PRIORITY: ::c_int = 12;
pub const SO_LINGER: ::c_int = 13;
pub const SO_BSDCOMPAT: ::c_int = 14;
pub const SO_REUSEPORT: ::c_int = 15;
// powerpc only differs in these
pub const SO_RCVLOWAT: ::c_int = 16;
pub const SO_SNDLOWAT: ::c_int = 17;
pub const SO_RCVTIMEO: ::c_int = 18;
pub const SO_SNDTIMEO: ::c_int = 19;
// pub const SO_RCVTIMEO_OLD: ::c_int = 18;
// pub const SO_SNDTIMEO_OLD: ::c_int = 19;
pub const SO_PASSCRED: ::c_int = 20;
pub const SO_PEERCRED: ::c_int = 21;
// end
pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22;
pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23;
pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24;
pub const SO_BINDTODEVICE: ::c_int = 25;
pub const SO_ATTACH_FILTER: ::c_int = 26;
pub const SO_DETACH_FILTER: ::c_int = 27;
pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
pub const SO_PEERNAME: ::c_int = 28;
pub const SO_TIMESTAMP: ::c_int = 29;
// pub const SO_TIMESTAMP_OLD: ::c_int = 29;
pub const SO_ACCEPTCONN: ::c_int = 30;
pub const SO_PEERSEC: ::c_int = 31;
pub const SO_SNDBUFFORCE: ::c_int = 32;
pub const SO_RCVBUFFORCE: ::c_int = 33;
pub const SO_PASSSEC: ::c_int = 34;
pub const SO_TIMESTAMPNS: ::c_int = 35;
// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
pub const SO_MARK: ::c_int = 36;
pub const SO_TIMESTAMPING: ::c_int = 37;
// pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
pub const SO_PROTOCOL: ::c_int = 38;
pub const SO_DOMAIN: ::c_int = 39;
pub const SO_RXQ_OVFL: ::c_int = 40;
pub const SO_WIFI_STATUS: ::c_int = 41;
pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
pub const SO_PEEK_OFF: ::c_int = 42;
pub const SO_NOFCS: ::c_int = 43;
pub const SO_LOCK_FILTER: ::c_int = 44;
pub const SO_SELECT_ERR_QUEUE: ::c_int = 45;
pub const SO_BUSY_POLL: ::c_int = 46;
pub const SO_MAX_PACING_RATE: ::c_int = 47;
pub const SO_BPF_EXTENSIONS: ::c_int = 48;
pub const SO_INCOMING_CPU: ::c_int = 49;
pub const SO_ATTACH_BPF: ::c_int = 50;
pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51;
pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52;
pub const SO_CNX_ADVICE: ::c_int = 53;
pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
pub const SO_MEMINFO: ::c_int = 55;
pub const SO_INCOMING_NAPI_ID: ::c_int = 56;
pub const SO_COOKIE: ::c_int = 57;
pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
pub const SO_PEERGROUPS: ::c_int = 59;
pub const SO_ZEROCOPY: ::c_int = 60;
pub const SO_TXTIME: ::c_int = 61;
pub const SCM_TXTIME: ::c_int = SO_TXTIME;
pub const SO_BINDTOIFINDEX: ::c_int = 62;
// pub const SO_TIMESTAMP_NEW: ::c_int = 63;
// pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
// pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
// pub const SO_RCVTIMEO_NEW: ::c_int = 66;
// pub const SO_SNDTIMEO_NEW: ::c_int = 67;
// pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
pub const FICLONE: ::c_ulong = 0x80049409;
pub const FICLONERANGE: ::c_ulong = 0x8020940D;
// Defined in unix/linux_like/mod.rs
// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
// Ioctl Constants
cfg_if! {
if #[cfg(target_env = "gnu")] {
pub const TCGETS: ::Ioctl = 0x403c7413;
pub const TCSETS: ::Ioctl = 0x803c7414;
pub const TCSETSW: ::Ioctl = 0x803c7415;
pub const TCSETSF: ::Ioctl = 0x803c7416;
} else if #[cfg(target_env = "musl")] {
pub const TCGETS: ::Ioctl = 0x402c7413;
pub const TCSETS: ::Ioctl = 0x802c7414;
pub const TCSETSW: ::Ioctl = 0x802c7415;
pub const TCSETSF: ::Ioctl = 0x802c7416;
}
}
pub const TCGETA: ::Ioctl = 0x40147417;
pub const TCSETA: ::Ioctl = 0x80147418;
pub const TCSETAW: ::Ioctl = 0x80147419;
pub const TCSETAF: ::Ioctl = 0x8014741C;
pub const TCSBRK: ::Ioctl = 0x2000741D;
pub const TCXONC: ::Ioctl = 0x2000741E;
pub const TCFLSH: ::Ioctl = 0x2000741F;
pub const TIOCEXCL: ::Ioctl = 0x540C;
pub const TIOCNXCL: ::Ioctl = 0x540D;
pub const TIOCSCTTY: ::Ioctl = 0x540E;
pub const TIOCGPGRP: ::Ioctl = 0x40047477;
pub const TIOCSPGRP: ::Ioctl = 0x80047476;
pub const TIOCOUTQ: ::Ioctl = 0x40047473;
pub const TIOCSTI: ::Ioctl = 0x5412;
pub const TIOCGWINSZ: ::Ioctl = 0x40087468;
pub const TIOCSWINSZ: ::Ioctl = 0x80087467;
pub const TIOCMGET: ::Ioctl = 0x5415;
pub const TIOCMBIS: ::Ioctl = 0x5416;
pub const TIOCMBIC: ::Ioctl = 0x5417;
pub const TIOCMSET: ::Ioctl = 0x5418;
pub const TIOCGSOFTCAR: ::Ioctl = 0x5419;
pub const TIOCSSOFTCAR: ::Ioctl = 0x541A;
pub const FIONREAD: ::Ioctl = 0x4004667F;
pub const TIOCINQ: ::Ioctl = FIONREAD;
pub const TIOCLINUX: ::Ioctl = 0x541C;
pub const TIOCCONS: ::Ioctl = 0x541D;
pub const TIOCGSERIAL: ::Ioctl = 0x541E;
pub const TIOCSSERIAL: ::Ioctl = 0x541F;
pub const TIOCPKT: ::Ioctl = 0x5420;
pub const FIONBIO: ::Ioctl = 0x8004667e;
pub const TIOCNOTTY: ::Ioctl = 0x5422;
pub const TIOCSETD: ::Ioctl = 0x5423;
pub const TIOCGETD: ::Ioctl = 0x5424;
pub const TCSBRKP: ::Ioctl = 0x5425;
pub const TIOCSBRK: ::Ioctl = 0x5427;
pub const TIOCCBRK: ::Ioctl = 0x5428;
pub const TIOCGSID: ::Ioctl = 0x5429;
pub const TIOCGRS485: ::Ioctl = 0x542e;
pub const TIOCSRS485: ::Ioctl = 0x542f;
pub const TIOCGPTN: ::Ioctl = 0x40045430;
pub const TIOCSPTLCK: ::Ioctl = 0x80045431;
pub const TIOCGDEV: ::Ioctl = 0x40045432;
pub const TIOCSIG: ::Ioctl = 0x80045436;
pub const TIOCVHANGUP: ::Ioctl = 0x5437;
pub const TIOCGPKT: ::Ioctl = 0x40045438;
pub const TIOCGPTLCK: ::Ioctl = 0x40045439;
pub const TIOCGEXCL: ::Ioctl = 0x40045440;
pub const TIOCGPTPEER: ::Ioctl = 0x20005441;
//pub const TIOCGISO7816: ::Ioctl = 0x40285442;
//pub const TIOCSISO7816: ::Ioctl = 0xc0285443;
pub const FIONCLEX: ::Ioctl = 0x20006602;
pub const FIOCLEX: ::Ioctl = 0x20006601;
pub const FIOASYNC: ::Ioctl = 0x8004667d;
pub const TIOCSERCONFIG: ::Ioctl = 0x5453;
pub const TIOCSERGWILD: ::Ioctl = 0x5454;
pub const TIOCSERSWILD: ::Ioctl = 0x5455;
pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456;
pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457;
pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458;
pub const TIOCSERGETLSR: ::Ioctl = 0x5459;
pub const TIOCSERGETMULTI: ::Ioctl = 0x545A;
pub const TIOCSERSETMULTI: ::Ioctl = 0x545B;
pub const TIOCMIWAIT: ::Ioctl = 0x545C;
pub const TIOCGICOUNT: ::Ioctl = 0x545D;
pub const BLKIOMIN: ::Ioctl = 0x20001278;
pub const BLKIOOPT: ::Ioctl = 0x20001279;
pub const BLKSSZGET: ::Ioctl = 0x20001268;
pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
//pub const FIOQSIZE: ::Ioctl = 0x40086680;
cfg_if! {
// Those type are constructed using the _IOC macro
// DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
// where D stands for direction (either None (00), Read (01) or Write (11))
// where S stands for size (int, long, struct...)
// where T stands for type ('f','v','X'...)
// where N stands for NR (NumbeR)
if #[cfg(target_arch = "powerpc")] {
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601;
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602;
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601;
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602;
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
} else if #[cfg(target_arch = "powerpc64")] {
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602;
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601;
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602;
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
}
}
pub const TIOCM_LE: ::c_int = 0x001;
pub const TIOCM_DTR: ::c_int = 0x002;
pub const TIOCM_RTS: ::c_int = 0x004;
pub const TIOCM_ST: ::c_int = 0x008;
pub const TIOCM_SR: ::c_int = 0x010;
pub const TIOCM_CTS: ::c_int = 0x020;
pub const TIOCM_CAR: ::c_int = 0x040;
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
pub const TIOCM_RNG: ::c_int = 0x080;
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
pub const TIOCM_DSR: ::c_int = 0x100;
pub const BOTHER: ::speed_t = 0o0037;
pub const IBSHIFT: ::tcflag_t = 16;
// RLIMIT Constants
cfg_if! {
if #[cfg(target_env = "gnu")] {
pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
} else if #[cfg(target_env = "musl")] {
pub const RLIMIT_CPU: ::c_int = 0;
pub const RLIMIT_FSIZE: ::c_int = 1;
pub const RLIMIT_DATA: ::c_int = 2;
pub const RLIMIT_STACK: ::c_int = 3;
pub const RLIMIT_CORE: ::c_int = 4;
pub const RLIMIT_RSS: ::c_int = 5;
pub const RLIMIT_NPROC: ::c_int = 6;
pub const RLIMIT_NOFILE: ::c_int = 7;
pub const RLIMIT_MEMLOCK: ::c_int = 8;
pub const RLIMIT_AS: ::c_int = 9;
pub const RLIMIT_LOCKS: ::c_int = 10;
pub const RLIMIT_SIGPENDING: ::c_int = 11;
pub const RLIMIT_MSGQUEUE: ::c_int = 12;
pub const RLIMIT_NICE: ::c_int = 13;
pub const RLIMIT_RTPRIO: ::c_int = 14;
pub const RLIMIT_RTTIME: ::c_int = 15;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::c_int = 15;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS;
}
}
pub const RLIM_INFINITY: ::rlim_t = !0;

View file

@ -0,0 +1,259 @@
s! {
pub struct termios2 {
pub c_iflag: ::tcflag_t,
pub c_oflag: ::tcflag_t,
pub c_cflag: ::tcflag_t,
pub c_lflag: ::tcflag_t,
pub c_line: ::cc_t,
pub c_cc: [::cc_t; 19],
pub c_ispeed: ::speed_t,
pub c_ospeed: ::speed_t,
}
}
// arch/sparc/include/uapi/asm/socket.h
pub const SOL_SOCKET: ::c_int = 0xffff;
// Defined in unix/linux_like/mod.rs
// pub const SO_DEBUG: ::c_int = 0x0001;
pub const SO_PASSCRED: ::c_int = 0x0002;
pub const SO_REUSEADDR: ::c_int = 0x0004;
pub const SO_KEEPALIVE: ::c_int = 0x0008;
pub const SO_DONTROUTE: ::c_int = 0x0010;
pub const SO_BROADCAST: ::c_int = 0x0020;
pub const SO_PEERCRED: ::c_int = 0x0040;
pub const SO_LINGER: ::c_int = 0x0080;
pub const SO_OOBINLINE: ::c_int = 0x0100;
pub const SO_REUSEPORT: ::c_int = 0x0200;
pub const SO_BSDCOMPAT: ::c_int = 0x0400;
pub const SO_RCVLOWAT: ::c_int = 0x0800;
pub const SO_SNDLOWAT: ::c_int = 0x1000;
pub const SO_RCVTIMEO: ::c_int = 0x2000;
pub const SO_SNDTIMEO: ::c_int = 0x4000;
// pub const SO_RCVTIMEO_OLD: ::c_int = 0x2000;
// pub const SO_SNDTIMEO_OLD: ::c_int = 0x4000;
pub const SO_ACCEPTCONN: ::c_int = 0x8000;
pub const SO_SNDBUF: ::c_int = 0x1001;
pub const SO_RCVBUF: ::c_int = 0x1002;
pub const SO_SNDBUFFORCE: ::c_int = 0x100a;
pub const SO_RCVBUFFORCE: ::c_int = 0x100b;
pub const SO_ERROR: ::c_int = 0x1007;
pub const SO_TYPE: ::c_int = 0x1008;
pub const SO_PROTOCOL: ::c_int = 0x1028;
pub const SO_DOMAIN: ::c_int = 0x1029;
pub const SO_NO_CHECK: ::c_int = 0x000b;
pub const SO_PRIORITY: ::c_int = 0x000c;
pub const SO_BINDTODEVICE: ::c_int = 0x000d;
pub const SO_ATTACH_FILTER: ::c_int = 0x001a;
pub const SO_DETACH_FILTER: ::c_int = 0x001b;
pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER;
pub const SO_PEERNAME: ::c_int = 0x001c;
pub const SO_PEERSEC: ::c_int = 0x001e;
pub const SO_PASSSEC: ::c_int = 0x001f;
pub const SO_MARK: ::c_int = 0x0022;
pub const SO_RXQ_OVFL: ::c_int = 0x0024;
pub const SO_WIFI_STATUS: ::c_int = 0x0025;
pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS;
pub const SO_PEEK_OFF: ::c_int = 0x0026;
pub const SO_NOFCS: ::c_int = 0x0027;
pub const SO_LOCK_FILTER: ::c_int = 0x0028;
pub const SO_SELECT_ERR_QUEUE: ::c_int = 0x0029;
pub const SO_BUSY_POLL: ::c_int = 0x0030;
pub const SO_MAX_PACING_RATE: ::c_int = 0x0031;
pub const SO_BPF_EXTENSIONS: ::c_int = 0x0032;
pub const SO_INCOMING_CPU: ::c_int = 0x0033;
pub const SO_ATTACH_BPF: ::c_int = 0x0034;
pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER;
pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 0x0035;
pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 0x0036;
pub const SO_CNX_ADVICE: ::c_int = 0x0037;
pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 0x0038;
pub const SO_MEMINFO: ::c_int = 0x0039;
pub const SO_INCOMING_NAPI_ID: ::c_int = 0x003a;
pub const SO_COOKIE: ::c_int = 0x003b;
pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 0x003c;
pub const SO_PEERGROUPS: ::c_int = 0x003d;
pub const SO_ZEROCOPY: ::c_int = 0x003e;
pub const SO_TXTIME: ::c_int = 0x003f;
pub const SCM_TXTIME: ::c_int = SO_TXTIME;
pub const SO_BINDTOIFINDEX: ::c_int = 0x0041;
pub const SO_SECURITY_AUTHENTICATION: ::c_int = 0x5001;
pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 0x5002;
pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 0x5004;
pub const SO_TIMESTAMP: ::c_int = 0x001d;
pub const SO_TIMESTAMPNS: ::c_int = 0x0021;
pub const SO_TIMESTAMPING: ::c_int = 0x0023;
// pub const SO_TIMESTAMP_OLD: ::c_int = 0x001d;
// pub const SO_TIMESTAMPNS_OLD: ::c_int = 0x0021;
// pub const SO_TIMESTAMPING_OLD: ::c_int = 0x0023;
// pub const SO_TIMESTAMP_NEW: ::c_int = 0x0046;
// pub const SO_TIMESTAMPNS_NEW: ::c_int = 0x0042;
// pub const SO_TIMESTAMPING_NEW: ::c_int = 0x0043;
// pub const SO_RCVTIMEO_NEW: ::c_int = 0x0044;
// pub const SO_SNDTIMEO_NEW: ::c_int = 0x0045;
// pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 0x0047;
// pub const SO_PREFER_BUSY_POLL: ::c_int = 0x0048;
// pub const SO_BUSY_POLL_BUDGET: ::c_int = 0x0049;
// Defined in unix/linux_like/mod.rs
// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
// Ioctl Constants
pub const TCGETS: ::Ioctl = 0x40245408;
pub const TCSETS: ::Ioctl = 0x80245409;
pub const TCSETSW: ::Ioctl = 0x8024540a;
pub const TCSETSF: ::Ioctl = 0x8024540b;
pub const TCGETA: ::Ioctl = 0x40125401;
pub const TCSETA: ::Ioctl = 0x80125402;
pub const TCSETAW: ::Ioctl = 0x80125403;
pub const TCSETAF: ::Ioctl = 0x80125404;
pub const TCSBRK: ::Ioctl = 0x20005405;
pub const TCXONC: ::Ioctl = 0x20005406;
pub const TCFLSH: ::Ioctl = 0x20005407;
pub const TIOCEXCL: ::Ioctl = 0x2000740d;
pub const TIOCNXCL: ::Ioctl = 0x2000740e;
pub const TIOCSCTTY: ::Ioctl = 0x20007484;
pub const TIOCGPGRP: ::Ioctl = 0x40047483;
pub const TIOCSPGRP: ::Ioctl = 0x80047482;
pub const TIOCOUTQ: ::Ioctl = 0x40047473;
pub const TIOCSTI: ::Ioctl = 0x80017472;
pub const TIOCGWINSZ: ::Ioctl = 0x40087468;
pub const TIOCSWINSZ: ::Ioctl = 0x80087467;
pub const TIOCMGET: ::Ioctl = 0x4004746a;
pub const TIOCMBIS: ::Ioctl = 0x8004746c;
pub const TIOCMBIC: ::Ioctl = 0x8004746b;
pub const TIOCMSET: ::Ioctl = 0x8004746d;
pub const TIOCGSOFTCAR: ::Ioctl = 0x40047464;
pub const TIOCSSOFTCAR: ::Ioctl = 0x80047465;
pub const FIONREAD: ::Ioctl = 0x4004667f;
pub const TIOCINQ: ::Ioctl = FIONREAD;
pub const TIOCLINUX: ::Ioctl = 0x541C;
pub const TIOCCONS: ::Ioctl = 0x20007424;
pub const TIOCGSERIAL: ::Ioctl = 0x541E;
pub const TIOCSSERIAL: ::Ioctl = 0x541F;
pub const TIOCPKT: ::Ioctl = 0x80047470;
pub const FIONBIO: ::Ioctl = 0x8004667e;
pub const TIOCNOTTY: ::Ioctl = 0x20007471;
pub const TIOCSETD: ::Ioctl = 0x80047401;
pub const TIOCGETD: ::Ioctl = 0x40047400;
pub const TCSBRKP: ::Ioctl = 0x5425;
pub const TIOCSBRK: ::Ioctl = 0x2000747b;
pub const TIOCCBRK: ::Ioctl = 0x2000747a;
pub const TIOCGSID: ::Ioctl = 0x40047485;
pub const TCGETS2: ::Ioctl = 0x402c540c;
pub const TCSETS2: ::Ioctl = 0x802c540d;
pub const TCSETSW2: ::Ioctl = 0x802c540e;
pub const TCSETSF2: ::Ioctl = 0x802c540f;
pub const TIOCGPTN: ::Ioctl = 0x40047486;
pub const TIOCSPTLCK: ::Ioctl = 0x80047487;
pub const TIOCGDEV: ::Ioctl = 0x40045432;
pub const TIOCSIG: ::Ioctl = 0x80047488;
pub const TIOCVHANGUP: ::Ioctl = 0x20005437;
pub const TIOCGPKT: ::Ioctl = 0x40045438;
pub const TIOCGPTLCK: ::Ioctl = 0x40045439;
pub const TIOCGEXCL: ::Ioctl = 0x40045440;
pub const TIOCGPTPEER: ::Ioctl = 0x20007489;
pub const FIONCLEX: ::Ioctl = 0x20006602;
pub const FIOCLEX: ::Ioctl = 0x20006601;
pub const TIOCSERCONFIG: ::Ioctl = 0x5453;
pub const TIOCSERGWILD: ::Ioctl = 0x5454;
pub const TIOCSERSWILD: ::Ioctl = 0x5455;
pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456;
pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457;
pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458;
pub const TIOCSERGETLSR: ::Ioctl = 0x5459;
pub const TIOCSERGETMULTI: ::Ioctl = 0x545A;
pub const TIOCSERSETMULTI: ::Ioctl = 0x545B;
pub const TIOCMIWAIT: ::Ioctl = 0x545C;
pub const TIOCGICOUNT: ::Ioctl = 0x545D;
pub const TIOCSTART: ::Ioctl = 0x2000746e;
pub const TIOCSTOP: ::Ioctl = 0x2000746f;
pub const BLKIOMIN: ::Ioctl = 0x20001278;
pub const BLKIOOPT: ::Ioctl = 0x20001279;
pub const BLKSSZGET: ::Ioctl = 0x20001268;
pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
//pub const FIOASYNC: ::Ioctl = 0x4004667d;
//pub const FIOQSIZE: ::Ioctl = ;
//pub const TIOCGISO7816: ::Ioctl = 0x40285443;
//pub const TIOCSISO7816: ::Ioctl = 0xc0285444;
//pub const TIOCGRS485: ::Ioctl = 0x40205441;
//pub const TIOCSRS485: ::Ioctl = 0xc0205442;
pub const TIOCM_LE: ::c_int = 0x001;
pub const TIOCM_DTR: ::c_int = 0x002;
pub const TIOCM_RTS: ::c_int = 0x004;
pub const TIOCM_ST: ::c_int = 0x008;
pub const TIOCM_SR: ::c_int = 0x010;
pub const TIOCM_CTS: ::c_int = 0x020;
pub const TIOCM_CAR: ::c_int = 0x040;
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
pub const TIOCM_RNG: ::c_int = 0x080;
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
pub const TIOCM_DSR: ::c_int = 0x100;
pub const BOTHER: ::speed_t = 0x1000;
pub const IBSHIFT: ::tcflag_t = 16;
// RLIMIT Constants
pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 6;
pub const RLIMIT_NPROC: ::__rlimit_resource_t = 7;
pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;
cfg_if! {
if #[cfg(target_arch = "sparc64")] {
pub const RLIM_INFINITY: ::rlim_t = !0;
} else if #[cfg(target_arch = "sparc")] {
pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
}
}
cfg_if! {
// Those type are constructed using the _IOC macro
// DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN
// where D stands for direction (either None (00), Read (01) or Write (11))
// where S stands for size (int, long, struct...)
// where T stands for type ('f','v','X'...)
// where N stands for NR (NumbeR)
if #[cfg(target_arch = "sparc")] {
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40046601;
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80046602;
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40047601;
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80047602;
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
} else if #[cfg(target_arch = "sparc64")] {
pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;
pub const FS_IOC_SETFLAGS: ::Ioctl = 0x80086602;
pub const FS_IOC_GETVERSION: ::Ioctl = 0x40087601;
pub const FS_IOC_SETVERSION: ::Ioctl = 0x80087602;
pub const FS_IOC32_GETFLAGS: ::Ioctl = 0x40046601;
pub const FS_IOC32_SETFLAGS: ::Ioctl = 0x80046602;
pub const FS_IOC32_GETVERSION: ::Ioctl = 0x40047601;
pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
}
}

View file

@ -0,0 +1,13 @@
s! {
// FIXME this is actually a union
#[cfg_attr(target_pointer_width = "32",
repr(align(4)))]
#[cfg_attr(target_pointer_width = "64",
repr(align(8)))]
pub struct sem_t {
#[cfg(target_pointer_width = "32")]
__size: [::c_char; 16],
#[cfg(target_pointer_width = "64")]
__size: [::c_char; 32],
}
}

View file

@ -0,0 +1,53 @@
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(8))]
pub struct max_align_t {
priv_: [i64; 2]
}
#[allow(missing_debug_implementations)]
#[repr(align(8))]
pub struct ucontext_t {
pub uc_flags: ::c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: ::mcontext_t,
pub uc_sigmask: ::sigset_t,
pub uc_regspace: [::c_ulong; 128],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for ucontext_t {
fn eq(&self, other: &ucontext_t) -> bool {
self.uc_flags == other.uc_flags
&& self.uc_link == other.uc_link
&& self.uc_stack == other.uc_stack
&& self.uc_mcontext == other.uc_mcontext
&& self.uc_sigmask == other.uc_sigmask
}
}
impl Eq for ucontext_t {}
impl ::fmt::Debug for ucontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ucontext_t")
.field("uc_flags", &self.uc_link)
.field("uc_link", &self.uc_link)
.field("uc_stack", &self.uc_stack)
.field("uc_mcontext", &self.uc_mcontext)
.field("uc_sigmask", &self.uc_sigmask)
.finish()
}
}
impl ::hash::Hash for ucontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.uc_flags.hash(state);
self.uc_link.hash(state);
self.uc_stack.hash(state);
self.uc_mcontext.hash(state);
self.uc_sigmask.hash(state);
}
}
}
}

View file

@ -0,0 +1,865 @@
pub type c_char = u8;
pub type wchar_t = u32;
s! {
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
}
pub struct statfs {
pub f_type: ::__fsword_t,
pub f_bsize: ::__fsword_t,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::__fsword_t,
pub f_frsize: ::__fsword_t,
f_spare: [::__fsword_t; 5],
}
pub struct flock {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off_t,
pub l_len: ::off_t,
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}
pub struct ipc_perm {
pub __key: ::key_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::c_ushort,
__pad1: ::c_ushort,
pub __seq: ::c_ushort,
__pad2: ::c_ushort,
__unused1: ::c_ulong,
__unused2: ::c_ulong
}
pub struct stat64 {
pub st_dev: ::dev_t,
__pad1: ::c_uint,
__st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
__pad2: ::c_uint,
pub st_size: ::off64_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt64_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_ino: ::ino64_t,
}
pub struct statfs64 {
pub f_type: ::__fsword_t,
pub f_bsize: ::__fsword_t,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_fsid: ::fsid_t,
pub f_namelen: ::__fsword_t,
pub f_frsize: ::__fsword_t,
pub f_flags: ::__fsword_t,
pub f_spare: [::__fsword_t; 4],
}
pub struct statvfs64 {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_favail: u64,
pub f_fsid: ::c_ulong,
__f_unused: ::c_int,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_atime: ::time_t,
__unused1: ::c_ulong,
pub shm_dtime: ::time_t,
__unused2: ::c_ulong,
pub shm_ctime: ::time_t,
__unused3: ::c_ulong,
pub shm_cpid: ::pid_t,
pub shm_lpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
__unused4: ::c_ulong,
__unused5: ::c_ulong
}
pub struct msqid_ds {
pub msg_perm: ::ipc_perm,
pub msg_stime: ::time_t,
__glibc_reserved1: ::c_ulong,
pub msg_rtime: ::time_t,
__glibc_reserved2: ::c_ulong,
pub msg_ctime: ::time_t,
__glibc_reserved3: ::c_ulong,
__msg_cbytes: ::c_ulong,
pub msg_qnum: ::msgqnum_t,
pub msg_qbytes: ::msglen_t,
pub msg_lspid: ::pid_t,
pub msg_lrpid: ::pid_t,
__glibc_reserved4: ::c_ulong,
__glibc_reserved5: ::c_ulong,
}
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
pub si_code: ::c_int,
#[doc(hidden)]
#[deprecated(
since="0.2.54",
note="Please leave a comment on \
https://github.com/rust-lang/libc/pull/1316 if you're using \
this field"
)]
pub _pad: [::c_int; 29],
_align: [usize; 0],
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_flags: ::c_int,
pub ss_size: ::size_t
}
pub struct mcontext_t {
pub trap_no: ::c_ulong,
pub error_code: ::c_ulong,
pub oldmask: ::c_ulong,
pub arm_r0: ::c_ulong,
pub arm_r1: ::c_ulong,
pub arm_r2: ::c_ulong,
pub arm_r3: ::c_ulong,
pub arm_r4: ::c_ulong,
pub arm_r5: ::c_ulong,
pub arm_r6: ::c_ulong,
pub arm_r7: ::c_ulong,
pub arm_r8: ::c_ulong,
pub arm_r9: ::c_ulong,
pub arm_r10: ::c_ulong,
pub arm_fp: ::c_ulong,
pub arm_ip: ::c_ulong,
pub arm_sp: ::c_ulong,
pub arm_lr: ::c_ulong,
pub arm_pc: ::c_ulong,
pub arm_cpsr: ::c_ulong,
pub fault_address: ::c_ulong,
}
pub struct user_regs {
pub arm_r0: ::c_ulong,
pub arm_r1: ::c_ulong,
pub arm_r2: ::c_ulong,
pub arm_r3: ::c_ulong,
pub arm_r4: ::c_ulong,
pub arm_r5: ::c_ulong,
pub arm_r6: ::c_ulong,
pub arm_r7: ::c_ulong,
pub arm_r8: ::c_ulong,
pub arm_r9: ::c_ulong,
pub arm_r10: ::c_ulong,
pub arm_fp: ::c_ulong,
pub arm_ip: ::c_ulong,
pub arm_sp: ::c_ulong,
pub arm_lr: ::c_ulong,
pub arm_pc: ::c_ulong,
pub arm_cpsr: ::c_ulong,
pub arm_orig_r0: ::c_ulong,
}
}
pub const VEOF: usize = 4;
pub const RTLD_DEEPBIND: ::c_int = 0x8;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const RTLD_NOLOAD: ::c_int = 0x4;
pub const O_DIRECT: ::c_int = 0x10000;
pub const O_DIRECTORY: ::c_int = 0x4000;
pub const O_NOFOLLOW: ::c_int = 0x8000;
pub const O_LARGEFILE: ::c_int = 0o400000;
pub const O_APPEND: ::c_int = 1024;
pub const O_CREAT: ::c_int = 64;
pub const O_EXCL: ::c_int = 128;
pub const O_NOCTTY: ::c_int = 256;
pub const O_NONBLOCK: ::c_int = 2048;
pub const O_SYNC: ::c_int = 1052672;
pub const O_RSYNC: ::c_int = 1052672;
pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_NDELAY: ::c_int = 0x800;
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MAP_LOCKED: ::c_int = 0x02000;
pub const MAP_NORESERVE: ::c_int = 0x04000;
pub const MAP_ANON: ::c_int = 0x0020;
pub const MAP_ANONYMOUS: ::c_int = 0x0020;
pub const MAP_DENYWRITE: ::c_int = 0x0800;
pub const MAP_EXECUTABLE: ::c_int = 0x01000;
pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const EDEADLOCK: ::c_int = 35;
pub const EUCLEAN: ::c_int = 117;
pub const ENOTNAM: ::c_int = 118;
pub const ENAVAIL: ::c_int = 119;
pub const EISNAM: ::c_int = 120;
pub const EREMOTEIO: ::c_int = 121;
pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
pub const ENOLCK: ::c_int = 37;
pub const ENOSYS: ::c_int = 38;
pub const ENOTEMPTY: ::c_int = 39;
pub const ELOOP: ::c_int = 40;
pub const ENOMSG: ::c_int = 42;
pub const EIDRM: ::c_int = 43;
pub const ECHRNG: ::c_int = 44;
pub const EL2NSYNC: ::c_int = 45;
pub const EL3HLT: ::c_int = 46;
pub const EL3RST: ::c_int = 47;
pub const ELNRNG: ::c_int = 48;
pub const EUNATCH: ::c_int = 49;
pub const ENOCSI: ::c_int = 50;
pub const EL2HLT: ::c_int = 51;
pub const EBADE: ::c_int = 52;
pub const EBADR: ::c_int = 53;
pub const EXFULL: ::c_int = 54;
pub const ENOANO: ::c_int = 55;
pub const EBADRQC: ::c_int = 56;
pub const EBADSLT: ::c_int = 57;
pub const EMULTIHOP: ::c_int = 72;
pub const EOVERFLOW: ::c_int = 75;
pub const ENOTUNIQ: ::c_int = 76;
pub const EBADFD: ::c_int = 77;
pub const EBADMSG: ::c_int = 74;
pub const EREMCHG: ::c_int = 78;
pub const ELIBACC: ::c_int = 79;
pub const ELIBBAD: ::c_int = 80;
pub const ELIBSCN: ::c_int = 81;
pub const ELIBMAX: ::c_int = 82;
pub const ELIBEXEC: ::c_int = 83;
pub const EILSEQ: ::c_int = 84;
pub const ERESTART: ::c_int = 85;
pub const ESTRPIPE: ::c_int = 86;
pub const EUSERS: ::c_int = 87;
pub const ENOTSOCK: ::c_int = 88;
pub const EDESTADDRREQ: ::c_int = 89;
pub const EMSGSIZE: ::c_int = 90;
pub const EPROTOTYPE: ::c_int = 91;
pub const ENOPROTOOPT: ::c_int = 92;
pub const EPROTONOSUPPORT: ::c_int = 93;
pub const ESOCKTNOSUPPORT: ::c_int = 94;
pub const EOPNOTSUPP: ::c_int = 95;
pub const EPFNOSUPPORT: ::c_int = 96;
pub const EAFNOSUPPORT: ::c_int = 97;
pub const EADDRINUSE: ::c_int = 98;
pub const EADDRNOTAVAIL: ::c_int = 99;
pub const ENETDOWN: ::c_int = 100;
pub const ENETUNREACH: ::c_int = 101;
pub const ENETRESET: ::c_int = 102;
pub const ECONNABORTED: ::c_int = 103;
pub const ECONNRESET: ::c_int = 104;
pub const ENOBUFS: ::c_int = 105;
pub const EISCONN: ::c_int = 106;
pub const ENOTCONN: ::c_int = 107;
pub const ESHUTDOWN: ::c_int = 108;
pub const ETOOMANYREFS: ::c_int = 109;
pub const ETIMEDOUT: ::c_int = 110;
pub const ECONNREFUSED: ::c_int = 111;
pub const EHOSTDOWN: ::c_int = 112;
pub const EHOSTUNREACH: ::c_int = 113;
pub const EALREADY: ::c_int = 114;
pub const EINPROGRESS: ::c_int = 115;
pub const ESTALE: ::c_int = 116;
pub const EDQUOT: ::c_int = 122;
pub const ENOMEDIUM: ::c_int = 123;
pub const EMEDIUMTYPE: ::c_int = 124;
pub const ECANCELED: ::c_int = 125;
pub const ENOKEY: ::c_int = 126;
pub const EKEYEXPIRED: ::c_int = 127;
pub const EKEYREVOKED: ::c_int = 128;
pub const EKEYREJECTED: ::c_int = 129;
pub const EOWNERDEAD: ::c_int = 130;
pub const ENOTRECOVERABLE: ::c_int = 131;
pub const EHWPOISON: ::c_int = 133;
pub const ERFKILL: ::c_int = 132;
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
pub const F_GETLK: ::c_int = 5;
pub const F_GETOWN: ::c_int = 9;
pub const F_SETOWN: ::c_int = 8;
pub const EFD_NONBLOCK: ::c_int = 0x800;
pub const SFD_NONBLOCK: ::c_int = 0x0800;
pub const SIGCHLD: ::c_int = 17;
pub const SIGBUS: ::c_int = 7;
pub const SIGUSR1: ::c_int = 10;
pub const SIGUSR2: ::c_int = 12;
pub const SIGCONT: ::c_int = 18;
pub const SIGSTOP: ::c_int = 19;
pub const SIGTSTP: ::c_int = 20;
pub const SIGURG: ::c_int = 23;
pub const SIGIO: ::c_int = 29;
pub const SIGSYS: ::c_int = 31;
pub const SIGSTKFLT: ::c_int = 16;
#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
pub const SIGUNUSED: ::c_int = 31;
pub const SIGPOLL: ::c_int = 29;
pub const SIGPWR: ::c_int = 30;
pub const SIG_SETMASK: ::c_int = 2;
pub const SIG_BLOCK: ::c_int = 0x000000;
pub const SIG_UNBLOCK: ::c_int = 0x01;
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;
pub const SIGXCPU: ::c_int = 24;
pub const SIGXFSZ: ::c_int = 25;
pub const SIGVTALRM: ::c_int = 26;
pub const SIGPROF: ::c_int = 27;
pub const SIGWINCH: ::c_int = 28;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::tcflag_t = 0x00000800;
pub const TAB2: ::tcflag_t = 0x00001000;
pub const TAB3: ::tcflag_t = 0x00001800;
pub const CR1: ::tcflag_t = 0x00000200;
pub const CR2: ::tcflag_t = 0x00000400;
pub const CR3: ::tcflag_t = 0x00000600;
pub const FF1: ::tcflag_t = 0x00008000;
pub const BS1: ::tcflag_t = 0x00002000;
pub const VT1: ::tcflag_t = 0x00004000;
pub const VWERASE: usize = 14;
pub const VREPRINT: usize = 12;
pub const VSUSP: usize = 10;
pub const VSTART: usize = 8;
pub const VSTOP: usize = 9;
pub const VDISCARD: usize = 13;
pub const VTIME: usize = 5;
pub const IXON: ::tcflag_t = 0x00000400;
pub const IXOFF: ::tcflag_t = 0x00001000;
pub const ONLCR: ::tcflag_t = 0x4;
pub const CSIZE: ::tcflag_t = 0x00000030;
pub const CS6: ::tcflag_t = 0x00000010;
pub const CS7: ::tcflag_t = 0x00000020;
pub const CS8: ::tcflag_t = 0x00000030;
pub const CSTOPB: ::tcflag_t = 0x00000040;
pub const CREAD: ::tcflag_t = 0x00000080;
pub const PARENB: ::tcflag_t = 0x00000100;
pub const PARODD: ::tcflag_t = 0x00000200;
pub const HUPCL: ::tcflag_t = 0x00000400;
pub const CLOCAL: ::tcflag_t = 0x00000800;
pub const ECHOKE: ::tcflag_t = 0x00000800;
pub const ECHOE: ::tcflag_t = 0x00000010;
pub const ECHOK: ::tcflag_t = 0x00000020;
pub const ECHONL: ::tcflag_t = 0x00000040;
pub const ECHOPRT: ::tcflag_t = 0x00000400;
pub const ECHOCTL: ::tcflag_t = 0x00000200;
pub const ISIG: ::tcflag_t = 0x00000001;
pub const ICANON: ::tcflag_t = 0x00000002;
pub const PENDIN: ::tcflag_t = 0x00004000;
pub const NOFLSH: ::tcflag_t = 0x00000080;
pub const CIBAUD: ::tcflag_t = 0o02003600000;
pub const CBAUDEX: ::tcflag_t = 0o010000;
pub const VSWTC: usize = 7;
pub const OLCUC: ::tcflag_t = 0o000002;
pub const NLDLY: ::tcflag_t = 0o000400;
pub const CRDLY: ::tcflag_t = 0o003000;
pub const TABDLY: ::tcflag_t = 0o014000;
pub const BSDLY: ::tcflag_t = 0o020000;
pub const FFDLY: ::tcflag_t = 0o100000;
pub const VTDLY: ::tcflag_t = 0o040000;
pub const XTABS: ::tcflag_t = 0o014000;
pub const B0: ::speed_t = 0o000000;
pub const B50: ::speed_t = 0o000001;
pub const B75: ::speed_t = 0o000002;
pub const B110: ::speed_t = 0o000003;
pub const B134: ::speed_t = 0o000004;
pub const B150: ::speed_t = 0o000005;
pub const B200: ::speed_t = 0o000006;
pub const B300: ::speed_t = 0o000007;
pub const B600: ::speed_t = 0o000010;
pub const B1200: ::speed_t = 0o000011;
pub const B1800: ::speed_t = 0o000012;
pub const B2400: ::speed_t = 0o000013;
pub const B4800: ::speed_t = 0o000014;
pub const B9600: ::speed_t = 0o000015;
pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
pub const B460800: ::speed_t = 0o010004;
pub const B500000: ::speed_t = 0o010005;
pub const B576000: ::speed_t = 0o010006;
pub const B921600: ::speed_t = 0o010007;
pub const B1000000: ::speed_t = 0o010010;
pub const B1152000: ::speed_t = 0o010011;
pub const B1500000: ::speed_t = 0o010012;
pub const B2000000: ::speed_t = 0o010013;
pub const B2500000: ::speed_t = 0o010014;
pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
pub const EXTPROC: ::tcflag_t = 0x00010000;
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
// Syscall table
pub const SYS_restart_syscall: ::c_long = 0;
pub const SYS_exit: ::c_long = 1;
pub const SYS_fork: ::c_long = 2;
pub const SYS_read: ::c_long = 3;
pub const SYS_write: ::c_long = 4;
pub const SYS_open: ::c_long = 5;
pub const SYS_close: ::c_long = 6;
pub const SYS_creat: ::c_long = 8;
pub const SYS_link: ::c_long = 9;
pub const SYS_unlink: ::c_long = 10;
pub const SYS_execve: ::c_long = 11;
pub const SYS_chdir: ::c_long = 12;
pub const SYS_mknod: ::c_long = 14;
pub const SYS_chmod: ::c_long = 15;
pub const SYS_lchown: ::c_long = 16;
pub const SYS_lseek: ::c_long = 19;
pub const SYS_getpid: ::c_long = 20;
pub const SYS_mount: ::c_long = 21;
pub const SYS_setuid: ::c_long = 23;
pub const SYS_getuid: ::c_long = 24;
pub const SYS_ptrace: ::c_long = 26;
pub const SYS_pause: ::c_long = 29;
pub const SYS_access: ::c_long = 33;
pub const SYS_nice: ::c_long = 34;
pub const SYS_sync: ::c_long = 36;
pub const SYS_kill: ::c_long = 37;
pub const SYS_rename: ::c_long = 38;
pub const SYS_mkdir: ::c_long = 39;
pub const SYS_rmdir: ::c_long = 40;
pub const SYS_dup: ::c_long = 41;
pub const SYS_pipe: ::c_long = 42;
pub const SYS_times: ::c_long = 43;
pub const SYS_brk: ::c_long = 45;
pub const SYS_setgid: ::c_long = 46;
pub const SYS_getgid: ::c_long = 47;
pub const SYS_geteuid: ::c_long = 49;
pub const SYS_getegid: ::c_long = 50;
pub const SYS_acct: ::c_long = 51;
pub const SYS_umount2: ::c_long = 52;
pub const SYS_ioctl: ::c_long = 54;
pub const SYS_fcntl: ::c_long = 55;
pub const SYS_setpgid: ::c_long = 57;
pub const SYS_umask: ::c_long = 60;
pub const SYS_chroot: ::c_long = 61;
pub const SYS_ustat: ::c_long = 62;
pub const SYS_dup2: ::c_long = 63;
pub const SYS_getppid: ::c_long = 64;
pub const SYS_getpgrp: ::c_long = 65;
pub const SYS_setsid: ::c_long = 66;
pub const SYS_sigaction: ::c_long = 67;
pub const SYS_setreuid: ::c_long = 70;
pub const SYS_setregid: ::c_long = 71;
pub const SYS_sigsuspend: ::c_long = 72;
pub const SYS_sigpending: ::c_long = 73;
pub const SYS_sethostname: ::c_long = 74;
pub const SYS_setrlimit: ::c_long = 75;
pub const SYS_getrusage: ::c_long = 77;
pub const SYS_gettimeofday: ::c_long = 78;
pub const SYS_settimeofday: ::c_long = 79;
pub const SYS_getgroups: ::c_long = 80;
pub const SYS_setgroups: ::c_long = 81;
pub const SYS_symlink: ::c_long = 83;
pub const SYS_readlink: ::c_long = 85;
pub const SYS_uselib: ::c_long = 86;
pub const SYS_swapon: ::c_long = 87;
pub const SYS_reboot: ::c_long = 88;
pub const SYS_munmap: ::c_long = 91;
pub const SYS_truncate: ::c_long = 92;
pub const SYS_ftruncate: ::c_long = 93;
pub const SYS_fchmod: ::c_long = 94;
pub const SYS_fchown: ::c_long = 95;
pub const SYS_getpriority: ::c_long = 96;
pub const SYS_setpriority: ::c_long = 97;
pub const SYS_statfs: ::c_long = 99;
pub const SYS_fstatfs: ::c_long = 100;
pub const SYS_syslog: ::c_long = 103;
pub const SYS_setitimer: ::c_long = 104;
pub const SYS_getitimer: ::c_long = 105;
pub const SYS_stat: ::c_long = 106;
pub const SYS_lstat: ::c_long = 107;
pub const SYS_fstat: ::c_long = 108;
pub const SYS_vhangup: ::c_long = 111;
pub const SYS_wait4: ::c_long = 114;
pub const SYS_swapoff: ::c_long = 115;
pub const SYS_sysinfo: ::c_long = 116;
pub const SYS_fsync: ::c_long = 118;
pub const SYS_sigreturn: ::c_long = 119;
pub const SYS_clone: ::c_long = 120;
pub const SYS_setdomainname: ::c_long = 121;
pub const SYS_uname: ::c_long = 122;
pub const SYS_adjtimex: ::c_long = 124;
pub const SYS_mprotect: ::c_long = 125;
pub const SYS_sigprocmask: ::c_long = 126;
pub const SYS_init_module: ::c_long = 128;
pub const SYS_delete_module: ::c_long = 129;
pub const SYS_quotactl: ::c_long = 131;
pub const SYS_getpgid: ::c_long = 132;
pub const SYS_fchdir: ::c_long = 133;
pub const SYS_bdflush: ::c_long = 134;
pub const SYS_sysfs: ::c_long = 135;
pub const SYS_personality: ::c_long = 136;
pub const SYS_setfsuid: ::c_long = 138;
pub const SYS_setfsgid: ::c_long = 139;
pub const SYS__llseek: ::c_long = 140;
pub const SYS_getdents: ::c_long = 141;
pub const SYS__newselect: ::c_long = 142;
pub const SYS_flock: ::c_long = 143;
pub const SYS_msync: ::c_long = 144;
pub const SYS_readv: ::c_long = 145;
pub const SYS_writev: ::c_long = 146;
pub const SYS_getsid: ::c_long = 147;
pub const SYS_fdatasync: ::c_long = 148;
pub const SYS__sysctl: ::c_long = 149;
pub const SYS_mlock: ::c_long = 150;
pub const SYS_munlock: ::c_long = 151;
pub const SYS_mlockall: ::c_long = 152;
pub const SYS_munlockall: ::c_long = 153;
pub const SYS_sched_setparam: ::c_long = 154;
pub const SYS_sched_getparam: ::c_long = 155;
pub const SYS_sched_setscheduler: ::c_long = 156;
pub const SYS_sched_getscheduler: ::c_long = 157;
pub const SYS_sched_yield: ::c_long = 158;
pub const SYS_sched_get_priority_max: ::c_long = 159;
pub const SYS_sched_get_priority_min: ::c_long = 160;
pub const SYS_sched_rr_get_interval: ::c_long = 161;
pub const SYS_nanosleep: ::c_long = 162;
pub const SYS_mremap: ::c_long = 163;
pub const SYS_setresuid: ::c_long = 164;
pub const SYS_getresuid: ::c_long = 165;
pub const SYS_poll: ::c_long = 168;
pub const SYS_nfsservctl: ::c_long = 169;
pub const SYS_setresgid: ::c_long = 170;
pub const SYS_getresgid: ::c_long = 171;
pub const SYS_prctl: ::c_long = 172;
pub const SYS_rt_sigreturn: ::c_long = 173;
pub const SYS_rt_sigaction: ::c_long = 174;
pub const SYS_rt_sigprocmask: ::c_long = 175;
pub const SYS_rt_sigpending: ::c_long = 176;
pub const SYS_rt_sigtimedwait: ::c_long = 177;
pub const SYS_rt_sigqueueinfo: ::c_long = 178;
pub const SYS_rt_sigsuspend: ::c_long = 179;
pub const SYS_pread64: ::c_long = 180;
pub const SYS_pwrite64: ::c_long = 181;
pub const SYS_chown: ::c_long = 182;
pub const SYS_getcwd: ::c_long = 183;
pub const SYS_capget: ::c_long = 184;
pub const SYS_capset: ::c_long = 185;
pub const SYS_sigaltstack: ::c_long = 186;
pub const SYS_sendfile: ::c_long = 187;
pub const SYS_vfork: ::c_long = 190;
pub const SYS_ugetrlimit: ::c_long = 191;
pub const SYS_mmap2: ::c_long = 192;
pub const SYS_truncate64: ::c_long = 193;
pub const SYS_ftruncate64: ::c_long = 194;
pub const SYS_stat64: ::c_long = 195;
pub const SYS_lstat64: ::c_long = 196;
pub const SYS_fstat64: ::c_long = 197;
pub const SYS_lchown32: ::c_long = 198;
pub const SYS_getuid32: ::c_long = 199;
pub const SYS_getgid32: ::c_long = 200;
pub const SYS_geteuid32: ::c_long = 201;
pub const SYS_getegid32: ::c_long = 202;
pub const SYS_setreuid32: ::c_long = 203;
pub const SYS_setregid32: ::c_long = 204;
pub const SYS_getgroups32: ::c_long = 205;
pub const SYS_setgroups32: ::c_long = 206;
pub const SYS_fchown32: ::c_long = 207;
pub const SYS_setresuid32: ::c_long = 208;
pub const SYS_getresuid32: ::c_long = 209;
pub const SYS_setresgid32: ::c_long = 210;
pub const SYS_getresgid32: ::c_long = 211;
pub const SYS_chown32: ::c_long = 212;
pub const SYS_setuid32: ::c_long = 213;
pub const SYS_setgid32: ::c_long = 214;
pub const SYS_setfsuid32: ::c_long = 215;
pub const SYS_setfsgid32: ::c_long = 216;
pub const SYS_getdents64: ::c_long = 217;
pub const SYS_pivot_root: ::c_long = 218;
pub const SYS_mincore: ::c_long = 219;
pub const SYS_madvise: ::c_long = 220;
pub const SYS_fcntl64: ::c_long = 221;
pub const SYS_gettid: ::c_long = 224;
pub const SYS_readahead: ::c_long = 225;
pub const SYS_setxattr: ::c_long = 226;
pub const SYS_lsetxattr: ::c_long = 227;
pub const SYS_fsetxattr: ::c_long = 228;
pub const SYS_getxattr: ::c_long = 229;
pub const SYS_lgetxattr: ::c_long = 230;
pub const SYS_fgetxattr: ::c_long = 231;
pub const SYS_listxattr: ::c_long = 232;
pub const SYS_llistxattr: ::c_long = 233;
pub const SYS_flistxattr: ::c_long = 234;
pub const SYS_removexattr: ::c_long = 235;
pub const SYS_lremovexattr: ::c_long = 236;
pub const SYS_fremovexattr: ::c_long = 237;
pub const SYS_tkill: ::c_long = 238;
pub const SYS_sendfile64: ::c_long = 239;
pub const SYS_futex: ::c_long = 240;
pub const SYS_sched_setaffinity: ::c_long = 241;
pub const SYS_sched_getaffinity: ::c_long = 242;
pub const SYS_io_setup: ::c_long = 243;
pub const SYS_io_destroy: ::c_long = 244;
pub const SYS_io_getevents: ::c_long = 245;
pub const SYS_io_submit: ::c_long = 246;
pub const SYS_io_cancel: ::c_long = 247;
pub const SYS_exit_group: ::c_long = 248;
pub const SYS_lookup_dcookie: ::c_long = 249;
pub const SYS_epoll_create: ::c_long = 250;
pub const SYS_epoll_ctl: ::c_long = 251;
pub const SYS_epoll_wait: ::c_long = 252;
pub const SYS_remap_file_pages: ::c_long = 253;
pub const SYS_set_tid_address: ::c_long = 256;
pub const SYS_timer_create: ::c_long = 257;
pub const SYS_timer_settime: ::c_long = 258;
pub const SYS_timer_gettime: ::c_long = 259;
pub const SYS_timer_getoverrun: ::c_long = 260;
pub const SYS_timer_delete: ::c_long = 261;
pub const SYS_clock_settime: ::c_long = 262;
pub const SYS_clock_gettime: ::c_long = 263;
pub const SYS_clock_getres: ::c_long = 264;
pub const SYS_clock_nanosleep: ::c_long = 265;
pub const SYS_statfs64: ::c_long = 266;
pub const SYS_fstatfs64: ::c_long = 267;
pub const SYS_tgkill: ::c_long = 268;
pub const SYS_utimes: ::c_long = 269;
pub const SYS_arm_fadvise64_64: ::c_long = 270;
pub const SYS_pciconfig_iobase: ::c_long = 271;
pub const SYS_pciconfig_read: ::c_long = 272;
pub const SYS_pciconfig_write: ::c_long = 273;
pub const SYS_mq_open: ::c_long = 274;
pub const SYS_mq_unlink: ::c_long = 275;
pub const SYS_mq_timedsend: ::c_long = 276;
pub const SYS_mq_timedreceive: ::c_long = 277;
pub const SYS_mq_notify: ::c_long = 278;
pub const SYS_mq_getsetattr: ::c_long = 279;
pub const SYS_waitid: ::c_long = 280;
pub const SYS_socket: ::c_long = 281;
pub const SYS_bind: ::c_long = 282;
pub const SYS_connect: ::c_long = 283;
pub const SYS_listen: ::c_long = 284;
pub const SYS_accept: ::c_long = 285;
pub const SYS_getsockname: ::c_long = 286;
pub const SYS_getpeername: ::c_long = 287;
pub const SYS_socketpair: ::c_long = 288;
pub const SYS_send: ::c_long = 289;
pub const SYS_sendto: ::c_long = 290;
pub const SYS_recv: ::c_long = 291;
pub const SYS_recvfrom: ::c_long = 292;
pub const SYS_shutdown: ::c_long = 293;
pub const SYS_setsockopt: ::c_long = 294;
pub const SYS_getsockopt: ::c_long = 295;
pub const SYS_sendmsg: ::c_long = 296;
pub const SYS_recvmsg: ::c_long = 297;
pub const SYS_semop: ::c_long = 298;
pub const SYS_semget: ::c_long = 299;
pub const SYS_semctl: ::c_long = 300;
pub const SYS_msgsnd: ::c_long = 301;
pub const SYS_msgrcv: ::c_long = 302;
pub const SYS_msgget: ::c_long = 303;
pub const SYS_msgctl: ::c_long = 304;
pub const SYS_shmat: ::c_long = 305;
pub const SYS_shmdt: ::c_long = 306;
pub const SYS_shmget: ::c_long = 307;
pub const SYS_shmctl: ::c_long = 308;
pub const SYS_add_key: ::c_long = 309;
pub const SYS_request_key: ::c_long = 310;
pub const SYS_keyctl: ::c_long = 311;
pub const SYS_semtimedop: ::c_long = 312;
pub const SYS_vserver: ::c_long = 313;
pub const SYS_ioprio_set: ::c_long = 314;
pub const SYS_ioprio_get: ::c_long = 315;
pub const SYS_inotify_init: ::c_long = 316;
pub const SYS_inotify_add_watch: ::c_long = 317;
pub const SYS_inotify_rm_watch: ::c_long = 318;
pub const SYS_mbind: ::c_long = 319;
pub const SYS_get_mempolicy: ::c_long = 320;
pub const SYS_set_mempolicy: ::c_long = 321;
pub const SYS_openat: ::c_long = 322;
pub const SYS_mkdirat: ::c_long = 323;
pub const SYS_mknodat: ::c_long = 324;
pub const SYS_fchownat: ::c_long = 325;
pub const SYS_futimesat: ::c_long = 326;
pub const SYS_fstatat64: ::c_long = 327;
pub const SYS_unlinkat: ::c_long = 328;
pub const SYS_renameat: ::c_long = 329;
pub const SYS_linkat: ::c_long = 330;
pub const SYS_symlinkat: ::c_long = 331;
pub const SYS_readlinkat: ::c_long = 332;
pub const SYS_fchmodat: ::c_long = 333;
pub const SYS_faccessat: ::c_long = 334;
pub const SYS_pselect6: ::c_long = 335;
pub const SYS_ppoll: ::c_long = 336;
pub const SYS_unshare: ::c_long = 337;
pub const SYS_set_robust_list: ::c_long = 338;
pub const SYS_get_robust_list: ::c_long = 339;
pub const SYS_splice: ::c_long = 340;
pub const SYS_arm_sync_file_range: ::c_long = 341;
pub const SYS_tee: ::c_long = 342;
pub const SYS_vmsplice: ::c_long = 343;
pub const SYS_move_pages: ::c_long = 344;
pub const SYS_getcpu: ::c_long = 345;
pub const SYS_epoll_pwait: ::c_long = 346;
pub const SYS_kexec_load: ::c_long = 347;
pub const SYS_utimensat: ::c_long = 348;
pub const SYS_signalfd: ::c_long = 349;
pub const SYS_timerfd_create: ::c_long = 350;
pub const SYS_eventfd: ::c_long = 351;
pub const SYS_fallocate: ::c_long = 352;
pub const SYS_timerfd_settime: ::c_long = 353;
pub const SYS_timerfd_gettime: ::c_long = 354;
pub const SYS_signalfd4: ::c_long = 355;
pub const SYS_eventfd2: ::c_long = 356;
pub const SYS_epoll_create1: ::c_long = 357;
pub const SYS_dup3: ::c_long = 358;
pub const SYS_pipe2: ::c_long = 359;
pub const SYS_inotify_init1: ::c_long = 360;
pub const SYS_preadv: ::c_long = 361;
pub const SYS_pwritev: ::c_long = 362;
pub const SYS_rt_tgsigqueueinfo: ::c_long = 363;
pub const SYS_perf_event_open: ::c_long = 364;
pub const SYS_recvmmsg: ::c_long = 365;
pub const SYS_accept4: ::c_long = 366;
pub const SYS_fanotify_init: ::c_long = 367;
pub const SYS_fanotify_mark: ::c_long = 368;
pub const SYS_prlimit64: ::c_long = 369;
pub const SYS_name_to_handle_at: ::c_long = 370;
pub const SYS_open_by_handle_at: ::c_long = 371;
pub const SYS_clock_adjtime: ::c_long = 372;
pub const SYS_syncfs: ::c_long = 373;
pub const SYS_sendmmsg: ::c_long = 374;
pub const SYS_setns: ::c_long = 375;
pub const SYS_process_vm_readv: ::c_long = 376;
pub const SYS_process_vm_writev: ::c_long = 377;
pub const SYS_kcmp: ::c_long = 378;
pub const SYS_finit_module: ::c_long = 379;
pub const SYS_sched_setattr: ::c_long = 380;
pub const SYS_sched_getattr: ::c_long = 381;
pub const SYS_renameat2: ::c_long = 382;
pub const SYS_seccomp: ::c_long = 383;
pub const SYS_getrandom: ::c_long = 384;
pub const SYS_memfd_create: ::c_long = 385;
pub const SYS_bpf: ::c_long = 386;
pub const SYS_execveat: ::c_long = 387;
pub const SYS_userfaultfd: ::c_long = 388;
pub const SYS_membarrier: ::c_long = 389;
pub const SYS_mlock2: ::c_long = 390;
pub const SYS_copy_file_range: ::c_long = 391;
pub const SYS_preadv2: ::c_long = 392;
pub const SYS_pwritev2: ::c_long = 393;
pub const SYS_pkey_mprotect: ::c_long = 394;
pub const SYS_pkey_alloc: ::c_long = 395;
pub const SYS_pkey_free: ::c_long = 396;
pub const SYS_statx: ::c_long = 397;
pub const SYS_rseq: ::c_long = 398;
pub const SYS_kexec_file_load: ::c_long = 401;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
pub const SYS_open_tree: ::c_long = 428;
pub const SYS_move_mount: ::c_long = 429;
pub const SYS_fsopen: ::c_long = 430;
pub const SYS_fsconfig: ::c_long = 431;
pub const SYS_fsmount: ::c_long = 432;
pub const SYS_fspick: ::c_long = 433;
pub const SYS_pidfd_open: ::c_long = 434;
pub const SYS_clone3: ::c_long = 435;
pub const SYS_close_range: ::c_long = 436;
pub const SYS_openat2: ::c_long = 437;
pub const SYS_pidfd_getfd: ::c_long = 438;
pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
pub const SYS_quotactl_fd: ::c_long = 443;
pub const SYS_landlock_create_ruleset: ::c_long = 444;
pub const SYS_landlock_add_rule: ::c_long = 445;
pub const SYS_landlock_restrict_self: ::c_long = 446;
pub const SYS_memfd_secret: ::c_long = 447;
pub const SYS_process_mrelease: ::c_long = 448;
pub const SYS_futex_waitv: ::c_long = 449;
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
pub const SYS_mseal: ::c_long = 462;
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}

View file

@ -0,0 +1,7 @@
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(8))]
pub struct max_align_t {
priv_: [i64; 2]
}
}

View file

@ -0,0 +1,741 @@
pub type c_char = u8;
pub type wchar_t = u32;
s! {
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
}
pub struct statfs {
pub f_type: ::__fsword_t,
pub f_bsize: ::__fsword_t,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::__fsword_t,
pub f_frsize: ::__fsword_t,
f_spare: [::__fsword_t; 5],
}
pub struct flock {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off_t,
pub l_len: ::off_t,
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}
pub struct ipc_perm {
pub __key: ::key_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::c_ushort,
__pad1: ::c_ushort,
pub __seq: ::c_ushort,
__pad2: ::c_ushort,
__unused1: ::c_ulong,
__unused2: ::c_ulong
}
pub struct stat64 {
pub st_dev: ::dev_t,
__pad1: ::c_uint,
__st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
__pad2: ::c_uint,
pub st_size: ::off64_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt64_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_ino: ::ino64_t,
}
pub struct statfs64 {
pub f_type: ::__fsword_t,
pub f_bsize: ::__fsword_t,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_fsid: ::fsid_t,
pub f_namelen: ::__fsword_t,
pub f_frsize: ::__fsword_t,
pub f_flags: ::__fsword_t,
pub f_spare: [::__fsword_t; 4],
}
pub struct statvfs64 {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_favail: u64,
pub f_fsid: ::c_ulong,
__f_unused: ::c_int,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_atime: ::time_t,
__unused1: ::c_ulong,
pub shm_dtime: ::time_t,
__unused2: ::c_ulong,
pub shm_ctime: ::time_t,
__unused3: ::c_ulong,
pub shm_cpid: ::pid_t,
pub shm_lpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
__unused4: ::c_ulong,
__unused5: ::c_ulong
}
pub struct msqid_ds {
pub msg_perm: ::ipc_perm,
pub msg_stime: ::time_t,
__glibc_reserved1: ::c_ulong,
pub msg_rtime: ::time_t,
__glibc_reserved2: ::c_ulong,
pub msg_ctime: ::time_t,
__glibc_reserved3: ::c_ulong,
__msg_cbytes: ::c_ulong,
pub msg_qnum: ::msgqnum_t,
pub msg_qbytes: ::msglen_t,
pub msg_lspid: ::pid_t,
pub msg_lrpid: ::pid_t,
__glibc_reserved4: ::c_ulong,
__glibc_reserved5: ::c_ulong,
}
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
pub si_code: ::c_int,
#[doc(hidden)]
#[deprecated(
since="0.2.54",
note="Please leave a comment on \
https://github.com/rust-lang/libc/pull/1316 if you're using \
this field"
)]
pub _pad: [::c_int; 29],
_align: [usize; 0],
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_flags: ::c_int,
pub ss_size: ::size_t
}
}
pub const VEOF: usize = 4;
pub const RTLD_DEEPBIND: ::c_int = 0x8;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const RTLD_NOLOAD: ::c_int = 0x4;
pub const O_DIRECT: ::c_int = 0x4000;
pub const O_DIRECTORY: ::c_int = 0x10000;
pub const O_NOFOLLOW: ::c_int = 0x20000;
pub const O_LARGEFILE: ::c_int = 0o100000;
pub const O_APPEND: ::c_int = 1024;
pub const O_CREAT: ::c_int = 64;
pub const O_EXCL: ::c_int = 128;
pub const O_NOCTTY: ::c_int = 256;
pub const O_NONBLOCK: ::c_int = 2048;
pub const O_SYNC: ::c_int = 1052672;
pub const O_RSYNC: ::c_int = 1052672;
pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_NDELAY: ::c_int = 0x800;
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MAP_LOCKED: ::c_int = 0x02000;
pub const MAP_NORESERVE: ::c_int = 0x04000;
pub const MAP_ANON: ::c_int = 0x0020;
pub const MAP_ANONYMOUS: ::c_int = 0x0020;
pub const MAP_DENYWRITE: ::c_int = 0x0800;
pub const MAP_EXECUTABLE: ::c_int = 0x01000;
pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const EDEADLOCK: ::c_int = 35;
pub const EUCLEAN: ::c_int = 117;
pub const ENOTNAM: ::c_int = 118;
pub const ENAVAIL: ::c_int = 119;
pub const EISNAM: ::c_int = 120;
pub const EREMOTEIO: ::c_int = 121;
pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
pub const ENOLCK: ::c_int = 37;
pub const ENOSYS: ::c_int = 38;
pub const ENOTEMPTY: ::c_int = 39;
pub const ELOOP: ::c_int = 40;
pub const ENOMSG: ::c_int = 42;
pub const EIDRM: ::c_int = 43;
pub const ECHRNG: ::c_int = 44;
pub const EL2NSYNC: ::c_int = 45;
pub const EL3HLT: ::c_int = 46;
pub const EL3RST: ::c_int = 47;
pub const ELNRNG: ::c_int = 48;
pub const EUNATCH: ::c_int = 49;
pub const ENOCSI: ::c_int = 50;
pub const EL2HLT: ::c_int = 51;
pub const EBADE: ::c_int = 52;
pub const EBADR: ::c_int = 53;
pub const EXFULL: ::c_int = 54;
pub const ENOANO: ::c_int = 55;
pub const EBADRQC: ::c_int = 56;
pub const EBADSLT: ::c_int = 57;
pub const EMULTIHOP: ::c_int = 72;
pub const EOVERFLOW: ::c_int = 75;
pub const ENOTUNIQ: ::c_int = 76;
pub const EBADFD: ::c_int = 77;
pub const EBADMSG: ::c_int = 74;
pub const EREMCHG: ::c_int = 78;
pub const ELIBACC: ::c_int = 79;
pub const ELIBBAD: ::c_int = 80;
pub const ELIBSCN: ::c_int = 81;
pub const ELIBMAX: ::c_int = 82;
pub const ELIBEXEC: ::c_int = 83;
pub const EILSEQ: ::c_int = 84;
pub const ERESTART: ::c_int = 85;
pub const ESTRPIPE: ::c_int = 86;
pub const EUSERS: ::c_int = 87;
pub const ENOTSOCK: ::c_int = 88;
pub const EDESTADDRREQ: ::c_int = 89;
pub const EMSGSIZE: ::c_int = 90;
pub const EPROTOTYPE: ::c_int = 91;
pub const ENOPROTOOPT: ::c_int = 92;
pub const EPROTONOSUPPORT: ::c_int = 93;
pub const ESOCKTNOSUPPORT: ::c_int = 94;
pub const EOPNOTSUPP: ::c_int = 95;
pub const EPFNOSUPPORT: ::c_int = 96;
pub const EAFNOSUPPORT: ::c_int = 97;
pub const EADDRINUSE: ::c_int = 98;
pub const EADDRNOTAVAIL: ::c_int = 99;
pub const ENETDOWN: ::c_int = 100;
pub const ENETUNREACH: ::c_int = 101;
pub const ENETRESET: ::c_int = 102;
pub const ECONNABORTED: ::c_int = 103;
pub const ECONNRESET: ::c_int = 104;
pub const ENOBUFS: ::c_int = 105;
pub const EISCONN: ::c_int = 106;
pub const ENOTCONN: ::c_int = 107;
pub const ESHUTDOWN: ::c_int = 108;
pub const ETOOMANYREFS: ::c_int = 109;
pub const ETIMEDOUT: ::c_int = 110;
pub const ECONNREFUSED: ::c_int = 111;
pub const EHOSTDOWN: ::c_int = 112;
pub const EHOSTUNREACH: ::c_int = 113;
pub const EALREADY: ::c_int = 114;
pub const EINPROGRESS: ::c_int = 115;
pub const ESTALE: ::c_int = 116;
pub const EDQUOT: ::c_int = 122;
pub const ENOMEDIUM: ::c_int = 123;
pub const EMEDIUMTYPE: ::c_int = 124;
pub const ECANCELED: ::c_int = 125;
pub const ENOKEY: ::c_int = 126;
pub const EKEYEXPIRED: ::c_int = 127;
pub const EKEYREVOKED: ::c_int = 128;
pub const EKEYREJECTED: ::c_int = 129;
pub const EOWNERDEAD: ::c_int = 130;
pub const ENOTRECOVERABLE: ::c_int = 131;
pub const EHWPOISON: ::c_int = 133;
pub const ERFKILL: ::c_int = 132;
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
pub const F_GETLK: ::c_int = 5;
pub const F_GETOWN: ::c_int = 9;
pub const F_SETOWN: ::c_int = 8;
pub const EFD_NONBLOCK: ::c_int = 0x800;
pub const SFD_NONBLOCK: ::c_int = 0x0800;
pub const SIGCHLD: ::c_int = 17;
pub const SIGBUS: ::c_int = 7;
pub const SIGUSR1: ::c_int = 10;
pub const SIGUSR2: ::c_int = 12;
pub const SIGCONT: ::c_int = 18;
pub const SIGSTOP: ::c_int = 19;
pub const SIGTSTP: ::c_int = 20;
pub const SIGURG: ::c_int = 23;
pub const SIGIO: ::c_int = 29;
pub const SIGSYS: ::c_int = 31;
pub const SIGSTKFLT: ::c_int = 16;
#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
pub const SIGUNUSED: ::c_int = 31;
pub const SIGPOLL: ::c_int = 29;
pub const SIGPWR: ::c_int = 30;
pub const SIG_SETMASK: ::c_int = 2;
pub const SIG_BLOCK: ::c_int = 0x000000;
pub const SIG_UNBLOCK: ::c_int = 0x01;
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;
pub const SIGXCPU: ::c_int = 24;
pub const SIGXFSZ: ::c_int = 25;
pub const SIGVTALRM: ::c_int = 26;
pub const SIGPROF: ::c_int = 27;
pub const SIGWINCH: ::c_int = 28;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::tcflag_t = 0x00000800;
pub const TAB2: ::tcflag_t = 0x00001000;
pub const TAB3: ::tcflag_t = 0x00001800;
pub const CR1: ::tcflag_t = 0x00000200;
pub const CR2: ::tcflag_t = 0x00000400;
pub const CR3: ::tcflag_t = 0x00000600;
pub const FF1: ::tcflag_t = 0x00008000;
pub const BS1: ::tcflag_t = 0x00002000;
pub const VT1: ::tcflag_t = 0x00004000;
pub const VWERASE: usize = 14;
pub const VREPRINT: usize = 12;
pub const VSUSP: usize = 10;
pub const VSTART: usize = 8;
pub const VSTOP: usize = 9;
pub const VDISCARD: usize = 13;
pub const VTIME: usize = 5;
pub const IXON: ::tcflag_t = 0x00000400;
pub const IXOFF: ::tcflag_t = 0x00001000;
pub const ONLCR: ::tcflag_t = 0x4;
pub const CSIZE: ::tcflag_t = 0x00000030;
pub const CS6: ::tcflag_t = 0x00000010;
pub const CS7: ::tcflag_t = 0x00000020;
pub const CS8: ::tcflag_t = 0x00000030;
pub const CSTOPB: ::tcflag_t = 0x00000040;
pub const CREAD: ::tcflag_t = 0x00000080;
pub const PARENB: ::tcflag_t = 0x00000100;
pub const PARODD: ::tcflag_t = 0x00000200;
pub const HUPCL: ::tcflag_t = 0x00000400;
pub const CLOCAL: ::tcflag_t = 0x00000800;
pub const ECHOKE: ::tcflag_t = 0x00000800;
pub const ECHOE: ::tcflag_t = 0x00000010;
pub const ECHOK: ::tcflag_t = 0x00000020;
pub const ECHONL: ::tcflag_t = 0x00000040;
pub const ECHOPRT: ::tcflag_t = 0x00000400;
pub const ECHOCTL: ::tcflag_t = 0x00000200;
pub const ISIG: ::tcflag_t = 0x00000001;
pub const ICANON: ::tcflag_t = 0x00000002;
pub const PENDIN: ::tcflag_t = 0x00004000;
pub const NOFLSH: ::tcflag_t = 0x00000080;
pub const CIBAUD: ::tcflag_t = 0o02003600000;
pub const CBAUDEX: ::tcflag_t = 0o010000;
pub const VSWTC: usize = 7;
pub const OLCUC: ::tcflag_t = 0o000002;
pub const NLDLY: ::tcflag_t = 0o000400;
pub const CRDLY: ::tcflag_t = 0o003000;
pub const TABDLY: ::tcflag_t = 0o014000;
pub const BSDLY: ::tcflag_t = 0o020000;
pub const FFDLY: ::tcflag_t = 0o100000;
pub const VTDLY: ::tcflag_t = 0o040000;
pub const XTABS: ::tcflag_t = 0o014000;
pub const B0: ::speed_t = 0o000000;
pub const B50: ::speed_t = 0o000001;
pub const B75: ::speed_t = 0o000002;
pub const B110: ::speed_t = 0o000003;
pub const B134: ::speed_t = 0o000004;
pub const B150: ::speed_t = 0o000005;
pub const B200: ::speed_t = 0o000006;
pub const B300: ::speed_t = 0o000007;
pub const B600: ::speed_t = 0o000010;
pub const B1200: ::speed_t = 0o000011;
pub const B1800: ::speed_t = 0o000012;
pub const B2400: ::speed_t = 0o000013;
pub const B4800: ::speed_t = 0o000014;
pub const B9600: ::speed_t = 0o000015;
pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
pub const B460800: ::speed_t = 0o010004;
pub const B500000: ::speed_t = 0o010005;
pub const B576000: ::speed_t = 0o010006;
pub const B921600: ::speed_t = 0o010007;
pub const B1000000: ::speed_t = 0o010010;
pub const B1152000: ::speed_t = 0o010011;
pub const B1500000: ::speed_t = 0o010012;
pub const B2000000: ::speed_t = 0o010013;
pub const B2500000: ::speed_t = 0o010014;
pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
pub const EXTPROC: ::tcflag_t = 0x00010000;
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
// Syscall table
pub const SYS_read: ::c_long = 63;
pub const SYS_write: ::c_long = 64;
pub const SYS_close: ::c_long = 57;
pub const SYS_fstat: ::c_long = 80;
pub const SYS_lseek: ::c_long = 62;
pub const SYS_mmap: ::c_long = 222;
pub const SYS_mprotect: ::c_long = 226;
pub const SYS_munmap: ::c_long = 215;
pub const SYS_brk: ::c_long = 214;
pub const SYS_rt_sigaction: ::c_long = 134;
pub const SYS_rt_sigprocmask: ::c_long = 135;
pub const SYS_rt_sigreturn: ::c_long = 139;
pub const SYS_ioctl: ::c_long = 29;
pub const SYS_pread64: ::c_long = 67;
pub const SYS_pwrite64: ::c_long = 68;
pub const SYS_readv: ::c_long = 65;
pub const SYS_writev: ::c_long = 66;
pub const SYS_sched_yield: ::c_long = 124;
pub const SYS_mremap: ::c_long = 216;
pub const SYS_msync: ::c_long = 227;
pub const SYS_mincore: ::c_long = 232;
pub const SYS_madvise: ::c_long = 233;
pub const SYS_shmget: ::c_long = 194;
pub const SYS_shmat: ::c_long = 196;
pub const SYS_shmctl: ::c_long = 195;
pub const SYS_dup: ::c_long = 23;
pub const SYS_nanosleep: ::c_long = 101;
pub const SYS_getitimer: ::c_long = 102;
pub const SYS_setitimer: ::c_long = 103;
pub const SYS_getpid: ::c_long = 172;
pub const SYS_sendfile: ::c_long = 71;
pub const SYS_socket: ::c_long = 198;
pub const SYS_connect: ::c_long = 203;
pub const SYS_accept: ::c_long = 202;
pub const SYS_sendto: ::c_long = 206;
pub const SYS_recvfrom: ::c_long = 207;
pub const SYS_sendmsg: ::c_long = 211;
pub const SYS_recvmsg: ::c_long = 212;
pub const SYS_shutdown: ::c_long = 210;
pub const SYS_bind: ::c_long = 200;
pub const SYS_listen: ::c_long = 201;
pub const SYS_getsockname: ::c_long = 204;
pub const SYS_getpeername: ::c_long = 205;
pub const SYS_socketpair: ::c_long = 199;
pub const SYS_setsockopt: ::c_long = 208;
pub const SYS_getsockopt: ::c_long = 209;
pub const SYS_clone: ::c_long = 220;
pub const SYS_execve: ::c_long = 221;
pub const SYS_exit: ::c_long = 93;
pub const SYS_wait4: ::c_long = 260;
pub const SYS_kill: ::c_long = 129;
pub const SYS_uname: ::c_long = 160;
pub const SYS_semget: ::c_long = 190;
pub const SYS_semop: ::c_long = 193;
pub const SYS_semctl: ::c_long = 191;
pub const SYS_shmdt: ::c_long = 197;
pub const SYS_msgget: ::c_long = 186;
pub const SYS_msgsnd: ::c_long = 189;
pub const SYS_msgrcv: ::c_long = 188;
pub const SYS_msgctl: ::c_long = 187;
pub const SYS_fcntl: ::c_long = 25;
pub const SYS_flock: ::c_long = 32;
pub const SYS_fsync: ::c_long = 82;
pub const SYS_fdatasync: ::c_long = 83;
pub const SYS_truncate: ::c_long = 45;
pub const SYS_ftruncate: ::c_long = 46;
pub const SYS_getcwd: ::c_long = 17;
pub const SYS_chdir: ::c_long = 49;
pub const SYS_fchdir: ::c_long = 50;
pub const SYS_fchmod: ::c_long = 52;
pub const SYS_fchown: ::c_long = 55;
pub const SYS_umask: ::c_long = 166;
pub const SYS_gettimeofday: ::c_long = 169;
pub const SYS_getrlimit: ::c_long = 163;
pub const SYS_getrusage: ::c_long = 165;
pub const SYS_sysinfo: ::c_long = 179;
pub const SYS_times: ::c_long = 153;
pub const SYS_ptrace: ::c_long = 117;
pub const SYS_getuid: ::c_long = 174;
pub const SYS_syslog: ::c_long = 116;
pub const SYS_getgid: ::c_long = 176;
pub const SYS_setuid: ::c_long = 146;
pub const SYS_setgid: ::c_long = 144;
pub const SYS_geteuid: ::c_long = 175;
pub const SYS_getegid: ::c_long = 177;
pub const SYS_setpgid: ::c_long = 154;
pub const SYS_getppid: ::c_long = 173;
pub const SYS_setsid: ::c_long = 157;
pub const SYS_setreuid: ::c_long = 145;
pub const SYS_setregid: ::c_long = 143;
pub const SYS_getgroups: ::c_long = 158;
pub const SYS_setgroups: ::c_long = 159;
pub const SYS_setresuid: ::c_long = 147;
pub const SYS_getresuid: ::c_long = 148;
pub const SYS_setresgid: ::c_long = 149;
pub const SYS_getresgid: ::c_long = 150;
pub const SYS_getpgid: ::c_long = 155;
pub const SYS_setfsuid: ::c_long = 151;
pub const SYS_setfsgid: ::c_long = 152;
pub const SYS_getsid: ::c_long = 156;
pub const SYS_capget: ::c_long = 90;
pub const SYS_capset: ::c_long = 91;
pub const SYS_rt_sigpending: ::c_long = 136;
pub const SYS_rt_sigtimedwait: ::c_long = 137;
pub const SYS_rt_sigqueueinfo: ::c_long = 138;
pub const SYS_rt_sigsuspend: ::c_long = 133;
pub const SYS_sigaltstack: ::c_long = 132;
pub const SYS_personality: ::c_long = 92;
pub const SYS_statfs: ::c_long = 43;
pub const SYS_fstatfs: ::c_long = 44;
pub const SYS_getpriority: ::c_long = 141;
pub const SYS_setpriority: ::c_long = 140;
pub const SYS_sched_setparam: ::c_long = 118;
pub const SYS_sched_getparam: ::c_long = 121;
pub const SYS_sched_setscheduler: ::c_long = 119;
pub const SYS_sched_getscheduler: ::c_long = 120;
pub const SYS_sched_get_priority_max: ::c_long = 125;
pub const SYS_sched_get_priority_min: ::c_long = 126;
pub const SYS_sched_rr_get_interval: ::c_long = 127;
pub const SYS_mlock: ::c_long = 228;
pub const SYS_munlock: ::c_long = 229;
pub const SYS_mlockall: ::c_long = 230;
pub const SYS_munlockall: ::c_long = 231;
pub const SYS_vhangup: ::c_long = 58;
pub const SYS_pivot_root: ::c_long = 41;
pub const SYS_prctl: ::c_long = 167;
pub const SYS_adjtimex: ::c_long = 171;
pub const SYS_setrlimit: ::c_long = 164;
pub const SYS_chroot: ::c_long = 51;
pub const SYS_sync: ::c_long = 81;
pub const SYS_acct: ::c_long = 89;
pub const SYS_settimeofday: ::c_long = 170;
pub const SYS_mount: ::c_long = 40;
pub const SYS_umount2: ::c_long = 39;
pub const SYS_swapon: ::c_long = 224;
pub const SYS_swapoff: ::c_long = 225;
pub const SYS_reboot: ::c_long = 142;
pub const SYS_sethostname: ::c_long = 161;
pub const SYS_setdomainname: ::c_long = 162;
pub const SYS_init_module: ::c_long = 105;
pub const SYS_delete_module: ::c_long = 106;
pub const SYS_quotactl: ::c_long = 60;
pub const SYS_nfsservctl: ::c_long = 42;
pub const SYS_gettid: ::c_long = 178;
pub const SYS_readahead: ::c_long = 213;
pub const SYS_setxattr: ::c_long = 5;
pub const SYS_lsetxattr: ::c_long = 6;
pub const SYS_fsetxattr: ::c_long = 7;
pub const SYS_getxattr: ::c_long = 8;
pub const SYS_lgetxattr: ::c_long = 9;
pub const SYS_fgetxattr: ::c_long = 10;
pub const SYS_listxattr: ::c_long = 11;
pub const SYS_llistxattr: ::c_long = 12;
pub const SYS_flistxattr: ::c_long = 13;
pub const SYS_removexattr: ::c_long = 14;
pub const SYS_lremovexattr: ::c_long = 15;
pub const SYS_fremovexattr: ::c_long = 16;
pub const SYS_tkill: ::c_long = 130;
pub const SYS_futex: ::c_long = 98;
pub const SYS_sched_setaffinity: ::c_long = 122;
pub const SYS_sched_getaffinity: ::c_long = 123;
pub const SYS_io_setup: ::c_long = 0;
pub const SYS_io_destroy: ::c_long = 1;
pub const SYS_io_getevents: ::c_long = 4;
pub const SYS_io_submit: ::c_long = 2;
pub const SYS_io_cancel: ::c_long = 3;
pub const SYS_lookup_dcookie: ::c_long = 18;
pub const SYS_remap_file_pages: ::c_long = 234;
pub const SYS_getdents64: ::c_long = 61;
pub const SYS_set_tid_address: ::c_long = 96;
pub const SYS_restart_syscall: ::c_long = 128;
pub const SYS_semtimedop: ::c_long = 192;
pub const SYS_fadvise64: ::c_long = 223;
pub const SYS_timer_create: ::c_long = 107;
pub const SYS_timer_settime: ::c_long = 110;
pub const SYS_timer_gettime: ::c_long = 108;
pub const SYS_timer_getoverrun: ::c_long = 109;
pub const SYS_timer_delete: ::c_long = 111;
pub const SYS_clock_settime: ::c_long = 112;
pub const SYS_clock_gettime: ::c_long = 113;
pub const SYS_clock_getres: ::c_long = 114;
pub const SYS_clock_nanosleep: ::c_long = 115;
pub const SYS_exit_group: ::c_long = 94;
pub const SYS_epoll_ctl: ::c_long = 21;
pub const SYS_tgkill: ::c_long = 131;
pub const SYS_mbind: ::c_long = 235;
pub const SYS_set_mempolicy: ::c_long = 237;
pub const SYS_get_mempolicy: ::c_long = 236;
pub const SYS_mq_open: ::c_long = 180;
pub const SYS_mq_unlink: ::c_long = 181;
pub const SYS_mq_timedsend: ::c_long = 182;
pub const SYS_mq_timedreceive: ::c_long = 183;
pub const SYS_mq_notify: ::c_long = 184;
pub const SYS_mq_getsetattr: ::c_long = 185;
pub const SYS_kexec_load: ::c_long = 104;
pub const SYS_waitid: ::c_long = 95;
pub const SYS_add_key: ::c_long = 217;
pub const SYS_request_key: ::c_long = 218;
pub const SYS_keyctl: ::c_long = 219;
pub const SYS_ioprio_set: ::c_long = 30;
pub const SYS_ioprio_get: ::c_long = 31;
pub const SYS_inotify_add_watch: ::c_long = 27;
pub const SYS_inotify_rm_watch: ::c_long = 28;
pub const SYS_migrate_pages: ::c_long = 238;
pub const SYS_openat: ::c_long = 56;
pub const SYS_mkdirat: ::c_long = 34;
pub const SYS_mknodat: ::c_long = 33;
pub const SYS_fchownat: ::c_long = 54;
pub const SYS_newfstatat: ::c_long = 79;
pub const SYS_unlinkat: ::c_long = 35;
pub const SYS_linkat: ::c_long = 37;
pub const SYS_symlinkat: ::c_long = 36;
pub const SYS_readlinkat: ::c_long = 78;
pub const SYS_fchmodat: ::c_long = 53;
pub const SYS_faccessat: ::c_long = 48;
pub const SYS_pselect6: ::c_long = 72;
pub const SYS_ppoll: ::c_long = 73;
pub const SYS_unshare: ::c_long = 97;
pub const SYS_set_robust_list: ::c_long = 99;
pub const SYS_get_robust_list: ::c_long = 100;
pub const SYS_splice: ::c_long = 76;
pub const SYS_tee: ::c_long = 77;
pub const SYS_sync_file_range: ::c_long = 84;
pub const SYS_vmsplice: ::c_long = 75;
pub const SYS_move_pages: ::c_long = 239;
pub const SYS_utimensat: ::c_long = 88;
pub const SYS_epoll_pwait: ::c_long = 22;
pub const SYS_timerfd_create: ::c_long = 85;
pub const SYS_fallocate: ::c_long = 47;
pub const SYS_timerfd_settime: ::c_long = 86;
pub const SYS_timerfd_gettime: ::c_long = 87;
pub const SYS_accept4: ::c_long = 242;
pub const SYS_signalfd4: ::c_long = 74;
pub const SYS_eventfd2: ::c_long = 19;
pub const SYS_epoll_create1: ::c_long = 20;
pub const SYS_dup3: ::c_long = 24;
pub const SYS_pipe2: ::c_long = 59;
pub const SYS_inotify_init1: ::c_long = 26;
pub const SYS_preadv: ::c_long = 69;
pub const SYS_pwritev: ::c_long = 70;
pub const SYS_rt_tgsigqueueinfo: ::c_long = 240;
pub const SYS_perf_event_open: ::c_long = 241;
pub const SYS_recvmmsg: ::c_long = 243;
pub const SYS_fanotify_init: ::c_long = 262;
pub const SYS_fanotify_mark: ::c_long = 263;
pub const SYS_prlimit64: ::c_long = 261;
pub const SYS_name_to_handle_at: ::c_long = 264;
pub const SYS_open_by_handle_at: ::c_long = 265;
pub const SYS_clock_adjtime: ::c_long = 266;
pub const SYS_syncfs: ::c_long = 267;
pub const SYS_sendmmsg: ::c_long = 269;
pub const SYS_setns: ::c_long = 268;
pub const SYS_getcpu: ::c_long = 168;
pub const SYS_process_vm_readv: ::c_long = 270;
pub const SYS_process_vm_writev: ::c_long = 271;
pub const SYS_kcmp: ::c_long = 272;
pub const SYS_finit_module: ::c_long = 273;
pub const SYS_sched_setattr: ::c_long = 274;
pub const SYS_sched_getattr: ::c_long = 275;
pub const SYS_renameat2: ::c_long = 276;
pub const SYS_seccomp: ::c_long = 277;
pub const SYS_getrandom: ::c_long = 278;
pub const SYS_memfd_create: ::c_long = 279;
pub const SYS_bpf: ::c_long = 280;
pub const SYS_execveat: ::c_long = 281;
pub const SYS_userfaultfd: ::c_long = 282;
pub const SYS_membarrier: ::c_long = 283;
pub const SYS_mlock2: ::c_long = 284;
pub const SYS_copy_file_range: ::c_long = 285;
pub const SYS_preadv2: ::c_long = 286;
pub const SYS_pwritev2: ::c_long = 287;
pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
pub const SYS_statx: ::c_long = 291;
pub const SYS_rseq: ::c_long = 293;
pub const SYS_syscall: ::c_long = 294;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
pub const SYS_open_tree: ::c_long = 428;
pub const SYS_move_mount: ::c_long = 429;
pub const SYS_fsopen: ::c_long = 430;
pub const SYS_fsconfig: ::c_long = 431;
pub const SYS_fsmount: ::c_long = 432;
pub const SYS_fspick: ::c_long = 433;
pub const SYS_pidfd_open: ::c_long = 434;
pub const SYS_clone3: ::c_long = 435;
pub const SYS_close_range: ::c_long = 436;
pub const SYS_openat2: ::c_long = 437;
pub const SYS_pidfd_getfd: ::c_long = 438;
pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
pub const SYS_quotactl_fd: ::c_long = 443;
pub const SYS_landlock_create_ruleset: ::c_long = 444;
pub const SYS_landlock_add_rule: ::c_long = 445;
pub const SYS_landlock_restrict_self: ::c_long = 446;
pub const SYS_memfd_secret: ::c_long = 447;
pub const SYS_process_mrelease: ::c_long = 448;
pub const SYS_futex_waitv: ::c_long = 449;
pub const SYS_set_mempolicy_home_node: ::c_long = 450;
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}

View file

@ -0,0 +1,7 @@
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(2))]
pub struct max_align_t {
priv_: [i8; 20]
}
}

View file

@ -0,0 +1,850 @@
pub type c_char = i8;
pub type wchar_t = i32;
s! {
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
}
pub struct statfs {
pub f_type: ::__fsword_t,
pub f_bsize: ::__fsword_t,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::__fsword_t,
pub f_frsize: ::__fsword_t,
pub f_flags: ::__fsword_t,
f_spare: [::__fsword_t; 4],
}
pub struct flock {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off_t,
pub l_len: ::off_t,
pub l_pid: ::pid_t,
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
pub l_pid: ::pid_t,
}
pub struct ipc_perm {
__key: ::key_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::mode_t,
__seq: ::c_ushort,
__pad1: ::c_ushort,
__glibc_reserved1: ::c_ulong,
__glibc_reserved2: ::c_ulong,
}
pub struct stat64 {
pub st_dev: ::dev_t,
__pad1: ::c_ushort,
pub __st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
__pad2: ::c_ushort,
pub st_size: ::off64_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt64_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_ulong,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_ulong,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_ulong,
pub st_ino: ::ino64_t,
}
pub struct statfs64 {
pub f_type: ::__fsword_t,
pub f_bsize: ::__fsword_t,
pub f_blocks: ::fsblkcnt64_t,
pub f_bfree: ::fsblkcnt64_t,
pub f_bavail: ::fsblkcnt64_t,
pub f_files: ::fsblkcnt64_t,
pub f_ffree: ::fsblkcnt64_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::__fsword_t,
pub f_frsize: ::__fsword_t,
pub f_flags: ::__fsword_t,
pub f_spare: [::__fsword_t; 4],
}
pub struct statvfs64 {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: ::fsblkcnt64_t,
pub f_bfree: ::fsblkcnt64_t,
pub f_bavail: ::fsblkcnt64_t,
pub f_files: ::fsblkcnt64_t,
pub f_ffree: ::fsblkcnt64_t,
pub f_favail: ::fsblkcnt64_t,
pub f_fsid: ::c_ulong,
__f_unused: ::c_int,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_atime: ::time_t,
__glibc_reserved1: ::c_long,
pub shm_dtime: ::time_t,
__glibc_reserved2: ::c_long,
pub shm_ctime: ::time_t,
__glibc_reserved3: ::c_long,
pub shm_cpid: ::pid_t,
pub shm_lpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
__glibc_reserved5: ::c_ulong,
__glibc_reserved6: ::c_ulong,
}
pub struct msqid_ds {
pub msg_perm: ::ipc_perm,
pub msg_stime: ::time_t,
__glibc_reserved1: ::c_uint,
pub msg_rtime: ::time_t,
__glibc_reserved2: ::c_uint,
pub msg_ctime: ::time_t,
__glibc_reserved3: ::c_uint,
__msg_cbytes: ::c_ulong,
pub msg_qnum: ::msgqnum_t,
pub msg_qbytes: ::msglen_t,
pub msg_lspid: ::pid_t,
pub msg_lrpid: ::pid_t,
__glibc_reserved4: ::c_ulong,
__glibc_reserved5: ::c_ulong,
}
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_code: ::c_int,
pub si_errno: ::c_int,
_pad: [::c_int; 29],
_align: [usize; 0],
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_flags: ::c_int,
pub ss_size: ::size_t
}
}
pub const VEOF: usize = 4;
pub const RTLD_DEEPBIND: ::c_int = 0x8;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const RTLD_NOLOAD: ::c_int = 0x4;
pub const O_DIRECT: ::c_int = 0x10000;
pub const O_DIRECTORY: ::c_int = 0x4000;
pub const O_NOFOLLOW: ::c_int = 0x8000;
pub const O_LARGEFILE: ::c_int = 0x20000;
pub const O_APPEND: ::c_int = 1024;
pub const O_CREAT: ::c_int = 64;
pub const O_EXCL: ::c_int = 128;
pub const O_NOCTTY: ::c_int = 256;
pub const O_NONBLOCK: ::c_int = 2048;
pub const O_SYNC: ::c_int = 1052672;
pub const O_RSYNC: ::c_int = 1052672;
pub const O_DSYNC: ::c_int = 4096;
pub const O_FSYNC: ::c_int = 0x101000;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_NDELAY: ::c_int = 0x800;
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MAP_LOCKED: ::c_int = 0x02000;
pub const MAP_NORESERVE: ::c_int = 0x04000;
pub const MAP_32BIT: ::c_int = 0x0040;
pub const MAP_ANON: ::c_int = 0x0020;
pub const MAP_ANONYMOUS: ::c_int = 0x0020;
pub const MAP_DENYWRITE: ::c_int = 0x0800;
pub const MAP_EXECUTABLE: ::c_int = 0x01000;
pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const EDEADLOCK: ::c_int = 35;
pub const EUCLEAN: ::c_int = 117;
pub const ENOTNAM: ::c_int = 118;
pub const ENAVAIL: ::c_int = 119;
pub const EISNAM: ::c_int = 120;
pub const EREMOTEIO: ::c_int = 121;
pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
pub const ENOLCK: ::c_int = 37;
pub const ENOSYS: ::c_int = 38;
pub const ENOTEMPTY: ::c_int = 39;
pub const ELOOP: ::c_int = 40;
pub const ENOMSG: ::c_int = 42;
pub const EIDRM: ::c_int = 43;
pub const ECHRNG: ::c_int = 44;
pub const EL2NSYNC: ::c_int = 45;
pub const EL3HLT: ::c_int = 46;
pub const EL3RST: ::c_int = 47;
pub const ELNRNG: ::c_int = 48;
pub const EUNATCH: ::c_int = 49;
pub const ENOCSI: ::c_int = 50;
pub const EL2HLT: ::c_int = 51;
pub const EBADE: ::c_int = 52;
pub const EBADR: ::c_int = 53;
pub const EXFULL: ::c_int = 54;
pub const ENOANO: ::c_int = 55;
pub const EBADRQC: ::c_int = 56;
pub const EBADSLT: ::c_int = 57;
pub const EMULTIHOP: ::c_int = 72;
pub const EOVERFLOW: ::c_int = 75;
pub const ENOTUNIQ: ::c_int = 76;
pub const EBADFD: ::c_int = 77;
pub const EBADMSG: ::c_int = 74;
pub const EREMCHG: ::c_int = 78;
pub const ELIBACC: ::c_int = 79;
pub const ELIBBAD: ::c_int = 80;
pub const ELIBSCN: ::c_int = 81;
pub const ELIBMAX: ::c_int = 82;
pub const ELIBEXEC: ::c_int = 83;
pub const EILSEQ: ::c_int = 84;
pub const ERESTART: ::c_int = 85;
pub const ESTRPIPE: ::c_int = 86;
pub const EUSERS: ::c_int = 87;
pub const ENOTSOCK: ::c_int = 88;
pub const EDESTADDRREQ: ::c_int = 89;
pub const EMSGSIZE: ::c_int = 90;
pub const EPROTOTYPE: ::c_int = 91;
pub const ENOPROTOOPT: ::c_int = 92;
pub const EPROTONOSUPPORT: ::c_int = 93;
pub const ESOCKTNOSUPPORT: ::c_int = 94;
pub const EOPNOTSUPP: ::c_int = 95;
pub const EPFNOSUPPORT: ::c_int = 96;
pub const EAFNOSUPPORT: ::c_int = 97;
pub const EADDRINUSE: ::c_int = 98;
pub const EADDRNOTAVAIL: ::c_int = 99;
pub const ENETDOWN: ::c_int = 100;
pub const ENETUNREACH: ::c_int = 101;
pub const ENETRESET: ::c_int = 102;
pub const ECONNABORTED: ::c_int = 103;
pub const ECONNRESET: ::c_int = 104;
pub const ENOBUFS: ::c_int = 105;
pub const EISCONN: ::c_int = 106;
pub const ENOTCONN: ::c_int = 107;
pub const ESHUTDOWN: ::c_int = 108;
pub const ETOOMANYREFS: ::c_int = 109;
pub const ETIMEDOUT: ::c_int = 110;
pub const ECONNREFUSED: ::c_int = 111;
pub const EHOSTDOWN: ::c_int = 112;
pub const EHOSTUNREACH: ::c_int = 113;
pub const EALREADY: ::c_int = 114;
pub const EINPROGRESS: ::c_int = 115;
pub const ESTALE: ::c_int = 116;
pub const EDQUOT: ::c_int = 122;
pub const ENOMEDIUM: ::c_int = 123;
pub const EMEDIUMTYPE: ::c_int = 124;
pub const ECANCELED: ::c_int = 125;
pub const ENOKEY: ::c_int = 126;
pub const EKEYEXPIRED: ::c_int = 127;
pub const EKEYREVOKED: ::c_int = 128;
pub const EKEYREJECTED: ::c_int = 129;
pub const EOWNERDEAD: ::c_int = 130;
pub const ENOTRECOVERABLE: ::c_int = 131;
pub const EHWPOISON: ::c_int = 133;
pub const ERFKILL: ::c_int = 132;
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const F_GETLK: ::c_int = 5;
pub const F_GETOWN: ::c_int = 9;
pub const F_SETOWN: ::c_int = 8;
pub const PTRACE_GETFPXREGS: ::c_uint = 18;
pub const PTRACE_SETFPXREGS: ::c_uint = 19;
pub const PTRACE_SYSEMU: ::c_uint = 31;
pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
pub const EFD_NONBLOCK: ::c_int = 0x800;
pub const SFD_NONBLOCK: ::c_int = 0x0800;
pub const SIGCHLD: ::c_int = 17;
pub const SIGBUS: ::c_int = 7;
pub const SIGUSR1: ::c_int = 10;
pub const SIGUSR2: ::c_int = 12;
pub const SIGCONT: ::c_int = 18;
pub const SIGSTOP: ::c_int = 19;
pub const SIGTSTP: ::c_int = 20;
pub const SIGURG: ::c_int = 23;
pub const SIGIO: ::c_int = 29;
pub const SIGSYS: ::c_int = 31;
pub const SIGSTKFLT: ::c_int = 16;
#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
pub const SIGUNUSED: ::c_int = 31;
pub const SIGPOLL: ::c_int = 29;
pub const SIGPWR: ::c_int = 30;
pub const SIG_SETMASK: ::c_int = 2;
pub const SIG_BLOCK: ::c_int = 0x000000;
pub const SIG_UNBLOCK: ::c_int = 0x01;
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;
pub const SIGXCPU: ::c_int = 24;
pub const SIGXFSZ: ::c_int = 25;
pub const SIGVTALRM: ::c_int = 26;
pub const SIGPROF: ::c_int = 27;
pub const SIGWINCH: ::c_int = 28;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::tcflag_t = 0x00000800;
pub const TAB2: ::tcflag_t = 0x00001000;
pub const TAB3: ::tcflag_t = 0x00001800;
pub const CR1: ::tcflag_t = 0x00000200;
pub const CR2: ::tcflag_t = 0x00000400;
pub const CR3: ::tcflag_t = 0x00000600;
pub const FF1: ::tcflag_t = 0x00008000;
pub const BS1: ::tcflag_t = 0x00002000;
pub const VT1: ::tcflag_t = 0x00004000;
pub const VWERASE: usize = 14;
pub const VREPRINT: usize = 12;
pub const VSUSP: usize = 10;
pub const VSTART: usize = 8;
pub const VSTOP: usize = 9;
pub const VDISCARD: usize = 13;
pub const VTIME: usize = 5;
pub const IXON: ::tcflag_t = 0x00000400;
pub const IXOFF: ::tcflag_t = 0x00001000;
pub const ONLCR: ::tcflag_t = 0x4;
pub const CSIZE: ::tcflag_t = 0x00000030;
pub const CS6: ::tcflag_t = 0x00000010;
pub const CS7: ::tcflag_t = 0x00000020;
pub const CS8: ::tcflag_t = 0x00000030;
pub const CSTOPB: ::tcflag_t = 0x00000040;
pub const CREAD: ::tcflag_t = 0x00000080;
pub const PARENB: ::tcflag_t = 0x00000100;
pub const PARODD: ::tcflag_t = 0x00000200;
pub const HUPCL: ::tcflag_t = 0x00000400;
pub const CLOCAL: ::tcflag_t = 0x00000800;
pub const ECHOKE: ::tcflag_t = 0x00000800;
pub const ECHOE: ::tcflag_t = 0x00000010;
pub const ECHOK: ::tcflag_t = 0x00000020;
pub const ECHONL: ::tcflag_t = 0x00000040;
pub const ECHOPRT: ::tcflag_t = 0x00000400;
pub const ECHOCTL: ::tcflag_t = 0x00000200;
pub const ISIG: ::tcflag_t = 0x00000001;
pub const ICANON: ::tcflag_t = 0x00000002;
pub const PENDIN: ::tcflag_t = 0x00004000;
pub const NOFLSH: ::tcflag_t = 0x00000080;
pub const CIBAUD: ::tcflag_t = 0o02003600000;
pub const CBAUDEX: ::tcflag_t = 0o010000;
pub const VSWTC: usize = 7;
pub const OLCUC: ::tcflag_t = 0o000002;
pub const NLDLY: ::tcflag_t = 0o000400;
pub const CRDLY: ::tcflag_t = 0o003000;
pub const TABDLY: ::tcflag_t = 0o014000;
pub const BSDLY: ::tcflag_t = 0o020000;
pub const FFDLY: ::tcflag_t = 0o100000;
pub const VTDLY: ::tcflag_t = 0o040000;
pub const XTABS: ::tcflag_t = 0o014000;
pub const B0: ::speed_t = 0o000000;
pub const B50: ::speed_t = 0o000001;
pub const B75: ::speed_t = 0o000002;
pub const B110: ::speed_t = 0o000003;
pub const B134: ::speed_t = 0o000004;
pub const B150: ::speed_t = 0o000005;
pub const B200: ::speed_t = 0o000006;
pub const B300: ::speed_t = 0o000007;
pub const B600: ::speed_t = 0o000010;
pub const B1200: ::speed_t = 0o000011;
pub const B1800: ::speed_t = 0o000012;
pub const B2400: ::speed_t = 0o000013;
pub const B4800: ::speed_t = 0o000014;
pub const B9600: ::speed_t = 0o000015;
pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
pub const B460800: ::speed_t = 0o010004;
pub const B500000: ::speed_t = 0o010005;
pub const B576000: ::speed_t = 0o010006;
pub const B921600: ::speed_t = 0o010007;
pub const B1000000: ::speed_t = 0o010010;
pub const B1152000: ::speed_t = 0o010011;
pub const B1500000: ::speed_t = 0o010012;
pub const B2000000: ::speed_t = 0o010013;
pub const B2500000: ::speed_t = 0o010014;
pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
pub const EXTPROC: ::tcflag_t = 0x00010000;
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
pub const SYS_restart_syscall: ::c_long = 0;
pub const SYS_exit: ::c_long = 1;
pub const SYS_fork: ::c_long = 2;
pub const SYS_read: ::c_long = 3;
pub const SYS_write: ::c_long = 4;
pub const SYS_open: ::c_long = 5;
pub const SYS_close: ::c_long = 6;
pub const SYS_waitpid: ::c_long = 7;
pub const SYS_creat: ::c_long = 8;
pub const SYS_link: ::c_long = 9;
pub const SYS_unlink: ::c_long = 10;
pub const SYS_execve: ::c_long = 11;
pub const SYS_chdir: ::c_long = 12;
pub const SYS_time32: ::c_long = 13;
pub const SYS_mknod: ::c_long = 14;
pub const SYS_chmod: ::c_long = 15;
pub const SYS_chown16: ::c_long = 16;
pub const SYS_stat: ::c_long = 18;
pub const SYS_lseek: ::c_long = 19;
pub const SYS_getpid: ::c_long = 20;
pub const SYS_mount: ::c_long = 21;
pub const SYS_oldumount: ::c_long = 22;
pub const SYS_setuid16: ::c_long = 23;
pub const SYS_getuid16: ::c_long = 24;
pub const SYS_stime32: ::c_long = 25;
pub const SYS_ptrace: ::c_long = 26;
pub const SYS_alarm: ::c_long = 27;
pub const SYS_fstat: ::c_long = 28;
pub const SYS_pause: ::c_long = 29;
pub const SYS_utime32: ::c_long = 30;
pub const SYS_access: ::c_long = 33;
pub const SYS_nice: ::c_long = 34;
pub const SYS_sync: ::c_long = 36;
pub const SYS_kill: ::c_long = 37;
pub const SYS_rename: ::c_long = 38;
pub const SYS_mkdir: ::c_long = 39;
pub const SYS_rmdir: ::c_long = 40;
pub const SYS_dup: ::c_long = 41;
pub const SYS_pipe: ::c_long = 42;
pub const SYS_times: ::c_long = 43;
pub const SYS_brk: ::c_long = 45;
pub const SYS_setgid16: ::c_long = 46;
pub const SYS_getgid16: ::c_long = 47;
pub const SYS_signal: ::c_long = 48;
pub const SYS_geteuid16: ::c_long = 49;
pub const SYS_getegid16: ::c_long = 50;
pub const SYS_acct: ::c_long = 51;
pub const SYS_umount: ::c_long = 52;
pub const SYS_ioctl: ::c_long = 54;
pub const SYS_fcntl: ::c_long = 55;
pub const SYS_setpgid: ::c_long = 57;
pub const SYS_umask: ::c_long = 60;
pub const SYS_chroot: ::c_long = 61;
pub const SYS_ustat: ::c_long = 62;
pub const SYS_dup2: ::c_long = 63;
pub const SYS_getppid: ::c_long = 64;
pub const SYS_getpgrp: ::c_long = 65;
pub const SYS_setsid: ::c_long = 66;
pub const SYS_sigaction: ::c_long = 67;
pub const SYS_sgetmask: ::c_long = 68;
pub const SYS_ssetmask: ::c_long = 69;
pub const SYS_setreuid16: ::c_long = 70;
pub const SYS_setregid16: ::c_long = 71;
pub const SYS_sigsuspend: ::c_long = 72;
pub const SYS_sigpending: ::c_long = 73;
pub const SYS_sethostname: ::c_long = 74;
pub const SYS_setrlimit: ::c_long = 75;
pub const SYS_old_getrlimit: ::c_long = 76;
pub const SYS_getrusage: ::c_long = 77;
pub const SYS_gettimeofday: ::c_long = 78;
pub const SYS_settimeofday: ::c_long = 79;
pub const SYS_getgroups16: ::c_long = 80;
pub const SYS_setgroups16: ::c_long = 81;
pub const SYS_old_select: ::c_long = 82;
pub const SYS_symlink: ::c_long = 83;
pub const SYS_lstat: ::c_long = 84;
pub const SYS_readlink: ::c_long = 85;
pub const SYS_uselib: ::c_long = 86;
pub const SYS_swapon: ::c_long = 87;
pub const SYS_reboot: ::c_long = 88;
pub const SYS_old_readdir: ::c_long = 89;
pub const SYS_old_mmap: ::c_long = 90;
pub const SYS_munmap: ::c_long = 91;
pub const SYS_truncate: ::c_long = 92;
pub const SYS_ftruncate: ::c_long = 93;
pub const SYS_fchmod: ::c_long = 94;
pub const SYS_fchown16: ::c_long = 95;
pub const SYS_getpriority: ::c_long = 96;
pub const SYS_setpriority: ::c_long = 97;
pub const SYS_statfs: ::c_long = 99;
pub const SYS_fstatfs: ::c_long = 100;
pub const SYS_socketcall: ::c_long = 102;
pub const SYS_syslog: ::c_long = 103;
pub const SYS_setitimer: ::c_long = 104;
pub const SYS_getitimer: ::c_long = 105;
pub const SYS_newstat: ::c_long = 106;
pub const SYS_newlstat: ::c_long = 107;
pub const SYS_newfstat: ::c_long = 108;
pub const SYS_vhangup: ::c_long = 111;
pub const SYS_wait4: ::c_long = 114;
pub const SYS_swapoff: ::c_long = 115;
pub const SYS_sysinfo: ::c_long = 116;
pub const SYS_ipc: ::c_long = 117;
pub const SYS_fsync: ::c_long = 118;
pub const SYS_sigreturn: ::c_long = 119;
pub const SYS_clone: ::c_long = 120;
pub const SYS_setdomainname: ::c_long = 121;
pub const SYS_newuname: ::c_long = 122;
pub const SYS_cacheflush: ::c_long = 123;
pub const SYS_adjtimex_time32: ::c_long = 124;
pub const SYS_mprotect: ::c_long = 125;
pub const SYS_sigprocmask: ::c_long = 126;
pub const SYS_create_module: ::c_long = 127;
pub const SYS_init_module: ::c_long = 128;
pub const SYS_delete_module: ::c_long = 129;
pub const SYS_get_kernel_syms: ::c_long = 130;
pub const SYS_quotactl: ::c_long = 131;
pub const SYS_getpgid: ::c_long = 132;
pub const SYS_fchdir: ::c_long = 133;
pub const SYS_bdflush: ::c_long = 134;
pub const SYS_sysfs: ::c_long = 135;
pub const SYS_personality: ::c_long = 136;
pub const SYS_setfsuid16: ::c_long = 138;
pub const SYS_setfsgid16: ::c_long = 139;
pub const SYS_llseek: ::c_long = 140;
pub const SYS_getdents: ::c_long = 141;
pub const SYS_select: ::c_long = 142;
pub const SYS_flock: ::c_long = 143;
pub const SYS_msync: ::c_long = 144;
pub const SYS_readv: ::c_long = 145;
pub const SYS_writev: ::c_long = 146;
pub const SYS_getsid: ::c_long = 147;
pub const SYS_fdatasync: ::c_long = 148;
pub const SYS__sysctl: ::c_long = 149;
pub const SYS_mlock: ::c_long = 150;
pub const SYS_munlock: ::c_long = 151;
pub const SYS_mlockall: ::c_long = 152;
pub const SYS_munlockall: ::c_long = 153;
pub const SYS_sched_setparam: ::c_long = 154;
pub const SYS_sched_getparam: ::c_long = 155;
pub const SYS_sched_setscheduler: ::c_long = 156;
pub const SYS_sched_getscheduler: ::c_long = 157;
pub const SYS_sched_yield: ::c_long = 158;
pub const SYS_sched_get_priority_max: ::c_long = 159;
pub const SYS_sched_get_priority_min: ::c_long = 160;
pub const SYS_sched_rr_get_interval_time32: ::c_long = 161;
pub const SYS_nanosleep_time32: ::c_long = 162;
pub const SYS_mremap: ::c_long = 163;
pub const SYS_setresuid16: ::c_long = 164;
pub const SYS_getresuid16: ::c_long = 165;
pub const SYS_getpagesize: ::c_long = 166;
pub const SYS_query_module: ::c_long = 167;
pub const SYS_poll: ::c_long = 168;
pub const SYS_nfsservctl: ::c_long = 169;
pub const SYS_setresgid16: ::c_long = 170;
pub const SYS_getresgid16: ::c_long = 171;
pub const SYS_prctl: ::c_long = 172;
pub const SYS_rt_sigreturn: ::c_long = 173;
pub const SYS_rt_sigaction: ::c_long = 174;
pub const SYS_rt_sigprocmask: ::c_long = 175;
pub const SYS_rt_sigpending: ::c_long = 176;
pub const SYS_rt_sigtimedwait_time32: ::c_long = 177;
pub const SYS_rt_sigqueueinfo: ::c_long = 178;
pub const SYS_rt_sigsuspend: ::c_long = 179;
pub const SYS_pread64: ::c_long = 180;
pub const SYS_pwrite64: ::c_long = 181;
pub const SYS_lchown16: ::c_long = 182;
pub const SYS_getcwd: ::c_long = 183;
pub const SYS_capget: ::c_long = 184;
pub const SYS_capset: ::c_long = 185;
pub const SYS_sigaltstack: ::c_long = 186;
pub const SYS_sendfile: ::c_long = 187;
pub const SYS_getpmsg: ::c_long = 188;
pub const SYS_putpmsg: ::c_long = 189;
pub const SYS_vfork: ::c_long = 190;
pub const SYS_getrlimit: ::c_long = 191;
pub const SYS_mmap2: ::c_long = 192;
pub const SYS_truncate64: ::c_long = 193;
pub const SYS_ftruncate64: ::c_long = 194;
pub const SYS_stat64: ::c_long = 195;
pub const SYS_lstat64: ::c_long = 196;
pub const SYS_fstat64: ::c_long = 197;
pub const SYS_chown: ::c_long = 198;
pub const SYS_getuid: ::c_long = 199;
pub const SYS_getgid: ::c_long = 200;
pub const SYS_geteuid: ::c_long = 201;
pub const SYS_getegid: ::c_long = 202;
pub const SYS_setreuid: ::c_long = 203;
pub const SYS_setregid: ::c_long = 204;
pub const SYS_getgroups: ::c_long = 205;
pub const SYS_setgroups: ::c_long = 206;
pub const SYS_fchown: ::c_long = 207;
pub const SYS_setresuid: ::c_long = 208;
pub const SYS_getresuid: ::c_long = 209;
pub const SYS_setresgid: ::c_long = 210;
pub const SYS_getresgid: ::c_long = 211;
pub const SYS_lchown: ::c_long = 212;
pub const SYS_setuid: ::c_long = 213;
pub const SYS_setgid: ::c_long = 214;
pub const SYS_setfsuid: ::c_long = 215;
pub const SYS_setfsgid: ::c_long = 216;
pub const SYS_pivot_root: ::c_long = 217;
pub const SYS_getdents64: ::c_long = 220;
pub const SYS_gettid: ::c_long = 221;
pub const SYS_tkill: ::c_long = 222;
pub const SYS_setxattr: ::c_long = 223;
pub const SYS_lsetxattr: ::c_long = 224;
pub const SYS_fsetxattr: ::c_long = 225;
pub const SYS_getxattr: ::c_long = 226;
pub const SYS_lgetxattr: ::c_long = 227;
pub const SYS_fgetxattr: ::c_long = 228;
pub const SYS_listxattr: ::c_long = 229;
pub const SYS_llistxattr: ::c_long = 230;
pub const SYS_flistxattr: ::c_long = 231;
pub const SYS_removexattr: ::c_long = 232;
pub const SYS_lremovexattr: ::c_long = 233;
pub const SYS_fremovexattr: ::c_long = 234;
pub const SYS_futex_time32: ::c_long = 235;
pub const SYS_sendfile64: ::c_long = 236;
pub const SYS_mincore: ::c_long = 237;
pub const SYS_madvise: ::c_long = 238;
pub const SYS_fcntl64: ::c_long = 239;
pub const SYS_readahead: ::c_long = 240;
pub const SYS_io_setup: ::c_long = 241;
pub const SYS_io_destroy: ::c_long = 242;
pub const SYS_io_getevents_time32: ::c_long = 243;
pub const SYS_io_submit: ::c_long = 244;
pub const SYS_io_cancel: ::c_long = 245;
pub const SYS_fadvise64: ::c_long = 246;
pub const SYS_exit_group: ::c_long = 247;
pub const SYS_lookup_dcookie: ::c_long = 248;
pub const SYS_epoll_create: ::c_long = 249;
pub const SYS_epoll_ctl: ::c_long = 250;
pub const SYS_epoll_wait: ::c_long = 251;
pub const SYS_remap_file_pages: ::c_long = 252;
pub const SYS_set_tid_address: ::c_long = 253;
pub const SYS_timer_create: ::c_long = 254;
pub const SYS_timer_settime32: ::c_long = 255;
pub const SYS_timer_gettime32: ::c_long = 256;
pub const SYS_timer_getoverrun: ::c_long = 257;
pub const SYS_timer_delete: ::c_long = 258;
pub const SYS_clock_settime32: ::c_long = 259;
pub const SYS_clock_gettime32: ::c_long = 260;
pub const SYS_clock_getres_time32: ::c_long = 261;
pub const SYS_clock_nanosleep_time32: ::c_long = 262;
pub const SYS_statfs64: ::c_long = 263;
pub const SYS_fstatfs64: ::c_long = 264;
pub const SYS_tgkill: ::c_long = 265;
pub const SYS_utimes_time32: ::c_long = 266;
pub const SYS_fadvise64_64: ::c_long = 267;
pub const SYS_mbind: ::c_long = 268;
pub const SYS_get_mempolicy: ::c_long = 269;
pub const SYS_set_mempolicy: ::c_long = 270;
pub const SYS_mq_open: ::c_long = 271;
pub const SYS_mq_unlink: ::c_long = 272;
pub const SYS_mq_timedsend_time32: ::c_long = 273;
pub const SYS_mq_timedreceive_time32: ::c_long = 274;
pub const SYS_mq_notify: ::c_long = 275;
pub const SYS_mq_getsetattr: ::c_long = 276;
pub const SYS_waitid: ::c_long = 277;
pub const SYS_add_key: ::c_long = 279;
pub const SYS_request_key: ::c_long = 280;
pub const SYS_keyctl: ::c_long = 281;
pub const SYS_ioprio_set: ::c_long = 282;
pub const SYS_ioprio_get: ::c_long = 283;
pub const SYS_inotify_init: ::c_long = 284;
pub const SYS_inotify_add_watch: ::c_long = 285;
pub const SYS_inotify_rm_watch: ::c_long = 286;
pub const SYS_migrate_pages: ::c_long = 287;
pub const SYS_openat: ::c_long = 288;
pub const SYS_mkdirat: ::c_long = 289;
pub const SYS_mknodat: ::c_long = 290;
pub const SYS_fchownat: ::c_long = 291;
pub const SYS_futimesat_time32: ::c_long = 292;
pub const SYS_fstatat64: ::c_long = 293;
pub const SYS_unlinkat: ::c_long = 294;
pub const SYS_renameat: ::c_long = 295;
pub const SYS_linkat: ::c_long = 296;
pub const SYS_symlinkat: ::c_long = 297;
pub const SYS_readlinkat: ::c_long = 298;
pub const SYS_fchmodat: ::c_long = 299;
pub const SYS_faccessat: ::c_long = 300;
pub const SYS_pselect6_time32: ::c_long = 301;
pub const SYS_ppoll_time32: ::c_long = 302;
pub const SYS_unshare: ::c_long = 303;
pub const SYS_set_robust_list: ::c_long = 304;
pub const SYS_get_robust_list: ::c_long = 305;
pub const SYS_splice: ::c_long = 306;
pub const SYS_sync_file_range: ::c_long = 307;
pub const SYS_tee: ::c_long = 308;
pub const SYS_vmsplice: ::c_long = 309;
pub const SYS_move_pages: ::c_long = 310;
pub const SYS_sched_setaffinity: ::c_long = 311;
pub const SYS_sched_getaffinity: ::c_long = 312;
pub const SYS_kexec_load: ::c_long = 313;
pub const SYS_getcpu: ::c_long = 314;
pub const SYS_epoll_pwait: ::c_long = 315;
pub const SYS_utimensat_time32: ::c_long = 316;
pub const SYS_signalfd: ::c_long = 317;
pub const SYS_timerfd_create: ::c_long = 318;
pub const SYS_eventfd: ::c_long = 319;
pub const SYS_fallocate: ::c_long = 320;
pub const SYS_timerfd_settime32: ::c_long = 321;
pub const SYS_timerfd_gettime32: ::c_long = 322;
pub const SYS_signalfd4: ::c_long = 323;
pub const SYS_eventfd2: ::c_long = 324;
pub const SYS_epoll_create1: ::c_long = 325;
pub const SYS_dup3: ::c_long = 326;
pub const SYS_pipe2: ::c_long = 327;
pub const SYS_inotify_init1: ::c_long = 328;
pub const SYS_preadv: ::c_long = 329;
pub const SYS_pwritev: ::c_long = 330;
pub const SYS_rt_tgsigqueueinfo: ::c_long = 331;
pub const SYS_perf_event_open: ::c_long = 332;
pub const SYS_get_thread_area: ::c_long = 333;
pub const SYS_set_thread_area: ::c_long = 334;
pub const SYS_atomic_cmpxchg_32: ::c_long = 335;
pub const SYS_atomic_barrier: ::c_long = 336;
pub const SYS_fanotify_init: ::c_long = 337;
pub const SYS_fanotify_mark: ::c_long = 338;
pub const SYS_prlimit64: ::c_long = 339;
pub const SYS_name_to_handle_at: ::c_long = 340;
pub const SYS_open_by_handle_at: ::c_long = 341;
pub const SYS_clock_adjtime32: ::c_long = 342;
pub const SYS_syncfs: ::c_long = 343;
pub const SYS_setns: ::c_long = 344;
pub const SYS_process_vm_readv: ::c_long = 345;
pub const SYS_process_vm_writev: ::c_long = 346;
pub const SYS_kcmp: ::c_long = 347;
pub const SYS_finit_module: ::c_long = 348;
pub const SYS_sched_setattr: ::c_long = 349;
pub const SYS_sched_getattr: ::c_long = 350;
pub const SYS_renameat2: ::c_long = 351;
pub const SYS_getrandom: ::c_long = 352;
pub const SYS_memfd_create: ::c_long = 353;
pub const SYS_bpf: ::c_long = 354;
pub const SYS_execveat: ::c_long = 355;
pub const SYS_socket: ::c_long = 356;
pub const SYS_socketpair: ::c_long = 357;
pub const SYS_bind: ::c_long = 358;
pub const SYS_connect: ::c_long = 359;
pub const SYS_listen: ::c_long = 360;
pub const SYS_accept4: ::c_long = 361;
pub const SYS_getsockopt: ::c_long = 362;
pub const SYS_setsockopt: ::c_long = 363;
pub const SYS_getsockname: ::c_long = 364;
pub const SYS_getpeername: ::c_long = 365;
pub const SYS_sendto: ::c_long = 366;
pub const SYS_sendmsg: ::c_long = 367;
pub const SYS_recvfrom: ::c_long = 368;
pub const SYS_recvmsg: ::c_long = 369;
pub const SYS_shutdown: ::c_long = 370;
pub const SYS_recvmmsg_time32: ::c_long = 371;
pub const SYS_sendmmsg: ::c_long = 372;
pub const SYS_userfaultfd: ::c_long = 373;
pub const SYS_membarrier: ::c_long = 374;
pub const SYS_mlock2: ::c_long = 375;
pub const SYS_copy_file_range: ::c_long = 376;
pub const SYS_preadv2: ::c_long = 377;
pub const SYS_pwritev2: ::c_long = 378;
pub const SYS_statx: ::c_long = 379;
pub const SYS_seccomp: ::c_long = 380;
pub const SYS_pkey_mprotect: ::c_long = 381;
pub const SYS_pkey_alloc: ::c_long = 382;
pub const SYS_pkey_free: ::c_long = 383;
pub const SYS_rseq: ::c_long = 384;
pub const SYS_semget: ::c_long = 393;
pub const SYS_semctl: ::c_long = 394;
pub const SYS_shmget: ::c_long = 395;
pub const SYS_shmctl: ::c_long = 396;
pub const SYS_shmat: ::c_long = 397;
pub const SYS_shmdt: ::c_long = 398;
pub const SYS_msgget: ::c_long = 399;
pub const SYS_msgsnd: ::c_long = 400;
pub const SYS_msgrcv: ::c_long = 401;
pub const SYS_msgctl: ::c_long = 402;
pub const SYS_clock_gettime: ::c_long = 403;
pub const SYS_clock_settime: ::c_long = 404;
pub const SYS_clock_adjtime: ::c_long = 405;
pub const SYS_clock_getres: ::c_long = 406;
pub const SYS_clock_nanosleep: ::c_long = 407;
pub const SYS_timer_gettime: ::c_long = 408;
pub const SYS_timer_settime: ::c_long = 409;
pub const SYS_timerfd_gettime: ::c_long = 410;
pub const SYS_timerfd_settime: ::c_long = 411;
pub const SYS_utimensat: ::c_long = 412;
pub const SYS_pselect6: ::c_long = 413;
pub const SYS_ppoll: ::c_long = 414;
pub const SYS_io_pgetevents: ::c_long = 416;
pub const SYS_recvmmsg: ::c_long = 417;
pub const SYS_mq_timedsend: ::c_long = 418;
pub const SYS_mq_timedreceive: ::c_long = 419;
pub const SYS_semtimedop: ::c_long = 420;
pub const SYS_rt_sigtimedwait: ::c_long = 421;
pub const SYS_futex: ::c_long = 422;
pub const SYS_sched_rr_get_interval: ::c_long = 423;
pub const SYS_pidfd_send_signal: ::c_long = 424;
pub const SYS_io_uring_setup: ::c_long = 425;
pub const SYS_io_uring_enter: ::c_long = 426;
pub const SYS_io_uring_register: ::c_long = 427;
pub const SYS_open_tree: ::c_long = 428;
pub const SYS_move_mount: ::c_long = 429;
pub const SYS_fsopen: ::c_long = 430;
pub const SYS_fsconfig: ::c_long = 431;
pub const SYS_fsmount: ::c_long = 432;
pub const SYS_fspick: ::c_long = 433;
pub const SYS_pidfd_open: ::c_long = 434;
pub const SYS_clone3: ::c_long = 435;
pub const SYS_close_range: ::c_long = 436;
pub const SYS_openat2: ::c_long = 437;
pub const SYS_pidfd_getfd: ::c_long = 438;
pub const SYS_faccessat2: ::c_long = 439;
pub const SYS_process_madvise: ::c_long = 440;
pub const SYS_epoll_pwait2: ::c_long = 441;
pub const SYS_mount_setattr: ::c_long = 442;
pub const SYS_quotactl_fd: ::c_long = 443;
pub const SYS_landlock_create_ruleset: ::c_long = 444;
pub const SYS_landlock_add_rule: ::c_long = 445;
pub const SYS_landlock_restrict_self: ::c_long = 446;
pub const SYS_process_mrelease: ::c_long = 448;
pub const SYS_futex_waitv: ::c_long = 449;
pub const SYS_set_mempolicy_home_node: ::c_long = 450;

View file

@ -0,0 +1,7 @@
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(8))]
pub struct max_align_t {
priv_: [f32; 4]
}
}

View file

@ -0,0 +1,819 @@
pub type c_char = i8;
pub type wchar_t = i32;
s! {
pub struct stat64 {
pub st_dev: ::c_ulong,
st_pad1: [::c_long; 3],
pub st_ino: ::ino64_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::c_ulong,
st_pad2: [::c_long; 2],
pub st_size: ::off64_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_blksize: ::blksize_t,
st_pad3: ::c_long,
pub st_blocks: ::blkcnt64_t,
st_pad5: [::c_long; 14],
}
pub struct statfs {
pub f_type: ::c_long,
pub f_bsize: ::c_long,
pub f_frsize: ::c_long,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_files: ::fsblkcnt_t,
pub f_ffree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_long,
f_spare: [::c_long; 6],
}
pub struct statfs64 {
pub f_type: ::c_long,
pub f_bsize: ::c_long,
pub f_frsize: ::c_long,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_bavail: u64,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_long,
pub f_flags: ::c_long,
pub f_spare: [::c_long; 5],
}
pub struct statvfs64 {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_favail: u64,
pub f_fsid: ::c_ulong,
__f_unused: ::c_int,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
pub struct sigaction {
pub sa_flags: ::c_int,
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_restorer: ::Option<extern fn()>,
_resv: [::c_int; 1],
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_size: ::size_t,
pub ss_flags: ::c_int,
}
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_code: ::c_int,
pub si_errno: ::c_int,
pub _pad: [::c_int; 29],
}
pub struct ipc_perm {
pub __key: ::key_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::c_uint,
pub __seq: ::c_ushort,
__pad1: ::c_ushort,
__unused1: ::c_ulong,
__unused2: ::c_ulong
}
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
pub shm_cpid: ::pid_t,
pub shm_lpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
__unused4: ::c_ulong,
__unused5: ::c_ulong
}
pub struct msqid_ds {
pub msg_perm: ::ipc_perm,
#[cfg(target_endian = "big")]
__glibc_reserved1: ::c_ulong,
pub msg_stime: ::time_t,
#[cfg(target_endian = "little")]
__glibc_reserved1: ::c_ulong,
#[cfg(target_endian = "big")]
__glibc_reserved2: ::c_ulong,
pub msg_rtime: ::time_t,
#[cfg(target_endian = "little")]
__glibc_reserved2: ::c_ulong,
#[cfg(target_endian = "big")]
__glibc_reserved3: ::c_ulong,
pub msg_ctime: ::time_t,
#[cfg(target_endian = "little")]
__glibc_reserved3: ::c_ulong,
__msg_cbytes: ::c_ulong,
pub msg_qnum: ::msgqnum_t,
pub msg_qbytes: ::msglen_t,
pub msg_lspid: ::pid_t,
pub msg_lrpid: ::pid_t,
__glibc_reserved4: ::c_ulong,
__glibc_reserved5: ::c_ulong,
}
pub struct flock {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off_t,
pub l_len: ::off_t,
pub l_sysid: ::c_long,
pub l_pid: ::pid_t,
pad: [::c_long; 4],
}
}
pub const O_LARGEFILE: ::c_int = 0x2000;
pub const SYS_syscall: ::c_long = 4000 + 0;
pub const SYS_exit: ::c_long = 4000 + 1;
pub const SYS_fork: ::c_long = 4000 + 2;
pub const SYS_read: ::c_long = 4000 + 3;
pub const SYS_write: ::c_long = 4000 + 4;
pub const SYS_open: ::c_long = 4000 + 5;
pub const SYS_close: ::c_long = 4000 + 6;
pub const SYS_waitpid: ::c_long = 4000 + 7;
pub const SYS_creat: ::c_long = 4000 + 8;
pub const SYS_link: ::c_long = 4000 + 9;
pub const SYS_unlink: ::c_long = 4000 + 10;
pub const SYS_execve: ::c_long = 4000 + 11;
pub const SYS_chdir: ::c_long = 4000 + 12;
pub const SYS_time: ::c_long = 4000 + 13;
pub const SYS_mknod: ::c_long = 4000 + 14;
pub const SYS_chmod: ::c_long = 4000 + 15;
pub const SYS_lchown: ::c_long = 4000 + 16;
pub const SYS_break: ::c_long = 4000 + 17;
pub const SYS_lseek: ::c_long = 4000 + 19;
pub const SYS_getpid: ::c_long = 4000 + 20;
pub const SYS_mount: ::c_long = 4000 + 21;
pub const SYS_umount: ::c_long = 4000 + 22;
pub const SYS_setuid: ::c_long = 4000 + 23;
pub const SYS_getuid: ::c_long = 4000 + 24;
pub const SYS_stime: ::c_long = 4000 + 25;
pub const SYS_ptrace: ::c_long = 4000 + 26;
pub const SYS_alarm: ::c_long = 4000 + 27;
pub const SYS_pause: ::c_long = 4000 + 29;
pub const SYS_utime: ::c_long = 4000 + 30;
pub const SYS_stty: ::c_long = 4000 + 31;
pub const SYS_gtty: ::c_long = 4000 + 32;
pub const SYS_access: ::c_long = 4000 + 33;
pub const SYS_nice: ::c_long = 4000 + 34;
pub const SYS_ftime: ::c_long = 4000 + 35;
pub const SYS_sync: ::c_long = 4000 + 36;
pub const SYS_kill: ::c_long = 4000 + 37;
pub const SYS_rename: ::c_long = 4000 + 38;
pub const SYS_mkdir: ::c_long = 4000 + 39;
pub const SYS_rmdir: ::c_long = 4000 + 40;
pub const SYS_dup: ::c_long = 4000 + 41;
pub const SYS_pipe: ::c_long = 4000 + 42;
pub const SYS_times: ::c_long = 4000 + 43;
pub const SYS_prof: ::c_long = 4000 + 44;
pub const SYS_brk: ::c_long = 4000 + 45;
pub const SYS_setgid: ::c_long = 4000 + 46;
pub const SYS_getgid: ::c_long = 4000 + 47;
pub const SYS_signal: ::c_long = 4000 + 48;
pub const SYS_geteuid: ::c_long = 4000 + 49;
pub const SYS_getegid: ::c_long = 4000 + 50;
pub const SYS_acct: ::c_long = 4000 + 51;
pub const SYS_umount2: ::c_long = 4000 + 52;
pub const SYS_lock: ::c_long = 4000 + 53;
pub const SYS_ioctl: ::c_long = 4000 + 54;
pub const SYS_fcntl: ::c_long = 4000 + 55;
pub const SYS_mpx: ::c_long = 4000 + 56;
pub const SYS_setpgid: ::c_long = 4000 + 57;
pub const SYS_ulimit: ::c_long = 4000 + 58;
pub const SYS_umask: ::c_long = 4000 + 60;
pub const SYS_chroot: ::c_long = 4000 + 61;
pub const SYS_ustat: ::c_long = 4000 + 62;
pub const SYS_dup2: ::c_long = 4000 + 63;
pub const SYS_getppid: ::c_long = 4000 + 64;
pub const SYS_getpgrp: ::c_long = 4000 + 65;
pub const SYS_setsid: ::c_long = 4000 + 66;
pub const SYS_sigaction: ::c_long = 4000 + 67;
pub const SYS_sgetmask: ::c_long = 4000 + 68;
pub const SYS_ssetmask: ::c_long = 4000 + 69;
pub const SYS_setreuid: ::c_long = 4000 + 70;
pub const SYS_setregid: ::c_long = 4000 + 71;
pub const SYS_sigsuspend: ::c_long = 4000 + 72;
pub const SYS_sigpending: ::c_long = 4000 + 73;
pub const SYS_sethostname: ::c_long = 4000 + 74;
pub const SYS_setrlimit: ::c_long = 4000 + 75;
pub const SYS_getrlimit: ::c_long = 4000 + 76;
pub const SYS_getrusage: ::c_long = 4000 + 77;
pub const SYS_gettimeofday: ::c_long = 4000 + 78;
pub const SYS_settimeofday: ::c_long = 4000 + 79;
pub const SYS_getgroups: ::c_long = 4000 + 80;
pub const SYS_setgroups: ::c_long = 4000 + 81;
pub const SYS_symlink: ::c_long = 4000 + 83;
pub const SYS_readlink: ::c_long = 4000 + 85;
pub const SYS_uselib: ::c_long = 4000 + 86;
pub const SYS_swapon: ::c_long = 4000 + 87;
pub const SYS_reboot: ::c_long = 4000 + 88;
pub const SYS_readdir: ::c_long = 4000 + 89;
pub const SYS_mmap: ::c_long = 4000 + 90;
pub const SYS_munmap: ::c_long = 4000 + 91;
pub const SYS_truncate: ::c_long = 4000 + 92;
pub const SYS_ftruncate: ::c_long = 4000 + 93;
pub const SYS_fchmod: ::c_long = 4000 + 94;
pub const SYS_fchown: ::c_long = 4000 + 95;
pub const SYS_getpriority: ::c_long = 4000 + 96;
pub const SYS_setpriority: ::c_long = 4000 + 97;
pub const SYS_profil: ::c_long = 4000 + 98;
pub const SYS_statfs: ::c_long = 4000 + 99;
pub const SYS_fstatfs: ::c_long = 4000 + 100;
pub const SYS_ioperm: ::c_long = 4000 + 101;
pub const SYS_socketcall: ::c_long = 4000 + 102;
pub const SYS_syslog: ::c_long = 4000 + 103;
pub const SYS_setitimer: ::c_long = 4000 + 104;
pub const SYS_getitimer: ::c_long = 4000 + 105;
pub const SYS_stat: ::c_long = 4000 + 106;
pub const SYS_lstat: ::c_long = 4000 + 107;
pub const SYS_fstat: ::c_long = 4000 + 108;
pub const SYS_iopl: ::c_long = 4000 + 110;
pub const SYS_vhangup: ::c_long = 4000 + 111;
pub const SYS_idle: ::c_long = 4000 + 112;
pub const SYS_vm86: ::c_long = 4000 + 113;
pub const SYS_wait4: ::c_long = 4000 + 114;
pub const SYS_swapoff: ::c_long = 4000 + 115;
pub const SYS_sysinfo: ::c_long = 4000 + 116;
pub const SYS_ipc: ::c_long = 4000 + 117;
pub const SYS_fsync: ::c_long = 4000 + 118;
pub const SYS_sigreturn: ::c_long = 4000 + 119;
pub const SYS_clone: ::c_long = 4000 + 120;
pub const SYS_setdomainname: ::c_long = 4000 + 121;
pub const SYS_uname: ::c_long = 4000 + 122;
pub const SYS_modify_ldt: ::c_long = 4000 + 123;
pub const SYS_adjtimex: ::c_long = 4000 + 124;
pub const SYS_mprotect: ::c_long = 4000 + 125;
pub const SYS_sigprocmask: ::c_long = 4000 + 126;
pub const SYS_create_module: ::c_long = 4000 + 127;
pub const SYS_init_module: ::c_long = 4000 + 128;
pub const SYS_delete_module: ::c_long = 4000 + 129;
pub const SYS_get_kernel_syms: ::c_long = 4000 + 130;
pub const SYS_quotactl: ::c_long = 4000 + 131;
pub const SYS_getpgid: ::c_long = 4000 + 132;
pub const SYS_fchdir: ::c_long = 4000 + 133;
pub const SYS_bdflush: ::c_long = 4000 + 134;
pub const SYS_sysfs: ::c_long = 4000 + 135;
pub const SYS_personality: ::c_long = 4000 + 136;
pub const SYS_afs_syscall: ::c_long = 4000 + 137;
pub const SYS_setfsuid: ::c_long = 4000 + 138;
pub const SYS_setfsgid: ::c_long = 4000 + 139;
pub const SYS__llseek: ::c_long = 4000 + 140;
pub const SYS_getdents: ::c_long = 4000 + 141;
pub const SYS__newselect: ::c_long = 4000 + 142;
pub const SYS_flock: ::c_long = 4000 + 143;
pub const SYS_msync: ::c_long = 4000 + 144;
pub const SYS_readv: ::c_long = 4000 + 145;
pub const SYS_writev: ::c_long = 4000 + 146;
pub const SYS_cacheflush: ::c_long = 4000 + 147;
pub const SYS_cachectl: ::c_long = 4000 + 148;
pub const SYS_sysmips: ::c_long = 4000 + 149;
pub const SYS_getsid: ::c_long = 4000 + 151;
pub const SYS_fdatasync: ::c_long = 4000 + 152;
pub const SYS__sysctl: ::c_long = 4000 + 153;
pub const SYS_mlock: ::c_long = 4000 + 154;
pub const SYS_munlock: ::c_long = 4000 + 155;
pub const SYS_mlockall: ::c_long = 4000 + 156;
pub const SYS_munlockall: ::c_long = 4000 + 157;
pub const SYS_sched_setparam: ::c_long = 4000 + 158;
pub const SYS_sched_getparam: ::c_long = 4000 + 159;
pub const SYS_sched_setscheduler: ::c_long = 4000 + 160;
pub const SYS_sched_getscheduler: ::c_long = 4000 + 161;
pub const SYS_sched_yield: ::c_long = 4000 + 162;
pub const SYS_sched_get_priority_max: ::c_long = 4000 + 163;
pub const SYS_sched_get_priority_min: ::c_long = 4000 + 164;
pub const SYS_sched_rr_get_interval: ::c_long = 4000 + 165;
pub const SYS_nanosleep: ::c_long = 4000 + 166;
pub const SYS_mremap: ::c_long = 4000 + 167;
pub const SYS_accept: ::c_long = 4000 + 168;
pub const SYS_bind: ::c_long = 4000 + 169;
pub const SYS_connect: ::c_long = 4000 + 170;
pub const SYS_getpeername: ::c_long = 4000 + 171;
pub const SYS_getsockname: ::c_long = 4000 + 172;
pub const SYS_getsockopt: ::c_long = 4000 + 173;
pub const SYS_listen: ::c_long = 4000 + 174;
pub const SYS_recv: ::c_long = 4000 + 175;
pub const SYS_recvfrom: ::c_long = 4000 + 176;
pub const SYS_recvmsg: ::c_long = 4000 + 177;
pub const SYS_send: ::c_long = 4000 + 178;
pub const SYS_sendmsg: ::c_long = 4000 + 179;
pub const SYS_sendto: ::c_long = 4000 + 180;
pub const SYS_setsockopt: ::c_long = 4000 + 181;
pub const SYS_shutdown: ::c_long = 4000 + 182;
pub const SYS_socket: ::c_long = 4000 + 183;
pub const SYS_socketpair: ::c_long = 4000 + 184;
pub const SYS_setresuid: ::c_long = 4000 + 185;
pub const SYS_getresuid: ::c_long = 4000 + 186;
pub const SYS_query_module: ::c_long = 4000 + 187;
pub const SYS_poll: ::c_long = 4000 + 188;
pub const SYS_nfsservctl: ::c_long = 4000 + 189;
pub const SYS_setresgid: ::c_long = 4000 + 190;
pub const SYS_getresgid: ::c_long = 4000 + 191;
pub const SYS_prctl: ::c_long = 4000 + 192;
pub const SYS_rt_sigreturn: ::c_long = 4000 + 193;
pub const SYS_rt_sigaction: ::c_long = 4000 + 194;
pub const SYS_rt_sigprocmask: ::c_long = 4000 + 195;
pub const SYS_rt_sigpending: ::c_long = 4000 + 196;
pub const SYS_rt_sigtimedwait: ::c_long = 4000 + 197;
pub const SYS_rt_sigqueueinfo: ::c_long = 4000 + 198;
pub const SYS_rt_sigsuspend: ::c_long = 4000 + 199;
pub const SYS_pread64: ::c_long = 4000 + 200;
pub const SYS_pwrite64: ::c_long = 4000 + 201;
pub const SYS_chown: ::c_long = 4000 + 202;
pub const SYS_getcwd: ::c_long = 4000 + 203;
pub const SYS_capget: ::c_long = 4000 + 204;
pub const SYS_capset: ::c_long = 4000 + 205;
pub const SYS_sigaltstack: ::c_long = 4000 + 206;
pub const SYS_sendfile: ::c_long = 4000 + 207;
pub const SYS_getpmsg: ::c_long = 4000 + 208;
pub const SYS_putpmsg: ::c_long = 4000 + 209;
pub const SYS_mmap2: ::c_long = 4000 + 210;
pub const SYS_truncate64: ::c_long = 4000 + 211;
pub const SYS_ftruncate64: ::c_long = 4000 + 212;
pub const SYS_stat64: ::c_long = 4000 + 213;
pub const SYS_lstat64: ::c_long = 4000 + 214;
pub const SYS_fstat64: ::c_long = 4000 + 215;
pub const SYS_pivot_root: ::c_long = 4000 + 216;
pub const SYS_mincore: ::c_long = 4000 + 217;
pub const SYS_madvise: ::c_long = 4000 + 218;
pub const SYS_getdents64: ::c_long = 4000 + 219;
pub const SYS_fcntl64: ::c_long = 4000 + 220;
pub const SYS_gettid: ::c_long = 4000 + 222;
pub const SYS_readahead: ::c_long = 4000 + 223;
pub const SYS_setxattr: ::c_long = 4000 + 224;
pub const SYS_lsetxattr: ::c_long = 4000 + 225;
pub const SYS_fsetxattr: ::c_long = 4000 + 226;
pub const SYS_getxattr: ::c_long = 4000 + 227;
pub const SYS_lgetxattr: ::c_long = 4000 + 228;
pub const SYS_fgetxattr: ::c_long = 4000 + 229;
pub const SYS_listxattr: ::c_long = 4000 + 230;
pub const SYS_llistxattr: ::c_long = 4000 + 231;
pub const SYS_flistxattr: ::c_long = 4000 + 232;
pub const SYS_removexattr: ::c_long = 4000 + 233;
pub const SYS_lremovexattr: ::c_long = 4000 + 234;
pub const SYS_fremovexattr: ::c_long = 4000 + 235;
pub const SYS_tkill: ::c_long = 4000 + 236;
pub const SYS_sendfile64: ::c_long = 4000 + 237;
pub const SYS_futex: ::c_long = 4000 + 238;
pub const SYS_sched_setaffinity: ::c_long = 4000 + 239;
pub const SYS_sched_getaffinity: ::c_long = 4000 + 240;
pub const SYS_io_setup: ::c_long = 4000 + 241;
pub const SYS_io_destroy: ::c_long = 4000 + 242;
pub const SYS_io_getevents: ::c_long = 4000 + 243;
pub const SYS_io_submit: ::c_long = 4000 + 244;
pub const SYS_io_cancel: ::c_long = 4000 + 245;
pub const SYS_exit_group: ::c_long = 4000 + 246;
pub const SYS_lookup_dcookie: ::c_long = 4000 + 247;
pub const SYS_epoll_create: ::c_long = 4000 + 248;
pub const SYS_epoll_ctl: ::c_long = 4000 + 249;
pub const SYS_epoll_wait: ::c_long = 4000 + 250;
pub const SYS_remap_file_pages: ::c_long = 4000 + 251;
pub const SYS_set_tid_address: ::c_long = 4000 + 252;
pub const SYS_restart_syscall: ::c_long = 4000 + 253;
pub const SYS_fadvise64: ::c_long = 4000 + 254;
pub const SYS_statfs64: ::c_long = 4000 + 255;
pub const SYS_fstatfs64: ::c_long = 4000 + 256;
pub const SYS_timer_create: ::c_long = 4000 + 257;
pub const SYS_timer_settime: ::c_long = 4000 + 258;
pub const SYS_timer_gettime: ::c_long = 4000 + 259;
pub const SYS_timer_getoverrun: ::c_long = 4000 + 260;
pub const SYS_timer_delete: ::c_long = 4000 + 261;
pub const SYS_clock_settime: ::c_long = 4000 + 262;
pub const SYS_clock_gettime: ::c_long = 4000 + 263;
pub const SYS_clock_getres: ::c_long = 4000 + 264;
pub const SYS_clock_nanosleep: ::c_long = 4000 + 265;
pub const SYS_tgkill: ::c_long = 4000 + 266;
pub const SYS_utimes: ::c_long = 4000 + 267;
pub const SYS_mbind: ::c_long = 4000 + 268;
pub const SYS_get_mempolicy: ::c_long = 4000 + 269;
pub const SYS_set_mempolicy: ::c_long = 4000 + 270;
pub const SYS_mq_open: ::c_long = 4000 + 271;
pub const SYS_mq_unlink: ::c_long = 4000 + 272;
pub const SYS_mq_timedsend: ::c_long = 4000 + 273;
pub const SYS_mq_timedreceive: ::c_long = 4000 + 274;
pub const SYS_mq_notify: ::c_long = 4000 + 275;
pub const SYS_mq_getsetattr: ::c_long = 4000 + 276;
pub const SYS_vserver: ::c_long = 4000 + 277;
pub const SYS_waitid: ::c_long = 4000 + 278;
/* pub const SYS_sys_setaltroot: ::c_long = 4000 + 279; */
pub const SYS_add_key: ::c_long = 4000 + 280;
pub const SYS_request_key: ::c_long = 4000 + 281;
pub const SYS_keyctl: ::c_long = 4000 + 282;
pub const SYS_set_thread_area: ::c_long = 4000 + 283;
pub const SYS_inotify_init: ::c_long = 4000 + 284;
pub const SYS_inotify_add_watch: ::c_long = 4000 + 285;
pub const SYS_inotify_rm_watch: ::c_long = 4000 + 286;
pub const SYS_migrate_pages: ::c_long = 4000 + 287;
pub const SYS_openat: ::c_long = 4000 + 288;
pub const SYS_mkdirat: ::c_long = 4000 + 289;
pub const SYS_mknodat: ::c_long = 4000 + 290;
pub const SYS_fchownat: ::c_long = 4000 + 291;
pub const SYS_futimesat: ::c_long = 4000 + 292;
pub const SYS_fstatat64: ::c_long = 4000 + 293;
pub const SYS_unlinkat: ::c_long = 4000 + 294;
pub const SYS_renameat: ::c_long = 4000 + 295;
pub const SYS_linkat: ::c_long = 4000 + 296;
pub const SYS_symlinkat: ::c_long = 4000 + 297;
pub const SYS_readlinkat: ::c_long = 4000 + 298;
pub const SYS_fchmodat: ::c_long = 4000 + 299;
pub const SYS_faccessat: ::c_long = 4000 + 300;
pub const SYS_pselect6: ::c_long = 4000 + 301;
pub const SYS_ppoll: ::c_long = 4000 + 302;
pub const SYS_unshare: ::c_long = 4000 + 303;
pub const SYS_splice: ::c_long = 4000 + 304;
pub const SYS_sync_file_range: ::c_long = 4000 + 305;
pub const SYS_tee: ::c_long = 4000 + 306;
pub const SYS_vmsplice: ::c_long = 4000 + 307;
pub const SYS_move_pages: ::c_long = 4000 + 308;
pub const SYS_set_robust_list: ::c_long = 4000 + 309;
pub const SYS_get_robust_list: ::c_long = 4000 + 310;
pub const SYS_kexec_load: ::c_long = 4000 + 311;
pub const SYS_getcpu: ::c_long = 4000 + 312;
pub const SYS_epoll_pwait: ::c_long = 4000 + 313;
pub const SYS_ioprio_set: ::c_long = 4000 + 314;
pub const SYS_ioprio_get: ::c_long = 4000 + 315;
pub const SYS_utimensat: ::c_long = 4000 + 316;
pub const SYS_signalfd: ::c_long = 4000 + 317;
pub const SYS_timerfd: ::c_long = 4000 + 318;
pub const SYS_eventfd: ::c_long = 4000 + 319;
pub const SYS_fallocate: ::c_long = 4000 + 320;
pub const SYS_timerfd_create: ::c_long = 4000 + 321;
pub const SYS_timerfd_gettime: ::c_long = 4000 + 322;
pub const SYS_timerfd_settime: ::c_long = 4000 + 323;
pub const SYS_signalfd4: ::c_long = 4000 + 324;
pub const SYS_eventfd2: ::c_long = 4000 + 325;
pub const SYS_epoll_create1: ::c_long = 4000 + 326;
pub const SYS_dup3: ::c_long = 4000 + 327;
pub const SYS_pipe2: ::c_long = 4000 + 328;
pub const SYS_inotify_init1: ::c_long = 4000 + 329;
pub const SYS_preadv: ::c_long = 4000 + 330;
pub const SYS_pwritev: ::c_long = 4000 + 331;
pub const SYS_rt_tgsigqueueinfo: ::c_long = 4000 + 332;
pub const SYS_perf_event_open: ::c_long = 4000 + 333;
pub const SYS_accept4: ::c_long = 4000 + 334;
pub const SYS_recvmmsg: ::c_long = 4000 + 335;
pub const SYS_fanotify_init: ::c_long = 4000 + 336;
pub const SYS_fanotify_mark: ::c_long = 4000 + 337;
pub const SYS_prlimit64: ::c_long = 4000 + 338;
pub const SYS_name_to_handle_at: ::c_long = 4000 + 339;
pub const SYS_open_by_handle_at: ::c_long = 4000 + 340;
pub const SYS_clock_adjtime: ::c_long = 4000 + 341;
pub const SYS_syncfs: ::c_long = 4000 + 342;
pub const SYS_sendmmsg: ::c_long = 4000 + 343;
pub const SYS_setns: ::c_long = 4000 + 344;
pub const SYS_process_vm_readv: ::c_long = 4000 + 345;
pub const SYS_process_vm_writev: ::c_long = 4000 + 346;
pub const SYS_kcmp: ::c_long = 4000 + 347;
pub const SYS_finit_module: ::c_long = 4000 + 348;
pub const SYS_sched_setattr: ::c_long = 4000 + 349;
pub const SYS_sched_getattr: ::c_long = 4000 + 350;
pub const SYS_renameat2: ::c_long = 4000 + 351;
pub const SYS_seccomp: ::c_long = 4000 + 352;
pub const SYS_getrandom: ::c_long = 4000 + 353;
pub const SYS_memfd_create: ::c_long = 4000 + 354;
pub const SYS_bpf: ::c_long = 4000 + 355;
pub const SYS_execveat: ::c_long = 4000 + 356;
pub const SYS_userfaultfd: ::c_long = 4000 + 357;
pub const SYS_membarrier: ::c_long = 4000 + 358;
pub const SYS_mlock2: ::c_long = 4000 + 359;
pub const SYS_copy_file_range: ::c_long = 4000 + 360;
pub const SYS_preadv2: ::c_long = 4000 + 361;
pub const SYS_pwritev2: ::c_long = 4000 + 362;
pub const SYS_pkey_mprotect: ::c_long = 4000 + 363;
pub const SYS_pkey_alloc: ::c_long = 4000 + 364;
pub const SYS_pkey_free: ::c_long = 4000 + 365;
pub const SYS_statx: ::c_long = 4000 + 366;
pub const SYS_rseq: ::c_long = 4000 + 367;
pub const SYS_pidfd_send_signal: ::c_long = 4000 + 424;
pub const SYS_io_uring_setup: ::c_long = 4000 + 425;
pub const SYS_io_uring_enter: ::c_long = 4000 + 426;
pub const SYS_io_uring_register: ::c_long = 4000 + 427;
pub const SYS_open_tree: ::c_long = 4000 + 428;
pub const SYS_move_mount: ::c_long = 4000 + 429;
pub const SYS_fsopen: ::c_long = 4000 + 430;
pub const SYS_fsconfig: ::c_long = 4000 + 431;
pub const SYS_fsmount: ::c_long = 4000 + 432;
pub const SYS_fspick: ::c_long = 4000 + 433;
pub const SYS_pidfd_open: ::c_long = 4000 + 434;
pub const SYS_clone3: ::c_long = 4000 + 435;
pub const SYS_close_range: ::c_long = 4000 + 436;
pub const SYS_openat2: ::c_long = 4000 + 437;
pub const SYS_pidfd_getfd: ::c_long = 4000 + 438;
pub const SYS_faccessat2: ::c_long = 4000 + 439;
pub const SYS_process_madvise: ::c_long = 4000 + 440;
pub const SYS_epoll_pwait2: ::c_long = 4000 + 441;
pub const SYS_mount_setattr: ::c_long = 4000 + 442;
pub const SYS_quotactl_fd: ::c_long = 4000 + 443;
pub const SYS_landlock_create_ruleset: ::c_long = 4000 + 444;
pub const SYS_landlock_add_rule: ::c_long = 4000 + 445;
pub const SYS_landlock_restrict_self: ::c_long = 4000 + 446;
pub const SYS_memfd_secret: ::c_long = 4000 + 447;
pub const SYS_process_mrelease: ::c_long = 4000 + 448;
pub const SYS_futex_waitv: ::c_long = 4000 + 449;
pub const SYS_set_mempolicy_home_node: ::c_long = 4000 + 450;
pub const O_DIRECT: ::c_int = 0x8000;
pub const O_DIRECTORY: ::c_int = 0x10000;
pub const O_NOFOLLOW: ::c_int = 0x20000;
pub const O_APPEND: ::c_int = 8;
pub const O_CREAT: ::c_int = 256;
pub const O_EXCL: ::c_int = 1024;
pub const O_NOCTTY: ::c_int = 2048;
pub const O_NONBLOCK: ::c_int = 128;
pub const O_SYNC: ::c_int = 0x4010;
pub const O_RSYNC: ::c_int = 0x4010;
pub const O_DSYNC: ::c_int = 0x10;
pub const O_FSYNC: ::c_int = 0x4010;
pub const O_ASYNC: ::c_int = 0x1000;
pub const O_NDELAY: ::c_int = 0x80;
pub const EDEADLK: ::c_int = 45;
pub const ENAMETOOLONG: ::c_int = 78;
pub const ENOLCK: ::c_int = 46;
pub const ENOSYS: ::c_int = 89;
pub const ENOTEMPTY: ::c_int = 93;
pub const ELOOP: ::c_int = 90;
pub const ENOMSG: ::c_int = 35;
pub const EIDRM: ::c_int = 36;
pub const ECHRNG: ::c_int = 37;
pub const EL2NSYNC: ::c_int = 38;
pub const EL3HLT: ::c_int = 39;
pub const EL3RST: ::c_int = 40;
pub const ELNRNG: ::c_int = 41;
pub const EUNATCH: ::c_int = 42;
pub const ENOCSI: ::c_int = 43;
pub const EL2HLT: ::c_int = 44;
pub const EBADE: ::c_int = 50;
pub const EBADR: ::c_int = 51;
pub const EXFULL: ::c_int = 52;
pub const ENOANO: ::c_int = 53;
pub const EBADRQC: ::c_int = 54;
pub const EBADSLT: ::c_int = 55;
pub const EDEADLOCK: ::c_int = 56;
pub const EMULTIHOP: ::c_int = 74;
pub const EOVERFLOW: ::c_int = 79;
pub const ENOTUNIQ: ::c_int = 80;
pub const EBADFD: ::c_int = 81;
pub const EBADMSG: ::c_int = 77;
pub const EREMCHG: ::c_int = 82;
pub const ELIBACC: ::c_int = 83;
pub const ELIBBAD: ::c_int = 84;
pub const ELIBSCN: ::c_int = 85;
pub const ELIBMAX: ::c_int = 86;
pub const ELIBEXEC: ::c_int = 87;
pub const EILSEQ: ::c_int = 88;
pub const ERESTART: ::c_int = 91;
pub const ESTRPIPE: ::c_int = 92;
pub const EUSERS: ::c_int = 94;
pub const ENOTSOCK: ::c_int = 95;
pub const EDESTADDRREQ: ::c_int = 96;
pub const EMSGSIZE: ::c_int = 97;
pub const EPROTOTYPE: ::c_int = 98;
pub const ENOPROTOOPT: ::c_int = 99;
pub const EPROTONOSUPPORT: ::c_int = 120;
pub const ESOCKTNOSUPPORT: ::c_int = 121;
pub const EOPNOTSUPP: ::c_int = 122;
pub const EPFNOSUPPORT: ::c_int = 123;
pub const EAFNOSUPPORT: ::c_int = 124;
pub const EADDRINUSE: ::c_int = 125;
pub const EADDRNOTAVAIL: ::c_int = 126;
pub const ENETDOWN: ::c_int = 127;
pub const ENETUNREACH: ::c_int = 128;
pub const ENETRESET: ::c_int = 129;
pub const ECONNABORTED: ::c_int = 130;
pub const ECONNRESET: ::c_int = 131;
pub const ENOBUFS: ::c_int = 132;
pub const EISCONN: ::c_int = 133;
pub const ENOTCONN: ::c_int = 134;
pub const ESHUTDOWN: ::c_int = 143;
pub const ETOOMANYREFS: ::c_int = 144;
pub const ETIMEDOUT: ::c_int = 145;
pub const ECONNREFUSED: ::c_int = 146;
pub const EHOSTDOWN: ::c_int = 147;
pub const EHOSTUNREACH: ::c_int = 148;
pub const EALREADY: ::c_int = 149;
pub const EINPROGRESS: ::c_int = 150;
pub const ESTALE: ::c_int = 151;
pub const EUCLEAN: ::c_int = 135;
pub const ENOTNAM: ::c_int = 137;
pub const ENAVAIL: ::c_int = 138;
pub const EISNAM: ::c_int = 139;
pub const EREMOTEIO: ::c_int = 140;
pub const EDQUOT: ::c_int = 1133;
pub const ENOMEDIUM: ::c_int = 159;
pub const EMEDIUMTYPE: ::c_int = 160;
pub const ECANCELED: ::c_int = 158;
pub const ENOKEY: ::c_int = 161;
pub const EKEYEXPIRED: ::c_int = 162;
pub const EKEYREVOKED: ::c_int = 163;
pub const EKEYREJECTED: ::c_int = 164;
pub const EOWNERDEAD: ::c_int = 165;
pub const ENOTRECOVERABLE: ::c_int = 166;
pub const ERFKILL: ::c_int = 167;
pub const MAP_NORESERVE: ::c_int = 0x400;
pub const MAP_ANON: ::c_int = 0x800;
pub const MAP_ANONYMOUS: ::c_int = 0x800;
pub const MAP_GROWSDOWN: ::c_int = 0x1000;
pub const MAP_DENYWRITE: ::c_int = 0x2000;
pub const MAP_EXECUTABLE: ::c_int = 0x4000;
pub const MAP_LOCKED: ::c_int = 0x8000;
pub const MAP_POPULATE: ::c_int = 0x10000;
pub const MAP_NONBLOCK: ::c_int = 0x20000;
pub const MAP_STACK: ::c_int = 0x40000;
pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
pub const SA_SIGINFO: ::c_int = 0x00000008;
pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
pub const SIGCHLD: ::c_int = 18;
pub const SIGBUS: ::c_int = 10;
pub const SIGTTIN: ::c_int = 26;
pub const SIGTTOU: ::c_int = 27;
pub const SIGXCPU: ::c_int = 30;
pub const SIGXFSZ: ::c_int = 31;
pub const SIGVTALRM: ::c_int = 28;
pub const SIGPROF: ::c_int = 29;
pub const SIGWINCH: ::c_int = 20;
pub const SIGUSR1: ::c_int = 16;
pub const SIGUSR2: ::c_int = 17;
pub const SIGCONT: ::c_int = 25;
pub const SIGSTOP: ::c_int = 23;
pub const SIGTSTP: ::c_int = 24;
pub const SIGURG: ::c_int = 21;
pub const SIGIO: ::c_int = 22;
pub const SIGSYS: ::c_int = 12;
pub const SIGPOLL: ::c_int = 22;
pub const SIGPWR: ::c_int = 19;
pub const SIG_SETMASK: ::c_int = 3;
pub const SIG_BLOCK: ::c_int = 0x1;
pub const SIG_UNBLOCK: ::c_int = 0x2;
pub const POLLWRNORM: ::c_short = 0x004;
pub const POLLWRBAND: ::c_short = 0x100;
pub const VEOF: usize = 16;
pub const VEOL: usize = 17;
pub const VEOL2: usize = 6;
pub const VMIN: usize = 4;
pub const IEXTEN: ::tcflag_t = 0x00000100;
pub const TOSTOP: ::tcflag_t = 0x00008000;
pub const FLUSHO: ::tcflag_t = 0x00002000;
pub const EXTPROC: ::tcflag_t = 0o200000;
pub const TCSANOW: ::c_int = 0x540e;
pub const TCSADRAIN: ::c_int = 0x540f;
pub const TCSAFLUSH: ::c_int = 0x5410;
pub const PTRACE_GETFPXREGS: ::c_uint = 18;
pub const PTRACE_SETFPXREGS: ::c_uint = 19;
pub const MAP_HUGETLB: ::c_int = 0x080000;
pub const EFD_NONBLOCK: ::c_int = 0x80;
pub const F_GETLK: ::c_int = 14;
pub const F_GETOWN: ::c_int = 23;
pub const F_SETOWN: ::c_int = 24;
pub const SFD_NONBLOCK: ::c_int = 0x80;
pub const RTLD_DEEPBIND: ::c_int = 0x10;
pub const RTLD_GLOBAL: ::c_int = 0x4;
pub const RTLD_NOLOAD: ::c_int = 0x8;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const MCL_ONFAULT: ::c_int = 0x0004;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::tcflag_t = 0x00000800;
pub const TAB2: ::tcflag_t = 0x00001000;
pub const TAB3: ::tcflag_t = 0x00001800;
pub const CR1: ::tcflag_t = 0x00000200;
pub const CR2: ::tcflag_t = 0x00000400;
pub const CR3: ::tcflag_t = 0x00000600;
pub const FF1: ::tcflag_t = 0x00008000;
pub const BS1: ::tcflag_t = 0x00002000;
pub const VT1: ::tcflag_t = 0x00004000;
pub const VWERASE: usize = 14;
pub const VREPRINT: usize = 12;
pub const VSUSP: usize = 10;
pub const VSTART: usize = 8;
pub const VSTOP: usize = 9;
pub const VDISCARD: usize = 13;
pub const VTIME: usize = 5;
pub const IXON: ::tcflag_t = 0x00000400;
pub const IXOFF: ::tcflag_t = 0x00001000;
pub const ONLCR: ::tcflag_t = 0x4;
pub const CSIZE: ::tcflag_t = 0x00000030;
pub const CS6: ::tcflag_t = 0x00000010;
pub const CS7: ::tcflag_t = 0x00000020;
pub const CS8: ::tcflag_t = 0x00000030;
pub const CSTOPB: ::tcflag_t = 0x00000040;
pub const CREAD: ::tcflag_t = 0x00000080;
pub const PARENB: ::tcflag_t = 0x00000100;
pub const PARODD: ::tcflag_t = 0x00000200;
pub const HUPCL: ::tcflag_t = 0x00000400;
pub const CLOCAL: ::tcflag_t = 0x00000800;
pub const ECHOKE: ::tcflag_t = 0x00000800;
pub const ECHOE: ::tcflag_t = 0x00000010;
pub const ECHOK: ::tcflag_t = 0x00000020;
pub const ECHONL: ::tcflag_t = 0x00000040;
pub const ECHOPRT: ::tcflag_t = 0x00000400;
pub const ECHOCTL: ::tcflag_t = 0x00000200;
pub const ISIG: ::tcflag_t = 0x00000001;
pub const ICANON: ::tcflag_t = 0x00000002;
pub const PENDIN: ::tcflag_t = 0x00004000;
pub const NOFLSH: ::tcflag_t = 0x00000080;
pub const CIBAUD: ::tcflag_t = 0o02003600000;
pub const CBAUDEX: ::tcflag_t = 0o010000;
pub const VSWTC: usize = 7;
pub const OLCUC: ::tcflag_t = 0o000002;
pub const NLDLY: ::tcflag_t = 0o000400;
pub const CRDLY: ::tcflag_t = 0o003000;
pub const TABDLY: ::tcflag_t = 0o014000;
pub const BSDLY: ::tcflag_t = 0o020000;
pub const FFDLY: ::tcflag_t = 0o100000;
pub const VTDLY: ::tcflag_t = 0o040000;
pub const XTABS: ::tcflag_t = 0o014000;
pub const B0: ::speed_t = 0o000000;
pub const B50: ::speed_t = 0o000001;
pub const B75: ::speed_t = 0o000002;
pub const B110: ::speed_t = 0o000003;
pub const B134: ::speed_t = 0o000004;
pub const B150: ::speed_t = 0o000005;
pub const B200: ::speed_t = 0o000006;
pub const B300: ::speed_t = 0o000007;
pub const B600: ::speed_t = 0o000010;
pub const B1200: ::speed_t = 0o000011;
pub const B1800: ::speed_t = 0o000012;
pub const B2400: ::speed_t = 0o000013;
pub const B4800: ::speed_t = 0o000014;
pub const B9600: ::speed_t = 0o000015;
pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
pub const B460800: ::speed_t = 0o010004;
pub const B500000: ::speed_t = 0o010005;
pub const B576000: ::speed_t = 0o010006;
pub const B921600: ::speed_t = 0o010007;
pub const B1000000: ::speed_t = 0o010010;
pub const B1152000: ::speed_t = 0o010011;
pub const B1500000: ::speed_t = 0o010012;
pub const B2000000: ::speed_t = 0o010013;
pub const B2500000: ::speed_t = 0o010014;
pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
pub const EHWPOISON: ::c_int = 168;
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}

View file

@ -0,0 +1,361 @@
//! 32-bit specific definitions for linux-like values
use pthread_mutex_t;
pub type c_long = i32;
pub type c_ulong = u32;
pub type clock_t = i32;
pub type shmatt_t = ::c_ulong;
pub type msgqnum_t = ::c_ulong;
pub type msglen_t = ::c_ulong;
pub type nlink_t = u32;
pub type __u64 = ::c_ulonglong;
pub type __s64 = ::c_longlong;
pub type __fsword_t = i32;
pub type fsblkcnt64_t = u64;
pub type fsfilcnt64_t = u64;
pub type __syscall_ulong_t = ::c_ulong;
cfg_if! {
if #[cfg(target_arch = "riscv32")] {
pub type time_t = i64;
pub type suseconds_t = i64;
pub type ino_t = u64;
pub type off_t = i64;
pub type blkcnt_t = i64;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type rlim_t = u64;
pub type blksize_t = i64;
} else {
pub type time_t = i32;
pub type suseconds_t = i32;
pub type ino_t = u32;
pub type off_t = i32;
pub type blkcnt_t = i32;
pub type fsblkcnt_t = ::c_ulong;
pub type fsfilcnt_t = ::c_ulong;
pub type rlim_t = c_ulong;
pub type blksize_t = i32;
}
}
s! {
pub struct stat {
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
pub st_dev: ::dev_t,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
pub st_dev: ::c_ulong,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
__pad1: ::c_short,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
st_pad1: [::c_long; 3],
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
pub st_rdev: ::dev_t,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
pub st_rdev: ::c_ulong,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
__pad2: ::c_short,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
st_pad2: [::c_long; 2],
pub st_size: ::off_t,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
st_pad3: ::c_long,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
pub st_blksize: ::blksize_t,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
pub st_blocks: ::blkcnt_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
__unused4: ::c_long,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))]
__unused5: ::c_long,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
pub st_blksize: ::blksize_t,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
pub st_blocks: ::blkcnt_t,
#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
st_pad5: [::c_long; 14],
}
pub struct statvfs {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_favail: ::fsfilcnt_t,
pub f_fsid: ::c_ulong,
__f_unused: ::c_int,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
pub struct pthread_attr_t {
__size: [u32; 9]
}
pub struct sigset_t {
__val: [::c_ulong; 32],
}
pub struct sysinfo {
pub uptime: ::c_long,
pub loads: [::c_ulong; 3],
pub totalram: ::c_ulong,
pub freeram: ::c_ulong,
pub sharedram: ::c_ulong,
pub bufferram: ::c_ulong,
pub totalswap: ::c_ulong,
pub freeswap: ::c_ulong,
pub procs: ::c_ushort,
#[deprecated(
since = "0.2.58",
note = "This padding field might become private in the future"
)]
pub pad: ::c_ushort,
pub totalhigh: ::c_ulong,
pub freehigh: ::c_ulong,
pub mem_unit: ::c_uint,
pub _f: [::c_char; 8],
}
pub struct semid_ds {
pub sem_perm: ipc_perm,
#[cfg(target_arch = "powerpc")]
__reserved: ::__syscall_ulong_t,
pub sem_otime: ::time_t,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6", target_arch = "powerpc")))]
__reserved: ::__syscall_ulong_t,
#[cfg(target_arch = "powerpc")]
__reserved2: ::__syscall_ulong_t,
pub sem_ctime: ::time_t,
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6", target_arch = "powerpc")))]
__reserved2: ::__syscall_ulong_t,
pub sem_nsems: ::__syscall_ulong_t,
__glibc_reserved3: ::__syscall_ulong_t,
__glibc_reserved4: ::__syscall_ulong_t,
}
}
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
pub const F_OFD_GETLK: ::c_int = 36;
pub const F_OFD_SETLK: ::c_int = 37;
pub const F_OFD_SETLKW: ::c_int = 38;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
cfg_if! {
if #[cfg(target_arch = "sparc")] {
pub const O_NOATIME: ::c_int = 0x200000;
pub const O_PATH: ::c_int = 0x1000000;
pub const O_TMPFILE: ::c_int = 0x2000000 | O_DIRECTORY;
pub const SA_ONSTACK: ::c_int = 1;
pub const PTRACE_DETACH: ::c_uint = 11;
pub const F_SETLK: ::c_int = 8;
pub const F_SETLKW: ::c_int = 9;
pub const F_RDLCK: ::c_int = 1;
pub const F_WRLCK: ::c_int = 2;
pub const F_UNLCK: ::c_int = 3;
pub const SFD_CLOEXEC: ::c_int = 0x400000;
pub const NCCS: usize = 17;
pub const O_TRUNC: ::c_int = 0x400;
pub const O_CLOEXEC: ::c_int = 0x400000;
pub const EBFONT: ::c_int = 109;
pub const ENOSTR: ::c_int = 72;
pub const ENODATA: ::c_int = 111;
pub const ETIME: ::c_int = 73;
pub const ENOSR: ::c_int = 74;
pub const ENONET: ::c_int = 80;
pub const ENOPKG: ::c_int = 113;
pub const EREMOTE: ::c_int = 71;
pub const ENOLINK: ::c_int = 82;
pub const EADV: ::c_int = 83;
pub const ESRMNT: ::c_int = 84;
pub const ECOMM: ::c_int = 85;
pub const EPROTO: ::c_int = 86;
pub const EDOTDOT: ::c_int = 88;
pub const SA_NODEFER: ::c_int = 0x20;
pub const SA_RESETHAND: ::c_int = 0x4;
pub const SA_RESTART: ::c_int = 0x2;
pub const SA_NOCLDSTOP: ::c_int = 0x00000008;
pub const EPOLL_CLOEXEC: ::c_int = 0x400000;
pub const EFD_CLOEXEC: ::c_int = 0x400000;
} else {
pub const O_NOATIME: ::c_int = 0o1000000;
pub const O_PATH: ::c_int = 0o10000000;
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const PTRACE_DETACH: ::c_uint = 17;
pub const F_SETLK: ::c_int = 6;
pub const F_SETLKW: ::c_int = 7;
pub const F_RDLCK: ::c_int = 0;
pub const F_WRLCK: ::c_int = 1;
pub const F_UNLCK: ::c_int = 2;
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
pub const O_TRUNC: ::c_int = 512;
pub const O_CLOEXEC: ::c_int = 0x80000;
pub const EBFONT: ::c_int = 59;
pub const ENOSTR: ::c_int = 60;
pub const ENODATA: ::c_int = 61;
pub const ETIME: ::c_int = 62;
pub const ENOSR: ::c_int = 63;
pub const ENONET: ::c_int = 64;
pub const ENOPKG: ::c_int = 65;
pub const EREMOTE: ::c_int = 66;
pub const ENOLINK: ::c_int = 67;
pub const EADV: ::c_int = 68;
pub const ESRMNT: ::c_int = 69;
pub const ECOMM: ::c_int = 70;
pub const EPROTO: ::c_int = 71;
pub const EDOTDOT: ::c_int = 73;
pub const SA_NODEFER: ::c_int = 0x40000000;
pub const SA_RESETHAND: ::c_int = 0x80000000;
pub const SA_RESTART: ::c_int = 0x10000000;
pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
pub const EFD_CLOEXEC: ::c_int = 0x80000;
}
}
align_const! {
#[cfg(target_endian = "little")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
0, 0, 0,
],
};
}
pub const PTRACE_GETFPREGS: ::c_uint = 14;
pub const PTRACE_SETFPREGS: ::c_uint = 15;
pub const PTRACE_GETREGS: ::c_uint = 12;
pub const PTRACE_SETREGS: ::c_uint = 13;
extern "C" {
pub fn sysctl(
name: *mut ::c_int,
namelen: ::c_int,
oldp: *mut ::c_void,
oldlenp: *mut ::size_t,
newp: *mut ::c_void,
newlen: ::size_t,
) -> ::c_int;
}
cfg_if! {
if #[cfg(target_arch = "x86")] {
mod x86;
pub use self::x86::*;
} else if #[cfg(target_arch = "arm")] {
mod arm;
pub use self::arm::*;
} else if #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] {
mod mips;
pub use self::mips::*;
} else if #[cfg(target_arch = "m68k")] {
mod m68k;
pub use self::m68k::*;
} else if #[cfg(target_arch = "powerpc")] {
mod powerpc;
pub use self::powerpc::*;
} else if #[cfg(target_arch = "sparc")] {
mod sparc;
pub use self::sparc::*;
} else if #[cfg(target_arch = "riscv32")] {
mod riscv32;
pub use self::riscv32::*;
} else if #[cfg(target_arch = "csky")] {
mod csky;
pub use self::csky::*;
} else {
// Unknown target_arch
}
}

Some files were not shown because too many files have changed in this diff Show more