Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 20:53:56 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions
+3382
View File
File diff suppressed because it is too large Load Diff
+477
View File
@@ -0,0 +1,477 @@
use crate::off_t;
use crate::prelude::*;
// Define lock_data_instrumented as an empty enum
missing! {
#[derive(Debug)]
pub enum lock_data_instrumented {}
}
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: crate::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: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_favail: crate::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 pthread_once_t {
__on_word: [c_long; 9],
}
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_flag: c_ushort,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
pub st_ssize: c_int,
pub st_atim: crate::timespec,
pub st_mtim: crate::timespec,
pub st_ctim: crate::timespec,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::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: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsblkcnt_t,
pub f_ffree: crate::fsblkcnt_t,
pub f_fsid: crate::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: crate::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 __vmxreg_t {
__v: [c_uint; 4],
}
pub struct __vmx_context_t {
pub __vr: [crate::__vmxreg_t; 32],
pub __pad1: [c_uint; 3],
pub __vscr: c_uint,
pub __vrsave: c_uint,
pub __pad2: [c_uint; 3],
}
pub struct __vsx_context_t {
pub __vsr_dw1: [c_ulonglong; 32],
}
pub struct __tm_context_t {
pub vmx: crate::__vmx_context_t,
pub vsx: crate::__vsx_context_t,
pub gpr: [c_ulonglong; 32],
pub lr: c_ulonglong,
pub ctr: c_ulonglong,
pub cr: c_uint,
pub xer: c_uint,
pub amr: c_ulonglong,
pub texasr: c_ulonglong,
pub tfiar: c_ulonglong,
pub tfhar: c_ulonglong,
pub ppr: c_ulonglong,
pub dscr: c_ulonglong,
pub tar: c_ulonglong,
pub fpscr: c_uint,
pub fpscrx: c_uint,
pub fpr: [fpreg_t; 32],
pub tmcontext: c_char,
pub tmstate: c_char,
pub prevowner: c_char,
pub pad: [c_char; 5],
}
pub struct __context64 {
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],
pub fpr: [fpreg_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 mcontext_t {
pub jmp_context: __context64,
}
pub struct __extctx_t {
pub __flags: c_uint,
pub __rsvd1: [c_uint; 3],
pub __vmx: crate::__vmx_context_t,
pub __ukeys: [c_uint; 2],
pub __vsx: crate::__vsx_context_t,
pub __tm: crate::__tm_context_t,
pub __reserved: [c_char; 1860],
pub __extctx_magic: c_int,
}
pub struct ucontext_t {
pub __sc_onstack: c_int,
pub uc_sigmask: crate::sigset_t,
pub __sc_uerror: c_int,
pub uc_mcontext: crate::mcontext_t,
pub uc_link: *mut ucontext_t,
pub uc_stack: crate::stack_t,
pub __extctx: *mut crate::__extctx_t,
pub __extctx_magic: c_int,
pub __pad: [c_int; 1],
}
pub struct utmpx {
pub ut_user: [c_char; 256],
pub ut_id: [c_char; 14],
pub ut_line: [c_char; 64],
pub ut_pid: crate::pid_t,
pub ut_type: c_short,
pub ut_tv: crate::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: crate::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: crate::pid_t,
pub msg_lrpid: crate::pid_t,
pub msg_stime: crate::time_t,
pub msg_rtime: crate::time_t,
pub msg_ctime: crate::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: crate::pid_t,
pub si_uid: crate::uid_t,
pub si_status: c_int,
pub si_addr: *mut c_void,
pub si_band: c_long,
pub si_value: crate::sigval,
pub __si_flags: c_int,
pub __pad: [c_int; 3],
}
pub union _kernel_simple_lock {
pub _slock: c_long,
pub _slockp: *mut lock_data_instrumented,
}
pub struct fileops_t {
pub fo_rw: Option<
extern "C" fn(
file: *mut file,
rw: crate::uio_rw,
io: *mut c_void,
ext: c_long,
secattr: *mut c_void,
) -> c_int,
>,
pub fo_ioctl: Option<
extern "C" fn(
file: *mut file,
a: c_long,
b: crate::caddr_t,
c: c_long,
d: c_long,
) -> c_int,
>,
pub fo_select: Option<
extern "C" fn(file: *mut file, a: c_int, b: *mut c_ushort, c: extern "C" fn()) -> c_int,
>,
pub fo_close: Option<extern "C" fn(file: *mut file) -> c_int>,
pub fo_fstat: Option<extern "C" fn(file: *mut file, sstat: *mut crate::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,
pub f_lock: _kernel_simple_lock,
pub f_offset_lock: _kernel_simple_lock,
pub f_vinfo: crate::caddr_t,
pub f_ops: *mut fileops_t,
pub f_parentp: crate::caddr_t,
pub f_fnamep: crate::caddr_t,
pub f_fdata: [c_char; 160],
}
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,
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],
}
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_short,
pub revents: c_short,
pub data: __pollfd_ext_u,
}
pub struct fpreg_t {
pub d: c_double,
}
}
impl siginfo_t {
pub unsafe fn si_addr(&self) -> *mut c_void {
self.si_addr
}
pub unsafe fn si_value(&self) -> crate::sigval {
self.si_value
}
pub unsafe fn si_pid(&self) -> crate::pid_t {
self.si_pid
}
pub unsafe fn si_uid(&self) -> crate::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 {
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
&& self.si_value == other.si_value
}
}
impl Eq for siginfo_t {}
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);
self.si_value.hash(state);
self.__si_flags.hash(state);
}
}
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
}
}
}
impl Eq for __pollfd_ext_u {}
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 {
self.fd == other.fd
&& self.events == other.events
&& self.revents == other.revents
&& self.data == other.data
}
}
impl Eq for pollfd_ext {}
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);
self.data.hash(state);
}
}
impl PartialEq for fpreg_t {
fn eq(&self, other: &fpreg_t) -> bool {
self.d == other.d
}
}
impl Eq for fpreg_t {}
impl hash::Hash for fpreg_t {
fn hash<H: hash::Hasher>(&self, state: &mut H) {
let d: u64 = unsafe { mem::transmute(self.d) };
d.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 PTHREAD_ONCE_INIT: pthread_once_t = pthread_once_t {
__on_word: [0, 0, 0, 0, 0, 2, 0, 0, 0],
};
pub const RLIM_INFINITY: c_ulong = 0x7fffffffffffffff;
extern "C" {
pub fn getsystemcfg(label: c_int) -> c_ulong;
}
+135
View File
@@ -0,0 +1,135 @@
//! 32-bit specific Apple (ios/darwin) definitions
use crate::prelude::*;
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: crate::timeval,
pub ifi_unused2: u32,
pub ifi_hwassist: u32,
pub ifi_reserved1: u32,
pub ifi_reserved2: u32,
}
pub struct bpf_hdr {
pub bh_tstamp: crate::timeval,
pub bh_caplen: u32,
pub bh_datalen: u32,
pub bh_hdrlen: c_ushort,
}
pub struct malloc_zone_t {
__private: [crate::uintptr_t; 18], // FIXME(macos): 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; crate::__PTHREAD_ONCE_SIZE__],
}
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 2],
}
}
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 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 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: crate::pthread_once_t = crate::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;
}
+53
View File
@@ -0,0 +1,53 @@
use crate::prelude::*;
pub type boolean_t = c_int;
pub type mcontext_t = *mut __darwin_mcontext64;
s! {
pub struct malloc_zone_t {
__private: [crate::uintptr_t; 18], // FIXME(macos): needs arm64 auth pointers support
}
pub struct ucontext_t {
pub uc_onstack: c_int,
pub uc_sigmask: crate::sigset_t,
pub uc_stack: crate::stack_t,
pub uc_link: *mut crate::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,
}
pub struct __darwin_arm_neon_state64 {
pub __v: [crate::__uint128_t; 32],
pub __fpsr: u32,
pub __fpcr: u32,
}
}
s_no_extra_traits! {
pub struct max_align_t {
priv_: f64,
}
}
+141
View File
@@ -0,0 +1,141 @@
//! 64-bit specific Apple (ios/darwin) definitions
use crate::prelude::*;
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: crate::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 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 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: crate::pthread_once_t = crate::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
}
}
+179
View File
@@ -0,0 +1,179 @@
use crate::prelude::*;
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: crate::sigset_t,
pub uc_stack: crate::stack_t,
pub uc_link: *mut crate::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: [crate::uintptr_t; 16], // FIXME(macos): keeping private for now
}
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
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) -> crate::boolean_t,
>,
}
}
s_no_extra_traits! {
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 2],
}
}
File diff suppressed because it is too large Load Diff
+17
View File
@@ -0,0 +1,17 @@
use crate::prelude::*;
/* DIFF(main): module removed in de76fee6 */
// 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
+110
View File
@@ -0,0 +1,110 @@
use crate::prelude::*;
pub type clock_t = i32;
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: [crate::register_t; 30],
pub gp_lr: crate::register_t,
pub gp_sp: crate::register_t,
pub gp_elr: crate::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],
}
}
pub(crate) const _ALIGNBYTES: usize = size_of::<c_longlong>() - 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 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 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 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 BIOCSRTIMEOUT: c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e;
pub const MAP_32BIT: c_int = 0x00080000;
pub const MINSIGSTKSZ: size_t = 4096; // 1024 * 4
pub const TIOCTIMESTAMP: c_ulong = 0x40107459;
+53
View File
@@ -0,0 +1,53 @@
use crate::prelude::*;
pub type clock_t = u32;
pub type wchar_t = u32;
pub type time_t = i64;
pub type suseconds_t = i32;
pub type register_t = i32;
pub type __greg_t = c_uint;
pub type __gregset_t = [crate::__greg_t; 17];
s_no_extra_traits! {
pub struct mcontext_t {
pub __gregs: crate::__gregset_t,
pub mc_vfp_size: usize,
pub mc_vfp_ptr: *mut c_void,
pub mc_spare: [c_uint; 33],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.__gregs == other.__gregs
&& self.mc_vfp_size == other.mc_vfp_size
&& self.mc_vfp_ptr == other.mc_vfp_ptr
&& self
.mc_spare
.iter()
.zip(other.mc_spare.iter())
.all(|(a, b)| a == b)
}
}
impl Eq for mcontext_t {}
impl hash::Hash for mcontext_t {
fn hash<H: hash::Hasher>(&self, state: &mut H) {
self.__gregs.hash(state);
self.mc_vfp_size.hash(state);
self.mc_vfp_ptr.hash(state);
self.mc_spare.hash(state);
}
}
}
}
pub(crate) const _ALIGNBYTES: usize = size_of::<c_int>() - 1;
pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e;
pub const MAP_32BIT: c_int = 0x00080000;
pub const MINSIGSTKSZ: size_t = 4096; // 1024 * 4
pub const TIOCTIMESTAMP: c_ulong = 0x40107459;
@@ -0,0 +1,37 @@
use crate::off_t;
use crate::prelude::*;
#[repr(C)]
#[derive(Debug)]
#[cfg_attr(feature = "extra_traits", derive(Eq, Hash, PartialEq))]
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
pub st_size: off_t,
pub st_blocks: crate::blkcnt_t,
pub st_blksize: crate::blksize_t,
pub st_flags: crate::fflags_t,
pub st_gen: u32,
pub st_lspare: i32,
pub st_birthtime: crate::time_t,
pub st_birthtime_nsec: c_long,
__unused: [u8; 8],
}
impl Copy for crate::stat {}
impl Clone for crate::stat {
fn clone(&self) -> crate::stat {
*self
}
}
@@ -0,0 +1,36 @@
use crate::off_t;
use crate::prelude::*;
#[repr(C)]
#[derive(Debug)]
#[cfg_attr(feature = "extra_traits", derive(Eq, Hash, PartialEq))]
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
pub st_size: off_t,
pub st_blocks: crate::blkcnt_t,
pub st_blksize: crate::blksize_t,
pub st_flags: crate::fflags_t,
pub st_gen: u32,
pub st_lspare: i32,
pub st_birthtime: crate::time_t,
pub st_birthtime_nsec: c_long,
}
impl Copy for crate::stat {}
impl Clone for crate::stat {
fn clone(&self) -> crate::stat {
*self
}
}
@@ -0,0 +1,449 @@
use crate::prelude::*;
// 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: crate::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: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_lpid: crate::pid_t,
pub shm_cpid: crate::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: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::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 crate::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,
/// Pointer to open file info.
pub ki_fd: *mut crate::filedesc,
// 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: crate::pid_t,
/// Parent process ID.
pub ki_ppid: crate::pid_t,
/// Process group ID.
pub ki_pgid: crate::pid_t,
/// tty process group ID.
pub ki_tpgid: crate::pid_t,
/// Process session ID.
pub ki_sid: crate::pid_t,
/// Terminal session ID.
pub ki_tsid: crate::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: crate::dev_t,
/// Signals arrived but not delivered.
pub ki_siglist: crate::sigset_t,
/// Current signal mask.
pub ki_sigmask: crate::sigset_t,
/// Signals being ignored.
pub ki_sigignore: crate::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: crate::sigset_t,
/// Effective user ID.
pub ki_uid: crate::uid_t,
/// Real user ID.
pub ki_ruid: crate::uid_t,
/// Saved effective user ID.
pub ki_svuid: crate::uid_t,
/// Real group ID.
pub ki_rgid: crate::gid_t,
/// Saved effective group ID.
pub ki_svgid: crate::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: [crate::gid_t; crate::KI_NGROUPS],
/// Virtual size.
pub ki_size: crate::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: crate::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: crate::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: crate::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: crate::segsz_t,
/// Stack size (pages).
pub ki_ssize: crate::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: crate::u_short,
/// Accounting flags.
pub ki_acflag: crate::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: crate::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: crate::u_int,
/// Time since last blocked.
pub ki_slptime: crate::u_int,
/// Time swapped in or out.
pub ki_swtime: crate::u_int,
/// Number of copy-on-write faults.
pub ki_cow: crate::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: crate::timeval,
/// Time used by process children.
pub ki_childtime: crate::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; crate::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [c_char; crate::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [c_char; crate::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [c_char; crate::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [c_char; crate::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [c_char; crate::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [c_char; crate::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [c_char; crate::MAXCOMLEN - crate::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; crate::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: crate::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: crate::lwpid_t,
/// Process priority.
pub ki_pri: crate::priority,
/// Process rusage statistics.
pub ki_rusage: crate::rusage,
/// rusage of children processes.
pub ki_rusage_ch: crate::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; crate::KI_NSPARE_PTR],
pub ki_sparelongs: [c_long; crate::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: crate::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: crate::uid_t,
pub f_fsid: crate::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; crate::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 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 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 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) -> crate::dev_t {
let major = major as crate::dev_t;
let minor = minor as crate::dev_t;
(major << 8) | minor
}
pub const fn major(dev: crate::dev_t) -> c_int {
((dev >> 8) & 0xff) as c_int
}
pub const fn minor(dev: crate::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: crate::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;
// Argument order of the function pointer changed in FreeBSD 14. From 14 onwards the signature
// matches the POSIX specification by having the third argument be a mutable pointer, on
// earlier versions the first argument is the mutable pointer.
#[link_name = "qsort_r@FBSD_1.0"]
pub fn qsort_r(
base: *mut c_void,
num: size_t,
size: size_t,
arg: *mut c_void,
compar: Option<unsafe extern "C" fn(*mut c_void, *const c_void, *const c_void) -> c_int>,
);
}
cfg_if! {
if #[cfg(target_pointer_width = "64")] {
mod b64;
pub use self::b64::*;
} else {
mod b32;
pub use self::b32::*;
}
}
@@ -0,0 +1,487 @@
use crate::off_t;
use crate::prelude::*;
// 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: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_lpid: crate::pid_t,
pub shm_cpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
}
pub struct kevent {
pub ident: crate::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: crate::vm_prot_t,
pub offset: crate::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 crate::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,
/// Pointer to open file info.
pub ki_fd: *mut crate::filedesc,
// 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: crate::pid_t,
/// Parent process ID.
pub ki_ppid: crate::pid_t,
/// Process group ID.
pub ki_pgid: crate::pid_t,
/// tty process group ID.
pub ki_tpgid: crate::pid_t,
/// Process session ID.
pub ki_sid: crate::pid_t,
/// Terminal session ID.
pub ki_tsid: crate::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: crate::sigset_t,
/// Current signal mask.
pub ki_sigmask: crate::sigset_t,
/// Signals being ignored.
pub ki_sigignore: crate::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: crate::sigset_t,
/// Effective user ID.
pub ki_uid: crate::uid_t,
/// Real user ID.
pub ki_ruid: crate::uid_t,
/// Saved effective user ID.
pub ki_svuid: crate::uid_t,
/// Real group ID.
pub ki_rgid: crate::gid_t,
/// Saved effective group ID.
pub ki_svgid: crate::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: [crate::gid_t; crate::KI_NGROUPS],
/// Virtual size.
pub ki_size: crate::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: crate::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: crate::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: crate::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: crate::segsz_t,
/// Stack size (pages).
pub ki_ssize: crate::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: crate::u_short,
/// Accounting flags.
pub ki_acflag: crate::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: crate::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: crate::u_int,
/// Time since last blocked.
pub ki_slptime: crate::u_int,
/// Time swapped in or out.
pub ki_swtime: crate::u_int,
/// Number of copy-on-write faults.
pub ki_cow: crate::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: crate::timeval,
/// Time used by process children.
pub ki_childtime: crate::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; crate::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [c_char; crate::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [c_char; crate::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [c_char; crate::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [c_char; crate::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [c_char; crate::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [c_char; crate::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [c_char; crate::MAXCOMLEN - crate::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; crate::KI_NSPARE_INT],
/// Controlling tty dev.
pub ki_tdev: crate::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: crate::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: crate::lwpid_t,
/// Process priority.
pub ki_pri: crate::priority,
/// Process rusage statistics.
pub ki_rusage: crate::rusage,
/// rusage of children processes.
pub ki_rusage_ch: crate::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; crate::KI_NSPARE_PTR],
pub ki_sparelongs: [c_long; crate::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: c_long,
/// kthread flag.
pub ki_tdflags: c_long,
}
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_nlink: crate::nlink_t,
pub st_mode: crate::mode_t,
st_padding0: i16,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
st_padding1: i32,
pub st_rdev: crate::dev_t,
#[cfg(target_arch = "x86")]
st_atim_ext: i32,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
#[cfg(target_arch = "x86")]
st_mtim_ext: i32,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
#[cfg(target_arch = "x86")]
st_ctim_ext: i32,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
#[cfg(target_arch = "x86")]
st_btim_ext: i32,
pub st_birthtime: crate::time_t,
pub st_birthtime_nsec: c_long,
pub st_size: off_t,
pub st_blocks: crate::blkcnt_t,
pub st_blksize: crate::blksize_t,
pub st_flags: crate::fflags_t,
pub st_gen: u64,
pub st_spare: [u64; 10],
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: crate::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: crate::uid_t,
pub f_fsid: crate::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; crate::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 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 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 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) -> crate::dev_t {
let major = major as crate::dev_t;
let minor = minor as crate::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
}
pub const fn major(dev: crate::dev_t) -> c_int {
(((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as c_int
}
pub const fn minor(dev: crate::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: crate::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;
#[link_name = "qsort_r@FBSD_1.0"]
pub fn qsort_r(
base: *mut c_void,
num: size_t,
size: size_t,
arg: *mut c_void,
compar: Option<unsafe extern "C" fn(*mut c_void, *const c_void, *const c_void) -> c_int>,
);
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
}
}
@@ -0,0 +1,7 @@
use crate::prelude::*;
pub const PROC_KPTI_CTL: c_int = crate::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 = crate::PROC_PROCCTL_MD_MIN + 1;
pub const PROC_KPTI_STATUS_ACTIVE: c_int = 0x80000000;
@@ -0,0 +1,531 @@
use crate::off_t;
use crate::prelude::*;
// 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: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_lpid: crate::pid_t,
pub shm_cpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
}
pub struct kevent {
pub ident: crate::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: crate::u_int,
pub kp_paddr: crate::kpaddr_t,
pub kp_kmap_vaddr: crate::kvaddr_t,
pub kp_dmap_vaddr: crate::kvaddr_t,
pub kp_prot: crate::vm_prot_t,
pub kp_offset: off_t,
pub kp_len: size_t,
}
pub struct __c_anonymous_domainset {
#[cfg(target_pointer_width = "64")]
_priv: [c_ulong; 4],
#[cfg(target_pointer_width = "32")]
_priv: [c_ulong; 8],
}
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 crate::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,
/// Pointer to open file info.
pub ki_fd: *mut crate::filedesc,
// 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: crate::pid_t,
/// Parent process ID.
pub ki_ppid: crate::pid_t,
/// Process group ID.
pub ki_pgid: crate::pid_t,
/// tty process group ID.
pub ki_tpgid: crate::pid_t,
/// Process session ID.
pub ki_sid: crate::pid_t,
/// Terminal session ID.
pub ki_tsid: crate::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: crate::sigset_t,
/// Current signal mask.
pub ki_sigmask: crate::sigset_t,
/// Signals being ignored.
pub ki_sigignore: crate::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: crate::sigset_t,
/// Effective user ID.
pub ki_uid: crate::uid_t,
/// Real user ID.
pub ki_ruid: crate::uid_t,
/// Saved effective user ID.
pub ki_svuid: crate::uid_t,
/// Real group ID.
pub ki_rgid: crate::gid_t,
/// Saved effective group ID.
pub ki_svgid: crate::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: [crate::gid_t; crate::KI_NGROUPS],
/// Virtual size.
pub ki_size: crate::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: crate::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: crate::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: crate::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: crate::segsz_t,
/// Stack size (pages).
pub ki_ssize: crate::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: crate::u_short,
/// Accounting flags.
pub ki_acflag: crate::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: crate::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: crate::u_int,
/// Time since last blocked.
pub ki_slptime: crate::u_int,
/// Time swapped in or out.
pub ki_swtime: crate::u_int,
/// Number of copy-on-write faults.
pub ki_cow: crate::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: crate::timeval,
/// Time used by process children.
pub ki_childtime: crate::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; crate::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [c_char; crate::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [c_char; crate::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [c_char; crate::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [c_char; crate::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [c_char; crate::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [c_char; crate::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [c_char; crate::MAXCOMLEN - crate::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; crate::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: crate::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: crate::lwpid_t,
/// Process priority.
pub ki_pri: crate::priority,
/// Process rusage statistics.
pub ki_rusage: crate::rusage,
/// rusage of children processes.
pub ki_rusage_ch: crate::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; crate::KI_NSPARE_PTR],
pub ki_sparelongs: [c_long; crate::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: c_long,
/// kthread flag.
pub ki_tdflags: c_long,
}
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_nlink: crate::nlink_t,
pub st_mode: crate::mode_t,
st_padding0: i16,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
st_padding1: i32,
pub st_rdev: crate::dev_t,
#[cfg(target_arch = "x86")]
st_atim_ext: i32,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
#[cfg(target_arch = "x86")]
st_mtim_ext: i32,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
#[cfg(target_arch = "x86")]
st_ctim_ext: i32,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
#[cfg(target_arch = "x86")]
st_btim_ext: i32,
pub st_birthtime: crate::time_t,
pub st_birthtime_nsec: c_long,
pub st_size: off_t,
pub st_blocks: crate::blkcnt_t,
pub st_blksize: crate::blksize_t,
pub st_flags: crate::fflags_t,
pub st_gen: u64,
pub st_spare: [u64; 10],
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: crate::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: crate::uid_t,
pub f_fsid: crate::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; crate::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 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 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 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) -> crate::dev_t {
let major = major as crate::dev_t;
let minor = minor as crate::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
}
pub const fn major(dev: crate::dev_t) -> c_int {
(((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as c_int
}
pub const fn minor(dev: crate::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: crate::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: crate::cpulevel_t,
which: crate::cpuwhich_t,
id: crate::id_t,
setsize: size_t,
mask: *mut crate::domainset_t,
policy: *mut c_int,
) -> c_int;
pub fn cpuset_setdomain(
level: crate::cpulevel_t,
which: crate::cpuwhich_t,
id: crate::id_t,
setsize: size_t,
mask: *const crate::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 = "qsort_r@FBSD_1.0"]
pub fn qsort_r(
base: *mut c_void,
num: size_t,
size: size_t,
arg: *mut c_void,
compar: Option<unsafe extern "C" fn(*mut c_void, *const c_void, *const c_void) -> c_int>,
);
}
#[link(name = "kvm")]
extern "C" {
pub fn kvm_kerndisp(kd: *mut crate::kvm_t) -> crate::kssize_t;
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
}
}
@@ -0,0 +1,7 @@
use crate::prelude::*;
pub const PROC_KPTI_CTL: c_int = crate::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 = crate::PROC_PROCCTL_MD_MIN + 1;
pub const PROC_KPTI_STATUS_ACTIVE: c_int = 0x80000000;
@@ -0,0 +1,532 @@
use crate::off_t;
use crate::prelude::*;
// 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: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_lpid: crate::pid_t,
pub shm_cpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
}
pub struct kevent {
pub ident: crate::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: crate::u_int,
pub kp_paddr: crate::kpaddr_t,
pub kp_kmap_vaddr: crate::kvaddr_t,
pub kp_dmap_vaddr: crate::kvaddr_t,
pub kp_prot: crate::vm_prot_t,
pub kp_offset: off_t,
pub kp_len: size_t,
}
pub struct __c_anonymous_domainset {
#[cfg(target_pointer_width = "64")]
_priv: [c_ulong; 4],
#[cfg(target_pointer_width = "32")]
_priv: [c_ulong; 8],
}
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 crate::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,
/// Pointer to open file info.
pub ki_fd: *mut crate::filedesc,
// 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: crate::pid_t,
/// Parent process ID.
pub ki_ppid: crate::pid_t,
/// Process group ID.
pub ki_pgid: crate::pid_t,
/// tty process group ID.
pub ki_tpgid: crate::pid_t,
/// Process session ID.
pub ki_sid: crate::pid_t,
/// Terminal session ID.
pub ki_tsid: crate::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: crate::sigset_t,
/// Current signal mask.
pub ki_sigmask: crate::sigset_t,
/// Signals being ignored.
pub ki_sigignore: crate::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: crate::sigset_t,
/// Effective user ID.
pub ki_uid: crate::uid_t,
/// Real user ID.
pub ki_ruid: crate::uid_t,
/// Saved effective user ID.
pub ki_svuid: crate::uid_t,
/// Real group ID.
pub ki_rgid: crate::gid_t,
/// Saved effective group ID.
pub ki_svgid: crate::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: [crate::gid_t; crate::KI_NGROUPS],
/// Virtual size.
pub ki_size: crate::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: crate::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: crate::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: crate::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: crate::segsz_t,
/// Stack size (pages).
pub ki_ssize: crate::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: crate::u_short,
/// Accounting flags.
pub ki_acflag: crate::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: crate::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: crate::u_int,
/// Time since last blocked.
pub ki_slptime: crate::u_int,
/// Time swapped in or out.
pub ki_swtime: crate::u_int,
/// Number of copy-on-write faults.
pub ki_cow: crate::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: crate::timeval,
/// Time used by process children.
pub ki_childtime: crate::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; crate::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [c_char; crate::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [c_char; crate::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [c_char; crate::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [c_char; crate::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [c_char; crate::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [c_char; crate::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [c_char; crate::MAXCOMLEN - crate::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; crate::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: crate::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: crate::lwpid_t,
/// Process priority.
pub ki_pri: crate::priority,
/// Process rusage statistics.
pub ki_rusage: crate::rusage,
/// rusage of children processes.
pub ki_rusage_ch: crate::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; crate::KI_NSPARE_PTR],
pub ki_sparelongs: [c_long; crate::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: c_long,
/// kthread flag.
pub ki_tdflags: c_long,
}
#[non_exhaustive]
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_nlink: crate::nlink_t,
pub st_mode: crate::mode_t,
st_padding0: i16,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
st_padding1: i32,
pub st_rdev: crate::dev_t,
#[cfg(target_arch = "x86")]
st_atim_ext: i32,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
#[cfg(target_arch = "x86")]
st_mtim_ext: i32,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
#[cfg(target_arch = "x86")]
st_ctim_ext: i32,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
#[cfg(target_arch = "x86")]
st_btim_ext: i32,
pub st_birthtime: crate::time_t,
pub st_birthtime_nsec: c_long,
pub st_size: off_t,
pub st_blocks: crate::blkcnt_t,
pub st_blksize: crate::blksize_t,
pub st_flags: crate::fflags_t,
pub st_gen: u64,
pub st_filerev: u64,
pub st_spare: [u64; 9],
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: crate::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: crate::uid_t,
pub f_fsid: crate::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; crate::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 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 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 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) -> crate::dev_t {
let major = major as crate::dev_t;
let minor = minor as crate::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
}
pub const fn major(dev: crate::dev_t) -> c_int {
(((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as c_int
}
pub const fn minor(dev: crate::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: crate::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: crate::cpulevel_t,
which: crate::cpuwhich_t,
id: crate::id_t,
setsize: size_t,
mask: *mut crate::domainset_t,
policy: *mut c_int,
) -> c_int;
pub fn cpuset_setdomain(
level: crate::cpulevel_t,
which: crate::cpuwhich_t,
id: crate::id_t,
setsize: size_t,
mask: *const crate::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;
pub fn qsort_r(
base: *mut c_void,
num: size_t,
size: size_t,
compar: Option<unsafe extern "C" fn(*const c_void, *const c_void, *mut c_void) -> c_int>,
arg: *mut c_void,
);
}
#[link(name = "kvm")]
extern "C" {
pub fn kvm_kerndisp(kd: *mut crate::kvm_t) -> crate::kssize_t;
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
}
}
@@ -0,0 +1,14 @@
use crate::prelude::*;
pub const PROC_KPTI_CTL: c_int = crate::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 = crate::PROC_PROCCTL_MD_MIN + 1;
pub const PROC_KPTI_STATUS_ACTIVE: c_int = 0x80000000;
pub const PROC_LA_CTL: c_int = crate::PROC_PROCCTL_MD_MIN + 2;
pub const PROC_LA_STATUS: c_int = crate::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;
@@ -0,0 +1,534 @@
use crate::off_t;
use crate::prelude::*;
// 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: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_lpid: crate::pid_t,
pub shm_cpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
}
pub struct kevent {
pub ident: crate::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: crate::u_int,
pub kp_paddr: crate::kpaddr_t,
pub kp_kmap_vaddr: crate::kvaddr_t,
pub kp_dmap_vaddr: crate::kvaddr_t,
pub kp_prot: crate::vm_prot_t,
pub kp_offset: off_t,
pub kp_len: size_t,
}
pub struct __c_anonymous_domainset {
#[cfg(target_pointer_width = "64")]
_priv: [c_ulong; 4],
#[cfg(target_pointer_width = "32")]
_priv: [c_ulong; 8],
}
#[non_exhaustive]
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 crate::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,
/// Pointer to open file info.
pub ki_fd: *mut crate::filedesc,
// 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: crate::pid_t,
/// Parent process ID.
pub ki_ppid: crate::pid_t,
/// Process group ID.
pub ki_pgid: crate::pid_t,
/// tty process group ID.
pub ki_tpgid: crate::pid_t,
/// Process session ID.
pub ki_sid: crate::pid_t,
/// Terminal session ID.
pub ki_tsid: crate::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: crate::sigset_t,
/// Current signal mask.
pub ki_sigmask: crate::sigset_t,
/// Signals being ignored.
pub ki_sigignore: crate::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: crate::sigset_t,
/// Effective user ID.
pub ki_uid: crate::uid_t,
/// Real user ID.
pub ki_ruid: crate::uid_t,
/// Saved effective user ID.
pub ki_svuid: crate::uid_t,
/// Real group ID.
pub ki_rgid: crate::gid_t,
/// Saved effective group ID.
pub ki_svgid: crate::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: [crate::gid_t; crate::KI_NGROUPS],
/// Virtual size.
pub ki_size: crate::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: crate::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: crate::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: crate::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: crate::segsz_t,
/// Stack size (pages).
pub ki_ssize: crate::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: crate::u_short,
/// Accounting flags.
pub ki_acflag: crate::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: crate::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: crate::u_int,
/// Time since last blocked.
pub ki_slptime: crate::u_int,
/// Time swapped in or out.
pub ki_swtime: crate::u_int,
/// Number of copy-on-write faults.
pub ki_cow: crate::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: crate::timeval,
/// Time used by process children.
pub ki_childtime: crate::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; crate::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [c_char; crate::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [c_char; crate::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [c_char; crate::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [c_char; crate::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [c_char; crate::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [c_char; crate::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [c_char; crate::MAXCOMLEN - crate::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; crate::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: crate::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: crate::lwpid_t,
/// Process priority.
pub ki_pri: crate::priority,
/// Process rusage statistics.
pub ki_rusage: crate::rusage,
/// rusage of children processes.
pub ki_rusage_ch: crate::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,
/// Address of the ext err msg place
pub ki_uerrmsg: *mut c_void,
pub ki_spareptrs: [*mut c_void; crate::KI_NSPARE_PTR],
pub ki_sparelongs: [c_long; crate::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: c_long,
/// kthread flag.
pub ki_tdflags: c_long,
}
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_nlink: crate::nlink_t,
pub st_mode: crate::mode_t,
st_padding0: i16,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
st_padding1: i32,
pub st_rdev: crate::dev_t,
#[cfg(target_arch = "x86")]
st_atim_ext: i32,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
#[cfg(target_arch = "x86")]
st_mtim_ext: i32,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
#[cfg(target_arch = "x86")]
st_ctim_ext: i32,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
#[cfg(target_arch = "x86")]
st_btim_ext: i32,
pub st_birthtime: crate::time_t,
pub st_birthtime_nsec: c_long,
pub st_size: off_t,
pub st_blocks: crate::blkcnt_t,
pub st_blksize: crate::blksize_t,
pub st_flags: crate::fflags_t,
pub st_gen: u64,
pub st_filerev: u64,
pub st_spare: [u64; 9],
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: crate::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: crate::uid_t,
pub f_fsid: crate::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; crate::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 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 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 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 = 4;
/// 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) -> crate::dev_t {
let major = major as crate::dev_t;
let minor = minor as crate::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
}
pub const fn major(dev: crate::dev_t) -> c_int {
(((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as c_int
}
pub const fn minor(dev: crate::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: crate::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: crate::cpulevel_t,
which: crate::cpuwhich_t,
id: crate::id_t,
setsize: size_t,
mask: *mut crate::domainset_t,
policy: *mut c_int,
) -> c_int;
pub fn cpuset_setdomain(
level: crate::cpulevel_t,
which: crate::cpuwhich_t,
id: crate::id_t,
setsize: size_t,
mask: *const crate::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;
pub fn qsort_r(
base: *mut c_void,
num: size_t,
size: size_t,
compar: Option<unsafe extern "C" fn(*const c_void, *const c_void, *mut c_void) -> c_int>,
arg: *mut c_void,
);
}
#[link(name = "kvm")]
extern "C" {
pub fn kvm_kerndisp(kd: *mut crate::kvm_t) -> crate::kssize_t;
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
}
}
@@ -0,0 +1,14 @@
use crate::prelude::*;
pub const PROC_KPTI_CTL: c_int = crate::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 = crate::PROC_PROCCTL_MD_MIN + 1;
pub const PROC_KPTI_STATUS_ACTIVE: c_int = 0x80000000;
pub const PROC_LA_CTL: c_int = crate::PROC_PROCCTL_MD_MIN + 2;
pub const PROC_LA_STATUS: c_int = crate::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
+62
View File
@@ -0,0 +1,62 @@
use crate::prelude::*;
pub type clock_t = u32;
pub type wchar_t = i32;
pub type time_t = i64;
pub type suseconds_t = i32;
pub type register_t = i32;
s_no_extra_traits! {
#[repr(align(16))]
pub struct mcontext_t {
pub mc_vers: c_int,
pub mc_flags: c_int,
pub mc_onstack: c_int,
pub mc_len: c_int,
pub mc_avec: [u64; 64],
pub mc_av: [u32; 2],
pub mc_frame: [crate::register_t; 42],
pub mc_fpreg: [u64; 33],
pub mc_vsxfpreg: [u64; 32],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.mc_vers == other.mc_vers
&& self.mc_flags == other.mc_flags
&& self.mc_onstack == other.mc_onstack
&& self.mc_len == other.mc_len
&& self.mc_avec == other.mc_avec
&& self.mc_av == other.mc_av
&& self.mc_frame == other.mc_frame
&& self.mc_fpreg == other.mc_fpreg
&& self.mc_vsxfpreg == other.mc_vsxfpreg
}
}
impl Eq for mcontext_t {}
impl hash::Hash for mcontext_t {
fn hash<H: hash::Hasher>(&self, state: &mut H) {
self.mc_vers.hash(state);
self.mc_flags.hash(state);
self.mc_onstack.hash(state);
self.mc_len.hash(state);
self.mc_avec.hash(state);
self.mc_av.hash(state);
self.mc_frame.hash(state);
self.mc_fpreg.hash(state);
self.mc_vsxfpreg.hash(state);
}
}
}
}
pub(crate) const _ALIGNBYTES: usize = size_of::<c_int>() - 1;
pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e;
pub const MAP_32BIT: c_int = 0x00080000;
pub const MINSIGSTKSZ: size_t = 2048; // 512 * 4
pub const TIOCTIMESTAMP: c_ulong = 0x40107459;
@@ -0,0 +1,63 @@
use crate::prelude::*;
pub type clock_t = u32;
pub type wchar_t = i32;
pub type time_t = i64;
pub type suseconds_t = i64;
pub type register_t = i64;
s_no_extra_traits! {
#[repr(align(16))]
pub struct mcontext_t {
pub mc_vers: c_int,
pub mc_flags: c_int,
pub mc_onstack: c_int,
pub mc_len: c_int,
pub mc_avec: [u64; 64],
pub mc_av: [u32; 2],
pub mc_frame: [crate::register_t; 42],
pub mc_fpreg: [u64; 33],
pub mc_vsxfpreg: [u64; 32],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.mc_vers == other.mc_vers
&& self.mc_flags == other.mc_flags
&& self.mc_onstack == other.mc_onstack
&& self.mc_len == other.mc_len
&& self.mc_avec == other.mc_avec
&& self.mc_av == other.mc_av
&& self.mc_frame == other.mc_frame
&& self.mc_fpreg == other.mc_fpreg
&& self.mc_vsxfpreg == other.mc_vsxfpreg
}
}
impl Eq for mcontext_t {}
impl hash::Hash for mcontext_t {
fn hash<H: hash::Hasher>(&self, state: &mut H) {
self.mc_vers.hash(state);
self.mc_flags.hash(state);
self.mc_onstack.hash(state);
self.mc_len.hash(state);
self.mc_avec.hash(state);
self.mc_av.hash(state);
self.mc_frame.hash(state);
self.mc_fpreg.hash(state);
self.mc_vsxfpreg.hash(state);
}
}
}
}
pub(crate) const _ALIGNBYTES: usize = size_of::<c_long>() - 1;
pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e;
pub const MAP_32BIT: c_int = 0x00080000;
pub const MINSIGSTKSZ: size_t = 2048; // 512 * 4
pub const TIOCTIMESTAMP: c_ulong = 0x40107459;
+116
View File
@@ -0,0 +1,116 @@
use crate::prelude::*;
pub type clock_t = i32;
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: crate::register_t,
pub gp_sp: crate::register_t,
pub gp_gp: crate::register_t,
pub gp_tp: crate::register_t,
pub gp_t: [crate::register_t; 7],
pub gp_s: [crate::register_t; 12],
pub gp_a: [crate::register_t; 8],
pub gp_sepc: crate::register_t,
pub gp_sstatus: crate::register_t,
}
pub struct fpregs {
pub fp_x: [[u64; 2]; 32],
pub fp_fcsr: u64,
pub fp_flags: c_int,
pub 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],
}
}
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 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.pad == other.pad
}
}
impl Eq for fpregs {}
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.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 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(crate) const _ALIGNBYTES: usize = size_of::<c_longlong>() - 1;
pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e;
pub const MAP_32BIT: c_int = 0x00080000;
pub const MINSIGSTKSZ: size_t = 4096; // 1024 * 4
pub const TIOCTIMESTAMP: c_ulong = 0x40107459;
+134
View File
@@ -0,0 +1,134 @@
use crate::prelude::*;
pub type clock_t = c_ulong;
pub type wchar_t = i32;
pub type time_t = i32;
pub type suseconds_t = i32;
pub type register_t = i32;
s_no_extra_traits! {
#[repr(align(16))]
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; 128],
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],
}
}
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 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(crate) const _ALIGNBYTES: usize = size_of::<c_long>() - 1;
pub const MINSIGSTKSZ: size_t = 2048; // 512 * 4
pub const BIOCSRTIMEOUT: c_ulong = 0x8008426d;
pub const BIOCGRTIMEOUT: c_ulong = 0x4008426e;
pub const KINFO_FILE_SIZE: c_int = 1392;
pub const TIOCTIMESTAMP: c_ulong = 0x40087459;
@@ -0,0 +1,346 @@
use crate::prelude::*;
pub type clock_t = i32;
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],
}
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,
pub a_un: __c_anonymous_elf64_auxv_union,
}
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 4],
}
#[repr(align(16))]
#[cfg_attr(not(any(freebsd11, freebsd12, freebsd13, freebsd14)), non_exhaustive)]
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,
// freebsd < 15
#[cfg(any(freebsd11, freebsd12, freebsd13, freebsd14))]
pub mc_spare: [c_long; 4],
// freebsd >= 15
#[cfg(not(any(freebsd11, freebsd12, freebsd13, freebsd14)))]
pub mc_tlsbase: register_t,
#[cfg(not(any(freebsd11, freebsd12, freebsd13, freebsd14)))]
pub mc_spare: [c_long; 3],
}
}
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 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 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 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);
}
}
// FIXME(msrv): suggested method was added in 1.85
#[allow(unpredictable_function_pointer_comparisons)]
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
}
}
}
impl Eq for __c_anonymous_elf64_auxv_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 {}
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 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);
}
}
}
}
pub(crate) const _ALIGNBYTES: usize = size_of::<c_long>() - 1;
pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e;
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_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;
pub const TIOCTIMESTAMP: c_ulong = 0x40107459;
File diff suppressed because it is too large Load Diff
+969
View File
@@ -0,0 +1,969 @@
use crate::prelude::*;
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 = crate::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: crate::in_port_t,
pub sin6_flowinfo: u32,
pub sin6_addr: crate::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: crate::uid_t,
pub pw_gid: crate::gid_t,
pub pw_change: crate::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: crate::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 crate::sockaddr,
pub ifa_netmask: *mut crate::sockaddr,
pub ifa_dstaddr: *mut crate::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 as usize / 64],
#[cfg(not(all(
target_pointer_width = "64",
any(target_os = "freebsd", target_os = "dragonfly")
)))]
fds_bits: [i32; FD_SETSIZE as usize / 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: crate::socklen_t,
pub msg_iov: *mut crate::iovec,
pub msg_iovlen: c_int,
pub msg_control: *mut c_void,
pub msg_controllen: crate::socklen_t,
pub msg_flags: c_int,
}
pub struct cmsghdr {
pub cmsg_len: crate::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 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 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: crate::cc_t = 0xff;
pub const IGNBRK: crate::tcflag_t = 0x00000001;
pub const BRKINT: crate::tcflag_t = 0x00000002;
pub const IGNPAR: crate::tcflag_t = 0x00000004;
pub const PARMRK: crate::tcflag_t = 0x00000008;
pub const INPCK: crate::tcflag_t = 0x00000010;
pub const ISTRIP: crate::tcflag_t = 0x00000020;
pub const INLCR: crate::tcflag_t = 0x00000040;
pub const IGNCR: crate::tcflag_t = 0x00000080;
pub const ICRNL: crate::tcflag_t = 0x00000100;
pub const IXON: crate::tcflag_t = 0x00000200;
pub const IXOFF: crate::tcflag_t = 0x00000400;
pub const IXANY: crate::tcflag_t = 0x00000800;
pub const IMAXBEL: crate::tcflag_t = 0x00002000;
pub const OPOST: crate::tcflag_t = 0x1;
pub const ONLCR: crate::tcflag_t = 0x2;
pub const OXTABS: crate::tcflag_t = 0x4;
pub const ONOEOT: crate::tcflag_t = 0x8;
pub const CIGNORE: crate::tcflag_t = 0x00000001;
pub const CSIZE: crate::tcflag_t = 0x00000300;
pub const CS5: crate::tcflag_t = 0x00000000;
pub const CS6: crate::tcflag_t = 0x00000100;
pub const CS7: crate::tcflag_t = 0x00000200;
pub const CS8: crate::tcflag_t = 0x00000300;
pub const CSTOPB: crate::tcflag_t = 0x00000400;
pub const CREAD: crate::tcflag_t = 0x00000800;
pub const PARENB: crate::tcflag_t = 0x00001000;
pub const PARODD: crate::tcflag_t = 0x00002000;
pub const HUPCL: crate::tcflag_t = 0x00004000;
pub const CLOCAL: crate::tcflag_t = 0x00008000;
pub const ECHOKE: crate::tcflag_t = 0x00000001;
pub const ECHOE: crate::tcflag_t = 0x00000002;
pub const ECHOK: crate::tcflag_t = 0x00000004;
pub const ECHO: crate::tcflag_t = 0x00000008;
pub const ECHONL: crate::tcflag_t = 0x00000010;
pub const ECHOPRT: crate::tcflag_t = 0x00000020;
pub const ECHOCTL: crate::tcflag_t = 0x00000040;
pub const ISIG: crate::tcflag_t = 0x00000080;
pub const ICANON: crate::tcflag_t = 0x00000100;
pub const ALTWERASE: crate::tcflag_t = 0x00000200;
pub const IEXTEN: crate::tcflag_t = 0x00000400;
pub const EXTPROC: crate::tcflag_t = 0x00000800;
pub const TOSTOP: crate::tcflag_t = 0x00400000;
pub const FLUSHO: crate::tcflag_t = 0x00800000;
pub const NOKERNINFO: crate::tcflag_t = 0x02000000;
pub const PENDIN: crate::tcflag_t = 0x20000000;
pub const NOFLSH: crate::tcflag_t = 0x80000000;
pub const MDMBUF: crate::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 crate::msghdr) -> *mut cmsghdr {
if (*mhdr).msg_controllen as usize >= size_of::<cmsghdr>() {
(*mhdr).msg_control.cast::<cmsghdr>()
} else {
core::ptr::null_mut()
}
}
pub fn FD_CLR(fd: c_int, set: *mut fd_set) -> () {
let bits = 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 = 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 = 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 &mut (*set).fds_bits {
*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) & 0x00ff
}
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 crate::rlimit) -> c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "setrlimit$UNIX2003"
)]
pub fn setrlimit(resource: c_int, rlim: *const crate::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 crate::ifaddrs) -> c_int;
pub fn freeifaddrs(ifa: *mut crate::ifaddrs);
pub fn setgroups(ngroups: c_int, ptr: *const crate::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 crate::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 crate::uid_t, egid: *mut crate::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 crate::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 crate::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 crate::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 crate::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 crate::sockaddr,
addrlen: *mut crate::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 crate::timeval) -> c_int;
pub fn nl_langinfo(item: crate::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 crate::sockaddr,
address_len: crate::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 crate::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 crate::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 crate::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 crate::msghdr, flags: c_int) -> ssize_t;
pub fn sync();
pub fn getgrgid_r(
gid: crate::gid_t,
grp: *mut crate::group,
buf: *mut c_char,
buflen: size_t,
result: *mut *mut crate::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 crate::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 crate::group,
buf: *mut c_char,
buflen: size_t,
result: *mut *mut crate::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 crate::group;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "pthread_cancel$UNIX2003"
)]
pub fn pthread_cancel(thread: crate::pthread_t) -> c_int;
pub fn pthread_kill(thread: crate::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: crate::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: crate::gid_t) -> *mut crate::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 crate::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 crate::pthread_t,
attr: *const crate::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: crate::pid_t,
status: *mut c_int,
options: c_int,
rusage: *mut crate::rusage,
) -> crate::pid_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "getitimer$UNIX2003"
)]
pub fn getitimer(which: c_int, curr_value: *mut crate::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 crate::itimerval,
old_value: *mut crate::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 crate::tm,
) -> size_t;
pub fn strftime_l(
buf: *mut c_char,
maxsize: size_t,
format: *const c_char,
timeptr: *const crate::tm,
locale: crate::locale_t,
) -> size_t;
pub fn devname(dev: crate::dev_t, mode_t: crate::mode_t) -> *mut c_char;
}
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
}
}
+905
View File
@@ -0,0 +1,905 @@
use crate::off_t;
use crate::prelude::*;
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;
#[derive(Debug)]
pub enum timezone {}
impl Copy for timezone {}
impl Clone for timezone {
fn clone(&self) -> timezone {
*self
}
}
#[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: crate::sighandler_t,
pub sa_mask: crate::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: crate::in6_addr,
pub ipi6_ifindex: c_uint,
}
pub struct termios {
pub c_iflag: crate::tcflag_t,
pub c_oflag: crate::tcflag_t,
pub c_cflag: crate::tcflag_t,
pub c_lflag: crate::tcflag_t,
pub c_cc: [crate::cc_t; crate::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: crate::pid_t,
pub l_type: c_short,
pub l_whence: c_short,
}
pub struct ipc_perm {
pub cuid: crate::uid_t,
pub cgid: crate::gid_t,
pub uid: crate::uid_t,
pub gid: crate::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: crate::key_t,
#[cfg(target_os = "netbsd")]
pub _key: crate::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: crate::msghdr,
pub msg_len: c_uint,
}
}
pub const D_T_FMT: crate::nl_item = 0;
pub const D_FMT: crate::nl_item = 1;
pub const T_FMT: crate::nl_item = 2;
pub const T_FMT_AMPM: crate::nl_item = 3;
pub const AM_STR: crate::nl_item = 4;
pub const PM_STR: crate::nl_item = 5;
pub const DAY_1: crate::nl_item = 6;
pub const DAY_2: crate::nl_item = 7;
pub const DAY_3: crate::nl_item = 8;
pub const DAY_4: crate::nl_item = 9;
pub const DAY_5: crate::nl_item = 10;
pub const DAY_6: crate::nl_item = 11;
pub const DAY_7: crate::nl_item = 12;
pub const ABDAY_1: crate::nl_item = 13;
pub const ABDAY_2: crate::nl_item = 14;
pub const ABDAY_3: crate::nl_item = 15;
pub const ABDAY_4: crate::nl_item = 16;
pub const ABDAY_5: crate::nl_item = 17;
pub const ABDAY_6: crate::nl_item = 18;
pub const ABDAY_7: crate::nl_item = 19;
pub const MON_1: crate::nl_item = 20;
pub const MON_2: crate::nl_item = 21;
pub const MON_3: crate::nl_item = 22;
pub const MON_4: crate::nl_item = 23;
pub const MON_5: crate::nl_item = 24;
pub const MON_6: crate::nl_item = 25;
pub const MON_7: crate::nl_item = 26;
pub const MON_8: crate::nl_item = 27;
pub const MON_9: crate::nl_item = 28;
pub const MON_10: crate::nl_item = 29;
pub const MON_11: crate::nl_item = 30;
pub const MON_12: crate::nl_item = 31;
pub const ABMON_1: crate::nl_item = 32;
pub const ABMON_2: crate::nl_item = 33;
pub const ABMON_3: crate::nl_item = 34;
pub const ABMON_4: crate::nl_item = 35;
pub const ABMON_5: crate::nl_item = 36;
pub const ABMON_6: crate::nl_item = 37;
pub const ABMON_7: crate::nl_item = 38;
pub const ABMON_8: crate::nl_item = 39;
pub const ABMON_9: crate::nl_item = 40;
pub const ABMON_10: crate::nl_item = 41;
pub const ABMON_11: crate::nl_item = 42;
pub const ABMON_12: crate::nl_item = 43;
pub const RADIXCHAR: crate::nl_item = 44;
pub const THOUSEP: crate::nl_item = 45;
pub const YESSTR: crate::nl_item = 46;
pub const YESEXPR: crate::nl_item = 47;
pub const NOSTR: crate::nl_item = 48;
pub const NOEXPR: crate::nl_item = 49;
pub const CRNCYSTR: crate::nl_item = 50;
pub const CODESET: crate::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 = 0o1_0000;
pub const S_IFCHR: mode_t = 0o2_0000;
pub const S_IFBLK: mode_t = 0o6_0000;
pub const S_IFDIR: mode_t = 0o4_0000;
pub const S_IFREG: mode_t = 0o10_0000;
pub const S_IFLNK: mode_t = 0o12_0000;
pub const S_IFSOCK: mode_t = 0o14_0000;
pub const S_IFMT: mode_t = 0o17_0000;
pub const S_IEXEC: mode_t = 0o0100;
pub const S_IWRITE: mode_t = 0o0200;
pub const S_IREAD: mode_t = 0o0400;
pub const S_IRWXU: mode_t = 0o0700;
pub const S_IXUSR: mode_t = 0o0100;
pub const S_IWUSR: mode_t = 0o0200;
pub const S_IRUSR: mode_t = 0o0400;
pub const S_IRWXG: mode_t = 0o0070;
pub const S_IXGRP: mode_t = 0o0010;
pub const S_IWGRP: mode_t = 0o0020;
pub const S_IRGRP: mode_t = 0o0040;
pub const S_IRWXO: mode_t = 0o0007;
pub const S_IXOTH: mode_t = 0o0001;
pub const S_IWOTH: mode_t = 0o0002;
pub const S_IROTH: mode_t = 0o0004;
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: crate::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;
// DIFF(main): changed to `c_short` in f62eb023ab
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: crate::clockid_t = 0;
pub const CLOCK_MONOTONIC: crate::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;
// sys/ioccom.h in NetBSD and OpenBSD
pub const IOCPARM_MASK: u32 = 0x1fff;
pub const IOC_VOID: c_ulong = 0x20000000;
pub const IOC_OUT: c_ulong = 0x40000000;
pub const IOC_IN: c_ulong = 0x80000000;
pub const IOC_INOUT: c_ulong = IOC_IN | IOC_OUT;
pub const IOC_DIRMASK: c_ulong = 0xe0000000;
pub const fn _IO(g: c_ulong, n: c_ulong) -> c_ulong {
_IOC(IOC_VOID, g, n, 0)
}
/// Build an ioctl number for an read-only ioctl.
pub const fn _IOR<T>(g: c_ulong, n: c_ulong) -> c_ulong {
_IOC(IOC_OUT, g, n, mem::size_of::<T>() as c_ulong)
}
/// Build an ioctl number for an write-only ioctl.
pub const fn _IOW<T>(g: c_ulong, n: c_ulong) -> c_ulong {
_IOC(IOC_IN, g, n, mem::size_of::<T>() as c_ulong)
}
/// Build an ioctl number for a read-write ioctl.
pub const fn _IOWR<T>(g: c_ulong, n: c_ulong) -> c_ulong {
_IOC(IOC_INOUT, g, n, mem::size_of::<T>() as c_ulong)
}
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 = ptr::null_mut();
pub const CRTSCTS: crate::tcflag_t = 0x00010000;
pub const CRTS_IFLOW: crate::tcflag_t = CRTSCTS;
pub const CCTS_OFLOW: crate::tcflag_t = CRTSCTS;
pub const OCRNL: crate::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 crate::sockaddr,
addrlen: *mut crate::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: crate::clockid_t, tp: *mut crate::timespec) -> c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")]
pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__clock_settime50")]
pub fn clock_settime(clk_id: crate::clockid_t, tp: *const crate::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 crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t;
pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t;
pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int;
pub fn utimensat(
dirfd: c_int,
path: *const c_char,
times: *const crate::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: crate::id_t) -> c_int;
pub fn setpriority(which: c_int, who: crate::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 crate::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: crate::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 crate::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: crate::pthread_t,
policy: c_int,
param: *const sched_param,
) -> c_int;
pub fn pthread_getschedparam(
native: crate::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: crate::gid_t,
groups: *mut crate::gid_t,
ngroups: *mut c_int,
) -> c_int;
pub fn initgroups(name: *const c_char, basegid: crate::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 crate::utsname) -> c_int;
pub fn shmget(key: crate::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 crate::shmid_ds) -> c_int;
// DIFF(main): changed to `*const *mut` in e77f551de9
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: crate::id_t,
infop: *mut crate::siginfo_t,
options: c_int,
) -> c_int;
pub fn posix_spawn(
pid: *mut crate::pid_t,
path: *const c_char,
file_actions: *const crate::posix_spawn_file_actions_t,
attrp: *const crate::posix_spawnattr_t,
argv: *const *mut c_char,
envp: *const *mut c_char,
) -> c_int;
pub fn posix_spawnp(
pid: *mut crate::pid_t,
file: *const c_char,
file_actions: *const crate::posix_spawn_file_actions_t,
attrp: *const crate::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 crate::sigset_t,
) -> c_int;
pub fn posix_spawnattr_setsigdefault(
attr: *mut posix_spawnattr_t,
default: *const crate::sigset_t,
) -> c_int;
pub fn posix_spawnattr_getsigmask(
attr: *const posix_spawnattr_t,
default: *mut crate::sigset_t,
) -> c_int;
pub fn posix_spawnattr_setsigmask(
attr: *mut posix_spawnattr_t,
default: *const crate::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 crate::pid_t,
) -> c_int;
pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::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 crate::sched_param,
) -> c_int;
pub fn posix_spawnattr_setschedparam(
attr: *mut posix_spawnattr_t,
param: *const crate::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) -> crate::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 crate::mmsghdr, vlen: c_uint, flags: c_int) -> c_int;
pub fn recvmmsg(
sockfd: c_int,
mmsg: *mut crate::mmsghdr,
vlen: c_uint,
flags: c_int,
timeout: *mut crate::timespec,
) -> c_int;
pub fn closefrom(lowfd: c_int) -> 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
}
}
+132
View File
@@ -0,0 +1,132 @@
use crate::prelude::*;
use crate::PT_FIRSTMACH;
pub type greg_t = u64;
pub type __cpu_simple_lock_nv_t = c_uchar;
s! {
pub struct __fregset {
pub __qregs: [__c_anonymous__freg; 32],
pub __fpcr: u32,
pub __fpsr: u32,
}
pub struct mcontext_t {
pub __gregs: [crate::greg_t; 32],
pub __fregs: __fregset,
__spare: [crate::greg_t; 8],
}
pub struct ucontext_t {
pub uc_flags: c_uint,
pub uc_link: *mut ucontext_t,
pub uc_sigmask: crate::sigset_t,
pub uc_stack: crate::stack_t,
pub uc_mcontext: mcontext_t,
}
}
s_no_extra_traits! {
#[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")] {
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
}
}
}
impl Eq for __c_anonymous__freg {}
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);
}
}
}
}
}
pub(crate) const _ALIGNBYTES: usize = size_of::<c_int>() - 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;
+70
View File
@@ -0,0 +1,70 @@
use crate::prelude::*;
use crate::PT_FIRSTMACH;
pub type __cpu_simple_lock_nv_t = c_int;
pub(crate) const _ALIGNBYTES: usize = size_of::<c_longlong>() - 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;
+11
View File
@@ -0,0 +1,11 @@
use crate::prelude::*;
use crate::PT_FIRSTMACH;
pub type __cpu_simple_lock_nv_t = c_int;
pub(crate) const _ALIGNBYTES: usize = size_of::<c_longlong>() - 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
+10
View File
@@ -0,0 +1,10 @@
use crate::prelude::*;
use crate::PT_FIRSTMACH;
pub type __cpu_simple_lock_nv_t = c_int;
pub(crate) const _ALIGNBYTES: usize = size_of::<c_double>() - 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;
+77
View File
@@ -0,0 +1,77 @@
use PT_FIRSTMACH;
use crate::prelude::*;
pub type __greg_t = u64;
pub type __cpu_simple_lock_nv_t = c_int;
pub type __gregset = [__greg_t; _NGREG];
pub type __fregset = [__freg; _NFREG];
s! {
pub struct mcontext_t {
pub __gregs: __gregset,
pub __fregs: __fpregset,
__spare: [crate::__greg_t; 7],
}
}
s_no_extra_traits! {
pub union __fpreg {
pub u_u64: u64,
pub u_d: c_double,
}
}
pub(crate) const _ALIGNBYTES: usize = size_of::<c_long>() - 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 _NGREG: usize = 32;
pub const _NFREG: usize = 33;
pub const _REG_X1: c_int = 0;
pub const _REG_X2: c_int = 1;
pub const _REG_X3: c_int = 2;
pub const _REG_X4: c_int = 3;
pub const _REG_X5: c_int = 4;
pub const _REG_X6: c_int = 5;
pub const _REG_X7: c_int = 6;
pub const _REG_X8: c_int = 7;
pub const _REG_X9: c_int = 8;
pub const _REG_X10: c_int = 9;
pub const _REG_X11: c_int = 10;
pub const _REG_X12: c_int = 11;
pub const _REG_X13: c_int = 12;
pub const _REG_X14: c_int = 13;
pub const _REG_X15: c_int = 14;
pub const _REG_X16: c_int = 15;
pub const _REG_X17: c_int = 16;
pub const _REG_X18: c_int = 17;
pub const _REG_X19: c_int = 18;
pub const _REG_X20: c_int = 19;
pub const _REG_X21: c_int = 20;
pub const _REG_X22: c_int = 21;
pub const _REG_X23: c_int = 22;
pub const _REG_X24: c_int = 23;
pub const _REG_X25: c_int = 24;
pub const _REG_X26: c_int = 25;
pub const _REG_X27: c_int = 26;
pub const _REG_X28: c_int = 27;
pub const _REG_X29: c_int = 28;
pub const _REG_X30: c_int = 29;
pub const _REG_X31: c_int = 30;
pub const _REG_PC: c_int = 31;
pub const _REG_RA: c_int = _REG_X1;
pub const _REG_SP: c_int = _REG_X2;
pub const _REG_GP: c_int = _REG_X3;
pub const _REG_TP: c_int = _REG_X4;
pub const _REG_S0: c_int = _REG_X8;
pub const _REG_RV: c_int = _REG_X10;
pub const _REG_A0: c_int = _REG_X10;
pub const _REG_F0: c_int = 0;
pub const _REG_FPCSR: c_int = 32;
+7
View File
@@ -0,0 +1,7 @@
use crate::prelude::*;
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;
+5
View File
@@ -0,0 +1,5 @@
use crate::prelude::*;
pub type __cpu_simple_lock_nv_t = c_uchar;
pub(crate) const _ALIGNBYTES: usize = size_of::<c_int>() - 1;
+56
View File
@@ -0,0 +1,56 @@
use crate::prelude::*;
use crate::PT_FIRSTMACH;
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 crate::ucontext_t,
pub uc_sigmask: crate::sigset_t,
pub uc_stack: crate::stack_t,
pub uc_mcontext: crate::mcontext_t,
}
}
pub(crate) const _ALIGNBYTES: usize = size_of::<c_long>() - 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;
+20
View File
@@ -0,0 +1,20 @@
use crate::prelude::*;
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,
}
}
pub(crate) const _ALIGNBYTES: usize = size_of::<c_long>() - 1;
pub const _MAX_PAGE_SHIFT: u32 = 12;
+5
View File
@@ -0,0 +1,5 @@
use crate::prelude::*;
pub(crate) const _ALIGNBYTES: usize = size_of::<c_double>() - 1;
pub const _MAX_PAGE_SHIFT: u32 = 12;
+4
View File
@@ -0,0 +1,4 @@
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 7;
pub const _MAX_PAGE_SHIFT: u32 = 14;
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,5 @@
use crate::prelude::*;
pub(crate) const _ALIGNBYTES: usize = size_of::<c_double>() - 1;
pub const _MAX_PAGE_SHIFT: u32 = 12;
@@ -0,0 +1,5 @@
use crate::prelude::*;
pub(crate) const _ALIGNBYTES: usize = size_of::<c_long>() - 1;
pub const _MAX_PAGE_SHIFT: u32 = 12;
+25
View File
@@ -0,0 +1,25 @@
use crate::prelude::*;
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,
}
}
pub(crate) const _ALIGNBYTES: usize = size_of::<c_long>() - 1;
pub const _MAX_PAGE_SHIFT: u32 = 12;
@@ -0,0 +1,4 @@
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 0xf;
pub const _MAX_PAGE_SHIFT: u32 = 13;
+5
View File
@@ -0,0 +1,5 @@
use crate::prelude::*;
pub(crate) const _ALIGNBYTES: usize = size_of::<c_int>() - 1;
pub const _MAX_PAGE_SHIFT: u32 = 12;
+109
View File
@@ -0,0 +1,109 @@
use crate::prelude::*;
use crate::PT_FIRSTMACH;
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 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);
}
}
}
}
pub(crate) const _ALIGNBYTES: usize = size_of::<c_long>() - 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;
+2477
View File
File diff suppressed because it is too large Load Diff
+18
View File
@@ -0,0 +1,18 @@
pub type time_t = i32;
pub type Elf_Addr = crate::Elf32_Addr;
pub type Elf_Half = crate::Elf32_Half;
pub type Elf_Phdr = crate::Elf32_Phdr;
s! {
pub struct Elf32_Phdr {
pub p_type: crate::Elf32_Word,
pub p_offset: crate::Elf32_Off,
pub p_vaddr: crate::Elf32_Addr,
pub p_paddr: crate::Elf32_Addr,
pub p_filesz: crate::Elf32_Word,
pub p_memsz: crate::Elf32_Word,
pub p_flags: crate::Elf32_Word,
pub p_align: crate::Elf32_Word,
}
}
+18
View File
@@ -0,0 +1,18 @@
pub type time_t = i64;
pub type Elf_Addr = crate::Elf64_Addr;
pub type Elf_Half = crate::Elf64_Half;
pub type Elf_Phdr = crate::Elf64_Phdr;
s! {
pub struct Elf64_Phdr {
pub p_type: crate::Elf64_Word,
pub p_flags: crate::Elf64_Word,
pub p_offset: crate::Elf64_Off,
pub p_vaddr: crate::Elf64_Addr,
pub p_paddr: crate::Elf64_Addr,
pub p_filesz: crate::Elf64_Xword,
pub p_memsz: crate::Elf64_Xword,
pub p_align: crate::Elf64_Xword,
}
}
+151
View File
@@ -0,0 +1,151 @@
//! This file contains the BSD APIs available in Haiku. It corresponds to the
//! header files in `headers/compatibility/bsd`.
//!
//! Note that Haiku's BSD compatibility is a combination of system APIs and
//! utility libraries. There should only be system APIs in `libc`. When you are
//! trying to determine whether something should be included in this file, the
//! best indicator is whether it also exists in the BSD-specific definitions in
//! this libc crate.
use crate::prelude::*;
// stringlist.h (utility library)
// Note: this is kept because it was previously introduced
pub type StringList = _stringlist;
s! {
// stringlist.h (utility library)
// Note: this is kept because it was previously introduced
pub struct _stringlist {
pub sl_str: *mut *mut c_char,
pub sl_max: size_t,
pub sl_cur: size_t,
}
// sys/event.h
pub struct kevent {
pub ident: crate::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],
}
// sys/link_elf.h
pub struct dl_phdr_info {
pub dlpi_addr: crate::Elf_Addr,
pub dlpi_name: *const c_char,
pub dlpi_phdr: *const crate::Elf_Phdr,
pub dlpi_phnum: crate::Elf_Half,
}
}
// sys/event.h
pub const EVFILT_READ: i16 = -1;
pub const EVFILT_WRITE: i16 = -2;
pub const EVFILT_PROC: i16 = -5;
pub const EV_ADD: u16 = 0x0001;
pub const EV_DELETE: u16 = 0x0002;
pub const EV_ONESHOT: u16 = 0x0010;
pub const EV_CLEAR: u16 = 0x0020;
pub const EV_EOF: u16 = 0x8000;
pub const EV_ERROR: u16 = 0x4000;
pub const NOTE_EXIT: u32 = 0x80000000;
// sys/ioccom.h
pub const IOC_VOID: c_ulong = 0x20000000;
pub const IOC_OUT: c_ulong = 0x40000000;
pub const IOC_IN: c_ulong = 0x80000000;
pub const IOC_INOUT: c_ulong = IOC_IN | IOC_OUT;
pub const IOC_DIRMASK: c_ulong = 0xe0000000;
#[link(name = "bsd")]
extern "C" {
// stdlib.h
pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int;
pub fn getprogname() -> *const c_char;
pub fn setprogname(progname: *const c_char);
pub fn arc4random() -> u32;
pub fn arc4random_uniform(upper_bound: u32) -> u32;
pub fn arc4random_buf(buf: *mut c_void, n: size_t);
pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int;
pub fn strtonum(
nptr: *const c_char,
minval: c_longlong,
maxval: c_longlong,
errstr: *mut *const c_char,
) -> c_longlong;
// pty.h
pub fn openpty(
amaster: *mut c_int,
aslave: *mut c_int,
name: *mut c_char,
termp: *mut crate::termios,
winp: *mut crate::winsize,
) -> c_int;
pub fn login_tty(_fd: c_int) -> c_int;
pub fn forkpty(
amaster: *mut c_int,
name: *mut c_char,
termp: *mut crate::termios,
winp: *mut crate::winsize,
) -> crate::pid_t;
// string.h
pub fn strsep(string: *mut *mut c_char, delimiters: *const c_char) -> *mut c_char;
pub fn explicit_bzero(buf: *mut c_void, len: size_t);
// stringlist.h (utility library)
// Note: this is kept because it was previously introduced
pub fn sl_init() -> *mut StringList;
pub fn sl_add(sl: *mut StringList, n: *mut c_char) -> c_int;
pub fn sl_free(sl: *mut StringList, i: c_int);
pub fn sl_find(sl: *mut StringList, n: *mut c_char) -> *mut c_char;
// sys/event.h
pub fn kqueue() -> c_int;
pub fn kevent(
kq: c_int,
changelist: *const kevent,
nchanges: c_int,
eventlist: *mut kevent,
nevents: c_int,
timeout: *const crate::timespec,
) -> c_int;
// sys/link_elf.h
pub fn dl_iterate_phdr(
callback: Option<
unsafe extern "C" fn(info: *mut dl_phdr_info, size: usize, data: *mut c_void) -> c_int,
>,
data: *mut c_void,
) -> c_int;
// sys/time.h
pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int;
// sys/uov.h
pub fn preadv(
fd: c_int,
iov: *const crate::iovec,
iovcnt: c_int,
offset: crate::off_t,
) -> ssize_t;
pub fn pwritev(
fd: c_int,
iov: *const crate::iovec,
iovcnt: c_int,
offset: crate::off_t,
) -> ssize_t;
// sys/wait.h
pub fn wait4(
pid: crate::pid_t,
status: *mut c_int,
options: c_int,
rusage: *mut crate::rusage,
) -> crate::pid_t;
}
+2097
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+208
View File
@@ -0,0 +1,208 @@
use crate::prelude::*;
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: crate::sigset_t,
pub uc_stack: crate::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 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 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 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 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 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);
}
}
}
}
+92
View File
@@ -0,0 +1,92 @@
use crate::prelude::*;
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 = crate::__int64_t;
pub type __uquad_type = crate::__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 = crate::__int64_t;
pub type __u64_type = crate::__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 = crate::Elf32_Addr;
pub type Elf_Half = crate::Elf32_Half;
pub type Elf_Ehdr = crate::Elf32_Ehdr;
pub type Elf_Phdr = crate::Elf32_Phdr;
pub type Elf_Shdr = crate::Elf32_Shdr;
pub type Elf_Sym = crate::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: crate::Elf32_Word,
pub p_offset: crate::Elf32_Off,
pub p_vaddr: crate::Elf32_Addr,
pub p_paddr: crate::Elf32_Addr,
pub p_filesz: crate::Elf32_Word,
pub p_memsz: crate::Elf32_Word,
pub p_flags: crate::Elf32_Word,
pub p_align: crate::Elf32_Word,
}
}
+94
View File
@@ -0,0 +1,94 @@
use crate::prelude::*;
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 = crate::Elf64_Addr;
pub type Elf_Half = crate::Elf64_Half;
pub type Elf_Ehdr = crate::Elf64_Ehdr;
pub type Elf_Phdr = crate::Elf64_Phdr;
pub type Elf_Shdr = crate::Elf64_Shdr;
pub type Elf_Sym = crate::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: crate::Elf64_Word,
pub p_flags: crate::Elf64_Word,
pub p_offset: crate::Elf64_Off,
pub p_vaddr: crate::Elf64_Addr,
pub p_paddr: crate::Elf64_Addr,
pub p_filesz: crate::Elf64_Xword,
pub p_memsz: crate::Elf64_Xword,
pub p_align: crate::Elf64_Xword,
}
}
+4623
View File
File diff suppressed because it is too large Load Diff
+532
View File
@@ -0,0 +1,532 @@
use crate::prelude::*;
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,
}
}
s_no_extra_traits! {
pub struct __c_anonymous_uc_sigmask_with_padding {
pub uc_sigmask: crate::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: crate::sigset64_t,
}
pub struct ucontext_t {
pub uc_flags: c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: crate::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 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 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 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;
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;
// 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 crate::sockaddr,
len: *mut crate::socklen_t,
flg: c_int,
) -> c_int {
crate::syscall(SYS_accept4, fd, addr, len, flg) as c_int
}
}
+239
View File
@@ -0,0 +1,239 @@
use crate::prelude::*;
// The following definitions are correct for arm and i686,
// but may be wrong for mips
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;
pub type __s64 = c_longlong;
s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
pub sa_flags: c_int,
pub sa_restorer: Option<extern "C" 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: crate::ino_t,
pub st_mode: c_uint,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: c_ulonglong,
__pad3: [c_uchar; 4],
pub st_size: c_longlong,
pub st_blksize: crate::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: crate::ino_t,
pub st_mode: c_uint,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: c_ulonglong,
__pad3: [c_uchar; 4],
pub st_size: c_longlong,
pub st_blksize: crate::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: crate::__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: crate::uid_t,
pub pw_gid: crate::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: crate::__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],
}
}
// 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 crate::tm) -> crate::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
}
}
+604
View File
@@ -0,0 +1,604 @@
use crate::prelude::*;
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,
}
}
s_no_extra_traits! {
pub struct __c_anonymous_uc_sigmask_with_padding {
pub uc_sigmask: crate::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: crate::sigset64_t,
}
pub struct ucontext_t {
pub uc_flags: c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: crate::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,
}
#[repr(align(8))]
pub struct max_align_t {
priv_: [f64; 2],
}
}
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 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 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 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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 127;
pub const SYS_init_module: c_long = 128;
pub const SYS_delete_module: c_long = 129;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
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(android): 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(android): 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(android): 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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
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;
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;
// 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 crate::sockaddr,
len: *mut crate::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];
crate::syscall(SYS_socketcall, SYS_ACCEPT4, args[..].as_mut_ptr())
}
}
@@ -0,0 +1,473 @@
use crate::off64_t;
use crate::prelude::*;
pub type wchar_t = u32;
pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;
s! {
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: c_uint,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::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: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__unused4: c_uint,
__unused5: c_uint,
}
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: c_uint,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::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: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::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 struct ucontext_t {
pub uc_flags: c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: crate::stack_t,
pub uc_sigmask: crate::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,
__reserved: [u64; 512],
}
pub struct user_fpsimd_struct {
pub vregs: [crate::__uint128_t; 32],
pub fpsr: u32,
pub fpcr: u32,
}
}
s_no_extra_traits! {
#[repr(align(16))]
pub struct max_align_t {
priv_: [f32; 8],
}
}
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_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_syscalls: c_long = 451;
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;
+292
View File
@@ -0,0 +1,292 @@
use crate::prelude::*;
// The following definitions are correct for aarch64 and x86_64,
// but may be wrong for mips64
pub type mode_t = u32;
pub type off64_t = i64;
pub type socklen_t = u32;
s! {
pub struct sigset_t {
__val: [c_ulong; 1],
}
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_flags: c_int,
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
pub sa_restorer: Option<extern "C" 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: crate::uid_t,
pub pw_gid: crate::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: crate::__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: crate::__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 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 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 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);
}
}
}
}
// 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 = ptr::null_mut();
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 crate::sockaddr,
len: *mut crate::socklen_t,
flg: c_int,
) -> c_int {
crate::syscall(SYS_accept4, fd, addr, len, flg) as c_int
}
}
extern "C" {
pub fn __system_property_wait(
pi: *const crate::prop_info,
__old_serial: u32,
__new_serial_ptr: *mut u32,
__relative_timeout: *const crate::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
}
}
@@ -0,0 +1,384 @@
use crate::off64_t;
use crate::prelude::*;
pub type wchar_t = u32;
pub type greg_t = i64;
pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;
s! {
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: c_uint,
pub st_nlink: c_uint,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::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: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__unused4: c_uint,
__unused5: c_uint,
}
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: c_uint,
pub st_nlink: c_uint,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::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: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__unused4: c_uint,
__unused5: c_uint,
}
}
s_no_extra_traits! {
#[repr(align(16))]
pub struct max_align_t {
priv_: [f32; 8],
}
}
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_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;
// 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;
@@ -0,0 +1,748 @@
use crate::off64_t;
use crate::prelude::*;
pub type wchar_t = i32;
pub type greg_t = i64;
pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;
s! {
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_nlink: c_ulong,
pub st_mode: c_uint,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::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: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_nlink: c_ulong,
pub st_mode: c_uint,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::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,
}
}
s_no_extra_traits! {
pub union __c_anonymous_uc_sigmask {
uc_sigmask: crate::sigset_t,
uc_sigmask64: crate::sigset64_t,
}
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 4],
}
}
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 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: crate::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 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 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 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 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 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(android): 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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 174;
pub const SYS_init_module: c_long = 175;
pub const SYS_delete_module: c_long = 176;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_get_kernel_syms: c_long = 177;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
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;
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;
// 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;
File diff suppressed because it is too large Load Diff
+211
View File
@@ -0,0 +1,211 @@
use crate::off64_t;
use crate::prelude::*;
// 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: crate::mode_t) -> c_int {
crate::creat(path, mode)
}
#[inline]
pub unsafe extern "C" fn fgetpos64(stream: *mut crate::FILE, pos: *mut crate::fpos64_t) -> c_int {
crate::fgetpos(stream, pos as *mut _)
}
#[inline]
pub unsafe extern "C" fn fopen64(pathname: *const c_char, mode: *const c_char) -> *mut crate::FILE {
crate::fopen(pathname, mode)
}
#[inline]
pub unsafe extern "C" fn freopen64(
pathname: *const c_char,
mode: *const c_char,
stream: *mut crate::FILE,
) -> *mut crate::FILE {
crate::freopen(pathname, mode, stream)
}
#[inline]
pub unsafe extern "C" fn fseeko64(
stream: *mut crate::FILE,
offset: off64_t,
whence: c_int,
) -> c_int {
crate::fseeko(stream, offset, whence)
}
#[inline]
pub unsafe extern "C" fn fsetpos64(stream: *mut crate::FILE, pos: *const crate::fpos64_t) -> c_int {
crate::fsetpos(stream, pos as *mut _)
}
#[inline]
pub unsafe extern "C" fn fstat64(fildes: c_int, buf: *mut crate::stat64) -> c_int {
crate::fstat(fildes, buf as *mut _)
}
#[inline]
pub unsafe extern "C" fn fstatat64(
fd: c_int,
path: *const c_char,
buf: *mut crate::stat64,
flag: c_int,
) -> c_int {
crate::fstatat(fd, path, buf as *mut _, flag)
}
#[inline]
pub unsafe extern "C" fn fstatfs64(fd: c_int, buf: *mut crate::statfs64) -> c_int {
crate::fstatfs(fd, buf as *mut _)
}
#[inline]
pub unsafe extern "C" fn fstatvfs64(fd: c_int, buf: *mut crate::statvfs64) -> c_int {
crate::fstatvfs(fd, buf as *mut _)
}
#[inline]
pub unsafe extern "C" fn ftello64(stream: *mut crate::FILE) -> off64_t {
crate::ftello(stream)
}
#[inline]
pub unsafe extern "C" fn ftruncate64(fd: c_int, length: off64_t) -> c_int {
crate::ftruncate(fd, length)
}
#[inline]
pub unsafe extern "C" fn getrlimit64(resource: c_int, rlim: *mut crate::rlimit64) -> c_int {
crate::getrlimit(resource, rlim as *mut _)
}
#[inline]
pub unsafe extern "C" fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> off64_t {
crate::lseek(fd, offset, whence)
}
#[inline]
pub unsafe extern "C" fn lstat64(path: *const c_char, buf: *mut crate::stat64) -> c_int {
crate::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 {
crate::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 crate::{open as open64, 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 {
crate::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 {
crate::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 {
crate::pread(fd, buf, count, offset)
}
#[inline]
pub unsafe extern "C" fn preadv64(
fd: c_int,
iov: *const crate::iovec,
iovcnt: c_int,
offset: off64_t,
) -> ssize_t {
crate::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 {
crate::pwrite(fd, buf, count, offset)
}
#[inline]
pub unsafe extern "C" fn pwritev64(
fd: c_int,
iov: *const crate::iovec,
iovcnt: c_int,
offset: off64_t,
) -> ssize_t {
crate::pwritev(fd, iov, iovcnt, offset)
}
#[inline]
pub unsafe extern "C" fn readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent64 {
crate::readdir(dirp) as *mut _
}
#[inline]
pub unsafe extern "C" fn readdir64_r(
dirp: *mut crate::DIR,
entry: *mut crate::dirent64,
result: *mut *mut crate::dirent64,
) -> c_int {
crate::readdir_r(dirp, entry as *mut _, result as *mut _)
}
#[inline]
pub unsafe extern "C" fn setrlimit64(resource: c_int, rlim: *const crate::rlimit64) -> c_int {
crate::setrlimit(resource, rlim as *mut _)
}
#[inline]
pub unsafe extern "C" fn stat64(pathname: *const c_char, statbuf: *mut crate::stat64) -> c_int {
crate::stat(pathname, statbuf as *mut _)
}
#[inline]
pub unsafe extern "C" fn statfs64(pathname: *const c_char, buf: *mut crate::statfs64) -> c_int {
crate::statfs(pathname, buf as *mut _)
}
#[inline]
pub unsafe extern "C" fn statvfs64(path: *const c_char, buf: *mut crate::statvfs64) -> c_int {
crate::statvfs(path, buf as *mut _)
}
#[inline]
pub unsafe extern "C" fn tmpfile64() -> *mut crate::FILE {
crate::tmpfile()
}
#[inline]
pub unsafe extern "C" fn truncate64(path: *const c_char, length: off64_t) -> c_int {
crate::truncate(path, length)
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,334 @@
use crate::prelude::*;
use crate::Ioctl;
s! {
pub struct termios2 {
pub c_iflag: crate::tcflag_t,
pub c_oflag: crate::tcflag_t,
pub c_cflag: crate::tcflag_t,
pub c_lflag: crate::tcflag_t,
pub c_line: crate::cc_t,
pub c_cc: [crate::cc_t; 19],
pub c_ispeed: crate::speed_t,
pub c_ospeed: crate::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_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;
cfg_if! {
if #[cfg(all(
linux_time_bits64,
any(target_arch = "arm", target_arch = "x86"),
not(any(target_env = "musl", target_env = "ohos"))
))] {
pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_NEW;
pub const SO_TIMESTAMPNS: c_int = SO_TIMESTAMPNS_NEW;
pub const SO_TIMESTAMPING: c_int = SO_TIMESTAMPING_NEW;
pub const SO_RCVTIMEO: c_int = SO_RCVTIMEO_NEW;
pub const SO_SNDTIMEO: c_int = SO_SNDTIMEO_NEW;
} else if #[cfg(all(
linux_time_bits64,
any(target_arch = "arm", target_arch = "x86"),
any(target_env = "musl", target_env = "ohos")
))] {
pub const SO_TIMESTAMP: c_int = 63;
pub const SO_TIMESTAMPNS: c_int = 64;
pub const SO_TIMESTAMPING: c_int = 65;
pub const SO_RCVTIMEO: c_int = 66;
pub const SO_SNDTIMEO: c_int = 67;
} else {
const SO_TIMESTAMP_OLD: c_int = 29;
const SO_TIMESTAMPNS_OLD: c_int = 35;
const SO_TIMESTAMPING_OLD: c_int = 37;
const SO_RCVTIMEO_OLD: c_int = 20;
const SO_SNDTIMEO_OLD: c_int = 21;
pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_OLD;
pub const SO_TIMESTAMPNS: c_int = SO_TIMESTAMPNS_OLD;
pub const SO_TIMESTAMPING: c_int = SO_TIMESTAMPING_OLD;
pub const SO_RCVTIMEO: c_int = SO_RCVTIMEO_OLD;
pub const SO_SNDTIMEO: c_int = SO_SNDTIMEO_OLD;
}
}
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_MARK: c_int = 36;
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 = "arm",
target_arch = "aarch64",
target_arch = "csky",
target_arch = "loongarch64"
),
// FIXME(musl):
// Musl hardcodes the SO_* constants instead
// of inheriting them from the kernel headers.
// For new constants you might need consider updating
// musl in the CI as well.
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;
pub const SO_NETNS_COOKIE: c_int = 71;
pub const SO_BUF_LOCK: c_int = 72;
pub const SO_RESERVE_MEM: c_int = 73;
pub const SO_TXREHASH: c_int = 74;
pub const SO_RCVMARK: c_int = 75;
pub const SO_PASSPIDFD: c_int = 76;
pub const SO_PEERPIDFD: c_int = 77;
pub const SO_DEVMEM_LINEAR: c_int = 78;
pub const SO_DEVMEM_DMABUF: c_int = 79;
pub const SO_DEVMEM_DONTNEED: c_int = 80;
// 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;
pub const SCM_DEVMEM_LINEAR: c_int = SO_DEVMEM_LINEAR;
pub const SCM_DEVMEM_DMABUF: c_int = SO_DEVMEM_DMABUF;
// 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! {
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: crate::speed_t = 0o010000;
pub const IBSHIFT: crate::tcflag_t = 16;
// RLIMIT Constants
cfg_if! {
if #[cfg(any(target_env = "gnu", target_env = "uclibc"))] {
pub const RLIMIT_CPU: crate::__rlimit_resource_t = 0;
pub const RLIMIT_FSIZE: crate::__rlimit_resource_t = 1;
pub const RLIMIT_DATA: crate::__rlimit_resource_t = 2;
pub const RLIMIT_STACK: crate::__rlimit_resource_t = 3;
pub const RLIMIT_CORE: crate::__rlimit_resource_t = 4;
pub const RLIMIT_RSS: crate::__rlimit_resource_t = 5;
pub const RLIMIT_NPROC: crate::__rlimit_resource_t = 6;
pub const RLIMIT_NOFILE: crate::__rlimit_resource_t = 7;
pub const RLIMIT_MEMLOCK: crate::__rlimit_resource_t = 8;
pub const RLIMIT_AS: crate::__rlimit_resource_t = 9;
pub const RLIMIT_LOCKS: crate::__rlimit_resource_t = 10;
pub const RLIMIT_SIGPENDING: crate::__rlimit_resource_t = 11;
pub const RLIMIT_MSGQUEUE: crate::__rlimit_resource_t = 12;
pub const RLIMIT_NICE: crate::__rlimit_resource_t = 13;
pub const RLIMIT_RTPRIO: crate::__rlimit_resource_t = 14;
pub const RLIMIT_RTTIME: crate::__rlimit_resource_t = 15;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: crate::__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 = 16;
#[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: crate::__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: crate::__rlimit_resource_t = 15;
}
}
pub const RLIM_INFINITY: crate::rlim_t = !0;
+333
View File
@@ -0,0 +1,333 @@
use crate::prelude::*;
use crate::Ioctl;
s! {
pub struct termios2 {
pub c_iflag: crate::tcflag_t,
pub c_oflag: crate::tcflag_t,
pub c_cflag: crate::tcflag_t,
pub c_lflag: crate::tcflag_t,
pub c_line: crate::cc_t,
pub c_cc: [crate::cc_t; 23],
pub c_ispeed: crate::speed_t,
pub c_ospeed: crate::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;
cfg_if! {
if #[cfg(linux_time_bits64)] {
const SO_RCVTIMEO_NEW: c_int = 66;
const SO_SNDTIMEO_NEW: c_int = 67;
pub const SO_SNDTIMEO: c_int = SO_SNDTIMEO_NEW;
pub const SO_RCVTIMEO: c_int = SO_RCVTIMEO_NEW;
} else {
const SO_SNDTIMEO_OLD: c_int = 0x1005;
const SO_RCVTIMEO_OLD: c_int = 0x1006;
pub const SO_SNDTIMEO: c_int = SO_SNDTIMEO_OLD;
pub const SO_RCVTIMEO: c_int = SO_RCVTIMEO_OLD;
}
}
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;
cfg_if! {
if #[cfg(linux_time_bits64)] {
const SO_TIMESTAMP_NEW: c_int = 63;
const SO_TIMESTAMPNS_NEW: c_int = 64;
const SO_TIMESTAMPING_NEW: c_int = 65;
pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_NEW;
pub const SO_TIMESTAMPNS: c_int = SO_TIMESTAMPNS_NEW;
pub const SO_TIMESTAMPING: c_int = SO_TIMESTAMPING_NEW;
} else {
const SO_TIMESTAMP_OLD: c_int = 29;
const SO_TIMESTAMPNS_OLD: c_int = 35;
const SO_TIMESTAMPING_OLD: c_int = 37;
pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_OLD;
pub const SO_TIMESTAMPNS: c_int = SO_TIMESTAMPNS_OLD;
pub const SO_TIMESTAMPING: c_int = SO_TIMESTAMPING_OLD;
}
}
// 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 SO_NETNS_COOKIE: c_int = 71;
pub const SO_BUF_LOCK: c_int = 72;
pub const SO_RESERVE_MEM: c_int = 73;
pub const SO_TXREHASH: c_int = 74;
pub const SO_RCVMARK: c_int = 75;
pub const SO_PASSPIDFD: c_int = 76;
pub const SO_PEERPIDFD: c_int = 77;
pub const SO_DEVMEM_LINEAR: c_int = 78;
pub const SO_DEVMEM_DMABUF: c_int = 79;
pub const SO_DEVMEM_DONTNEED: c_int = 80;
// 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;
pub const SCM_DEVMEM_LINEAR: c_int = SO_DEVMEM_LINEAR;
pub const SCM_DEVMEM_DMABUF: c_int = SO_DEVMEM_DMABUF;
// 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! {
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: crate::speed_t = 0o010000;
pub const IBSHIFT: crate::tcflag_t = 16;
// RLIMIT Constants
cfg_if! {
if #[cfg(any(target_env = "gnu", target_env = "uclibc"))] {
pub const RLIMIT_CPU: crate::__rlimit_resource_t = 0;
pub const RLIMIT_FSIZE: crate::__rlimit_resource_t = 1;
pub const RLIMIT_DATA: crate::__rlimit_resource_t = 2;
pub const RLIMIT_STACK: crate::__rlimit_resource_t = 3;
pub const RLIMIT_CORE: crate::__rlimit_resource_t = 4;
pub const RLIMIT_NOFILE: crate::__rlimit_resource_t = 5;
pub const RLIMIT_AS: crate::__rlimit_resource_t = 6;
pub const RLIMIT_RSS: crate::__rlimit_resource_t = 7;
pub const RLIMIT_NPROC: crate::__rlimit_resource_t = 8;
pub const RLIMIT_MEMLOCK: crate::__rlimit_resource_t = 9;
pub const RLIMIT_LOCKS: crate::__rlimit_resource_t = 10;
pub const RLIMIT_SIGPENDING: crate::__rlimit_resource_t = 11;
pub const RLIMIT_MSGQUEUE: crate::__rlimit_resource_t = 12;
pub const RLIMIT_NICE: crate::__rlimit_resource_t = 13;
pub const RLIMIT_RTPRIO: crate::__rlimit_resource_t = 14;
pub const RLIMIT_RTTIME: crate::__rlimit_resource_t = 15;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: crate::__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 = 16;
#[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: crate::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: crate::__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: crate::__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: crate::rlim_t = !0;
}
}
cfg_if! {
if #[cfg(all(
any(target_arch = "mips", target_arch = "mips32r6"),
any(
all(target_env = "uclibc", linux_time_bits64),
all(
target_env = "gnu",
any(linux_time_bits64, gnu_file_offset_bits64)
)
)
))] {
pub const RLIM_INFINITY: crate::rlim_t = !0;
} else if #[cfg(all(
any(target_arch = "mips", target_arch = "mips32r6"),
any(target_env = "uclibc", target_env = "gnu"),
not(linux_time_bits64)
))] {
pub const RLIM_INFINITY: crate::rlim_t = 0x7fffffff;
}
}
+20
View File
@@ -0,0 +1,20 @@
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::*;
}
}
@@ -0,0 +1,280 @@
use crate::prelude::*;
use crate::Ioctl;
// 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;
cfg_if! {
if #[cfg(linux_time_bits64)] {
const SO_RCVTIMEO_NEW: c_int = 66;
const SO_SNDTIMEO_NEW: c_int = 67;
pub const SO_RCVTIMEO: c_int = SO_RCVTIMEO_NEW;
pub const SO_SNDTIMEO: c_int = SO_SNDTIMEO_NEW;
} else {
const SO_RCVTIMEO_OLD: c_int = 18;
const SO_SNDTIMEO_OLD: c_int = 19;
pub const SO_RCVTIMEO: c_int = SO_RCVTIMEO_OLD;
pub const SO_SNDTIMEO: c_int = SO_SNDTIMEO_OLD;
}
}
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;
cfg_if! {
if #[cfg(linux_time_bits64)] {
const SO_TIMESTAMP_NEW: c_int = 63;
const SO_TIMESTAMPNS_NEW: c_int = 64;
const SO_TIMESTAMPING_NEW: c_int = 65;
pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_NEW;
pub const SO_TIMESTAMPNS: c_int = SO_TIMESTAMPNS_NEW;
pub const SO_TIMESTAMPING: c_int = SO_TIMESTAMPING_NEW;
} else {
const SO_TIMESTAMP_OLD: c_int = 29;
const SO_TIMESTAMPNS_OLD: c_int = 35;
const SO_TIMESTAMPING_OLD: c_int = 37;
pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_OLD;
pub const SO_TIMESTAMPNS: c_int = SO_TIMESTAMPNS_OLD;
pub const SO_TIMESTAMPING: c_int = SO_TIMESTAMPING_OLD;
}
}
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_MARK: c_int = 36;
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_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 SO_NETNS_COOKIE: c_int = 71;
pub const SO_BUF_LOCK: c_int = 72;
pub const SO_RESERVE_MEM: c_int = 73;
pub const SO_TXREHASH: c_int = 74;
pub const SO_RCVMARK: c_int = 75;
pub const SO_PASSPIDFD: c_int = 76;
pub const SO_PEERPIDFD: c_int = 77;
pub const SO_DEVMEM_LINEAR: c_int = 78;
pub const SO_DEVMEM_DMABUF: c_int = 79;
pub const SO_DEVMEM_DONTNEED: c_int = 80;
// 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;
pub const SCM_DEVMEM_LINEAR: c_int = SO_DEVMEM_LINEAR;
pub const SCM_DEVMEM_DMABUF: c_int = SO_DEVMEM_DMABUF;
// 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;
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: crate::speed_t = 0o0037;
pub const IBSHIFT: crate::tcflag_t = 16;
// RLIMIT Constants
cfg_if! {
if #[cfg(target_env = "gnu")] {
pub const RLIMIT_CPU: crate::__rlimit_resource_t = 0;
pub const RLIMIT_FSIZE: crate::__rlimit_resource_t = 1;
pub const RLIMIT_DATA: crate::__rlimit_resource_t = 2;
pub const RLIMIT_STACK: crate::__rlimit_resource_t = 3;
pub const RLIMIT_CORE: crate::__rlimit_resource_t = 4;
pub const RLIMIT_RSS: crate::__rlimit_resource_t = 5;
pub const RLIMIT_NPROC: crate::__rlimit_resource_t = 6;
pub const RLIMIT_NOFILE: crate::__rlimit_resource_t = 7;
pub const RLIMIT_MEMLOCK: crate::__rlimit_resource_t = 8;
pub const RLIMIT_AS: crate::__rlimit_resource_t = 9;
pub const RLIMIT_LOCKS: crate::__rlimit_resource_t = 10;
pub const RLIMIT_SIGPENDING: crate::__rlimit_resource_t = 11;
pub const RLIMIT_MSGQUEUE: crate::__rlimit_resource_t = 12;
pub const RLIMIT_NICE: crate::__rlimit_resource_t = 13;
pub const RLIMIT_RTPRIO: crate::__rlimit_resource_t = 14;
pub const RLIMIT_RTTIME: crate::__rlimit_resource_t = 15;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: crate::__rlimit_resource_t = 16;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: crate::__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 = 16;
#[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: crate::rlim_t = !0;
+247
View File
@@ -0,0 +1,247 @@
use crate::prelude::*;
use crate::Ioctl;
s! {
pub struct termios2 {
pub c_iflag: crate::tcflag_t,
pub c_oflag: crate::tcflag_t,
pub c_cflag: crate::tcflag_t,
pub c_lflag: crate::tcflag_t,
pub c_line: crate::cc_t,
pub c_cc: [crate::cc_t; 19],
pub c_ispeed: crate::speed_t,
pub c_ospeed: crate::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;
pub const SO_NETNS_COOKIE: c_int = 0x0050;
pub const SO_BUF_LOCK: c_int = 0x0051;
pub const SO_RESERVE_MEM: c_int = 0x0052;
pub const SO_TXREHASH: c_int = 0x0053;
pub const SO_RCVMARK: c_int = 0x0054;
pub const SO_PASSPIDFD: c_int = 0x0055;
pub const SO_PEERPIDFD: c_int = 0x0056;
pub const SO_DEVMEM_LINEAR: c_int = 0x0057;
pub const SO_DEVMEM_DMABUF: c_int = 0x0058;
pub const SO_DEVMEM_DONTNEED: c_int = 0x0059;
// 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;
pub const SCM_DEVMEM_LINEAR: c_int = SO_DEVMEM_LINEAR;
pub const SCM_DEVMEM_DMABUF: c_int = SO_DEVMEM_DMABUF;
// 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: crate::speed_t = 0x1000;
pub const IBSHIFT: crate::tcflag_t = 16;
// RLIMIT Constants
pub const RLIMIT_CPU: crate::__rlimit_resource_t = 0;
pub const RLIMIT_FSIZE: crate::__rlimit_resource_t = 1;
pub const RLIMIT_DATA: crate::__rlimit_resource_t = 2;
pub const RLIMIT_STACK: crate::__rlimit_resource_t = 3;
pub const RLIMIT_CORE: crate::__rlimit_resource_t = 4;
pub const RLIMIT_RSS: crate::__rlimit_resource_t = 5;
pub const RLIMIT_NOFILE: crate::__rlimit_resource_t = 6;
pub const RLIMIT_NPROC: crate::__rlimit_resource_t = 7;
pub const RLIMIT_MEMLOCK: crate::__rlimit_resource_t = 8;
pub const RLIMIT_AS: crate::__rlimit_resource_t = 9;
pub const RLIMIT_LOCKS: crate::__rlimit_resource_t = 10;
pub const RLIMIT_SIGPENDING: crate::__rlimit_resource_t = 11;
pub const RLIMIT_MSGQUEUE: crate::__rlimit_resource_t = 12;
pub const RLIMIT_NICE: crate::__rlimit_resource_t = 13;
pub const RLIMIT_RTPRIO: crate::__rlimit_resource_t = 14;
pub const RLIMIT_RTTIME: crate::__rlimit_resource_t = 15;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: crate::__rlimit_resource_t = 16;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: crate::__rlimit_resource_t = RLIM_NLIMITS;
cfg_if! {
if #[cfg(target_arch = "sparc64")] {
pub const RLIM_INFINITY: crate::rlim_t = !0;
} else if #[cfg(target_arch = "sparc")] {
pub const RLIM_INFINITY: crate::rlim_t = 0x7fffffff;
}
}
+928
View File
@@ -0,0 +1,928 @@
use crate::prelude::*;
use crate::{off64_t, off_t};
pub type wchar_t = u32;
s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
pub sa_flags: c_int,
pub sa_restorer: Option<extern "C" fn()>,
}
pub struct statfs {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__fsword_t,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
f_spare: [crate::__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: crate::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: crate::pid_t,
}
pub struct ipc_perm {
pub __key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::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: crate::dev_t,
#[cfg(not(gnu_time_bits64))]
__pad1: c_uint,
#[cfg(not(gnu_time_bits64))]
__st_ino: c_ulong,
#[cfg(gnu_time_bits64)]
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
#[cfg(not(gnu_time_bits64))]
__pad2: c_uint,
pub st_size: off64_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt64_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
#[cfg(gnu_time_bits64)]
_atime_pad: c_int,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
#[cfg(gnu_time_bits64)]
_mtime_pad: c_int,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
#[cfg(gnu_time_bits64)]
_ctime_pad: c_int,
#[cfg(not(gnu_time_bits64))]
pub st_ino: crate::ino64_t,
}
pub struct statfs64 {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__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: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
pub f_spare: [crate::__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: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_atime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__unused1: c_ulong,
pub shm_dtime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__unused2: c_ulong,
pub shm_ctime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__unused3: c_ulong,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__unused4: c_ulong,
__unused5: c_ulong,
}
pub struct msqid_ds {
pub msg_perm: crate::ipc_perm,
pub msg_stime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved1: c_ulong,
pub msg_rtime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved2: c_ulong,
pub msg_ctime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved3: c_ulong,
pub __msg_cbytes: c_ulong,
pub msg_qnum: crate::msgqnum_t,
pub msg_qbytes: crate::msglen_t,
pub msg_lspid: crate::pid_t,
pub msg_lrpid: crate::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,
}
}
s_no_extra_traits! {
#[repr(align(8))]
pub struct max_align_t {
priv_: [i64; 2],
}
#[repr(align(8))]
pub struct ucontext_t {
pub uc_flags: c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: crate::stack_t,
pub uc_mcontext: crate::mcontext_t,
pub uc_sigmask: crate::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 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);
}
}
}
}
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;
cfg_if! {
if #[cfg(gnu_file_offset_bits64)] {
pub const F_GETLK: c_int = 12;
} else {
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: crate::tcflag_t = 0o0010017;
pub const TAB1: crate::tcflag_t = 0x00000800;
pub const TAB2: crate::tcflag_t = 0x00001000;
pub const TAB3: crate::tcflag_t = 0x00001800;
pub const CR1: crate::tcflag_t = 0x00000200;
pub const CR2: crate::tcflag_t = 0x00000400;
pub const CR3: crate::tcflag_t = 0x00000600;
pub const FF1: crate::tcflag_t = 0x00008000;
pub const BS1: crate::tcflag_t = 0x00002000;
pub const VT1: crate::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: crate::tcflag_t = 0x00000400;
pub const IXOFF: crate::tcflag_t = 0x00001000;
pub const ONLCR: crate::tcflag_t = 0x4;
pub const CSIZE: crate::tcflag_t = 0x00000030;
pub const CS6: crate::tcflag_t = 0x00000010;
pub const CS7: crate::tcflag_t = 0x00000020;
pub const CS8: crate::tcflag_t = 0x00000030;
pub const CSTOPB: crate::tcflag_t = 0x00000040;
pub const CREAD: crate::tcflag_t = 0x00000080;
pub const PARENB: crate::tcflag_t = 0x00000100;
pub const PARODD: crate::tcflag_t = 0x00000200;
pub const HUPCL: crate::tcflag_t = 0x00000400;
pub const CLOCAL: crate::tcflag_t = 0x00000800;
pub const ECHOKE: crate::tcflag_t = 0x00000800;
pub const ECHOE: crate::tcflag_t = 0x00000010;
pub const ECHOK: crate::tcflag_t = 0x00000020;
pub const ECHONL: crate::tcflag_t = 0x00000040;
pub const ECHOPRT: crate::tcflag_t = 0x00000400;
pub const ECHOCTL: crate::tcflag_t = 0x00000200;
pub const ISIG: crate::tcflag_t = 0x00000001;
pub const ICANON: crate::tcflag_t = 0x00000002;
pub const PENDIN: crate::tcflag_t = 0x00004000;
pub const NOFLSH: crate::tcflag_t = 0x00000080;
pub const CIBAUD: crate::tcflag_t = 0o02003600000;
pub const CBAUDEX: crate::tcflag_t = 0o010000;
pub const VSWTC: usize = 7;
pub const OLCUC: crate::tcflag_t = 0o000002;
pub const NLDLY: crate::tcflag_t = 0o000400;
pub const CRDLY: crate::tcflag_t = 0o003000;
pub const TABDLY: crate::tcflag_t = 0o014000;
pub const BSDLY: crate::tcflag_t = 0o020000;
pub const FFDLY: crate::tcflag_t = 0o100000;
pub const VTDLY: crate::tcflag_t = 0o040000;
pub const XTABS: crate::tcflag_t = 0o014000;
pub const B0: crate::speed_t = 0o000000;
pub const B50: crate::speed_t = 0o000001;
pub const B75: crate::speed_t = 0o000002;
pub const B110: crate::speed_t = 0o000003;
pub const B134: crate::speed_t = 0o000004;
pub const B150: crate::speed_t = 0o000005;
pub const B200: crate::speed_t = 0o000006;
pub const B300: crate::speed_t = 0o000007;
pub const B600: crate::speed_t = 0o000010;
pub const B1200: crate::speed_t = 0o000011;
pub const B1800: crate::speed_t = 0o000012;
pub const B2400: crate::speed_t = 0o000013;
pub const B4800: crate::speed_t = 0o000014;
pub const B9600: crate::speed_t = 0o000015;
pub const B19200: crate::speed_t = 0o000016;
pub const B38400: crate::speed_t = 0o000017;
pub const EXTA: crate::speed_t = B19200;
pub const EXTB: crate::speed_t = B38400;
pub const B57600: crate::speed_t = 0o010001;
pub const B115200: crate::speed_t = 0o010002;
pub const B230400: crate::speed_t = 0o010003;
pub const B460800: crate::speed_t = 0o010004;
pub const B500000: crate::speed_t = 0o010005;
pub const B576000: crate::speed_t = 0o010006;
pub const B921600: crate::speed_t = 0o010007;
pub const B1000000: crate::speed_t = 0o010010;
pub const B1152000: crate::speed_t = 0o010011;
pub const B1500000: crate::speed_t = 0o010012;
pub const B2000000: crate::speed_t = 0o010013;
pub const B2500000: crate::speed_t = 0o010014;
pub const B3000000: crate::speed_t = 0o010015;
pub const B3500000: crate::speed_t = 0o010016;
pub const B4000000: crate::speed_t = 0o010017;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
pub const IEXTEN: crate::tcflag_t = 0x00008000;
pub const TOSTOP: crate::tcflag_t = 0x00000100;
pub const FLUSHO: crate::tcflag_t = 0x00001000;
pub const EXTPROC: crate::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;
@@ -0,0 +1,745 @@
use crate::prelude::*;
use crate::{off64_t, off_t};
pub type wchar_t = u32;
s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
pub sa_flags: c_int,
pub sa_restorer: Option<extern "C" fn()>,
}
pub struct statfs {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__fsword_t,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
f_spare: [crate::__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: crate::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: crate::pid_t,
}
pub struct ipc_perm {
pub __key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::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: crate::dev_t,
__pad1: c_uint,
__st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad2: c_uint,
pub st_size: off64_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt64_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
pub st_ino: crate::ino64_t,
}
pub struct statfs64 {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__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: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
pub f_spare: [crate::__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: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_atime: crate::time_t,
__unused1: c_ulong,
pub shm_dtime: crate::time_t,
__unused2: c_ulong,
pub shm_ctime: crate::time_t,
__unused3: c_ulong,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__unused4: c_ulong,
__unused5: c_ulong,
}
pub struct msqid_ds {
pub msg_perm: crate::ipc_perm,
pub msg_stime: crate::time_t,
__glibc_reserved1: c_ulong,
pub msg_rtime: crate::time_t,
__glibc_reserved2: c_ulong,
pub msg_ctime: crate::time_t,
__glibc_reserved3: c_ulong,
pub __msg_cbytes: c_ulong,
pub msg_qnum: crate::msgqnum_t,
pub msg_qbytes: crate::msglen_t,
pub msg_lspid: crate::pid_t,
pub msg_lrpid: crate::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,
}
}
s_no_extra_traits! {
#[repr(align(8))]
pub struct max_align_t {
priv_: [i64; 2],
}
}
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: crate::tcflag_t = 0o0010017;
pub const TAB1: crate::tcflag_t = 0x00000800;
pub const TAB2: crate::tcflag_t = 0x00001000;
pub const TAB3: crate::tcflag_t = 0x00001800;
pub const CR1: crate::tcflag_t = 0x00000200;
pub const CR2: crate::tcflag_t = 0x00000400;
pub const CR3: crate::tcflag_t = 0x00000600;
pub const FF1: crate::tcflag_t = 0x00008000;
pub const BS1: crate::tcflag_t = 0x00002000;
pub const VT1: crate::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: crate::tcflag_t = 0x00000400;
pub const IXOFF: crate::tcflag_t = 0x00001000;
pub const ONLCR: crate::tcflag_t = 0x4;
pub const CSIZE: crate::tcflag_t = 0x00000030;
pub const CS6: crate::tcflag_t = 0x00000010;
pub const CS7: crate::tcflag_t = 0x00000020;
pub const CS8: crate::tcflag_t = 0x00000030;
pub const CSTOPB: crate::tcflag_t = 0x00000040;
pub const CREAD: crate::tcflag_t = 0x00000080;
pub const PARENB: crate::tcflag_t = 0x00000100;
pub const PARODD: crate::tcflag_t = 0x00000200;
pub const HUPCL: crate::tcflag_t = 0x00000400;
pub const CLOCAL: crate::tcflag_t = 0x00000800;
pub const ECHOKE: crate::tcflag_t = 0x00000800;
pub const ECHOE: crate::tcflag_t = 0x00000010;
pub const ECHOK: crate::tcflag_t = 0x00000020;
pub const ECHONL: crate::tcflag_t = 0x00000040;
pub const ECHOPRT: crate::tcflag_t = 0x00000400;
pub const ECHOCTL: crate::tcflag_t = 0x00000200;
pub const ISIG: crate::tcflag_t = 0x00000001;
pub const ICANON: crate::tcflag_t = 0x00000002;
pub const PENDIN: crate::tcflag_t = 0x00004000;
pub const NOFLSH: crate::tcflag_t = 0x00000080;
pub const CIBAUD: crate::tcflag_t = 0o02003600000;
pub const CBAUDEX: crate::tcflag_t = 0o010000;
pub const VSWTC: usize = 7;
pub const OLCUC: crate::tcflag_t = 0o000002;
pub const NLDLY: crate::tcflag_t = 0o000400;
pub const CRDLY: crate::tcflag_t = 0o003000;
pub const TABDLY: crate::tcflag_t = 0o014000;
pub const BSDLY: crate::tcflag_t = 0o020000;
pub const FFDLY: crate::tcflag_t = 0o100000;
pub const VTDLY: crate::tcflag_t = 0o040000;
pub const XTABS: crate::tcflag_t = 0o014000;
pub const B0: crate::speed_t = 0o000000;
pub const B50: crate::speed_t = 0o000001;
pub const B75: crate::speed_t = 0o000002;
pub const B110: crate::speed_t = 0o000003;
pub const B134: crate::speed_t = 0o000004;
pub const B150: crate::speed_t = 0o000005;
pub const B200: crate::speed_t = 0o000006;
pub const B300: crate::speed_t = 0o000007;
pub const B600: crate::speed_t = 0o000010;
pub const B1200: crate::speed_t = 0o000011;
pub const B1800: crate::speed_t = 0o000012;
pub const B2400: crate::speed_t = 0o000013;
pub const B4800: crate::speed_t = 0o000014;
pub const B9600: crate::speed_t = 0o000015;
pub const B19200: crate::speed_t = 0o000016;
pub const B38400: crate::speed_t = 0o000017;
pub const EXTA: crate::speed_t = B19200;
pub const EXTB: crate::speed_t = B38400;
pub const B57600: crate::speed_t = 0o010001;
pub const B115200: crate::speed_t = 0o010002;
pub const B230400: crate::speed_t = 0o010003;
pub const B460800: crate::speed_t = 0o010004;
pub const B500000: crate::speed_t = 0o010005;
pub const B576000: crate::speed_t = 0o010006;
pub const B921600: crate::speed_t = 0o010007;
pub const B1000000: crate::speed_t = 0o010010;
pub const B1152000: crate::speed_t = 0o010011;
pub const B1500000: crate::speed_t = 0o010012;
pub const B2000000: crate::speed_t = 0o010013;
pub const B2500000: crate::speed_t = 0o010014;
pub const B3000000: crate::speed_t = 0o010015;
pub const B3500000: crate::speed_t = 0o010016;
pub const B4000000: crate::speed_t = 0o010017;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
pub const IEXTEN: crate::tcflag_t = 0x00008000;
pub const TOSTOP: crate::tcflag_t = 0x00000100;
pub const FLUSHO: crate::tcflag_t = 0x00001000;
pub const EXTPROC: crate::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;
@@ -0,0 +1,863 @@
use crate::prelude::*;
use crate::{off64_t, off_t};
pub type wchar_t = i32;
s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
pub sa_flags: c_int,
pub sa_restorer: Option<extern "C" fn()>,
}
pub struct statfs {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__fsword_t,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
f_spare: [crate::__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: crate::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: crate::pid_t,
}
pub struct ipc_perm {
__key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::gid_t,
pub mode: crate::mode_t,
__seq: c_ushort,
__pad1: c_ushort,
__glibc_reserved1: c_ulong,
__glibc_reserved2: c_ulong,
}
pub struct stat64 {
pub st_dev: crate::dev_t,
__pad1: c_ushort,
pub __st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad2: c_ushort,
pub st_size: off64_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt64_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_ulong,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_ulong,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_ulong,
pub st_ino: crate::ino64_t,
}
pub struct statfs64 {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__fsword_t,
pub f_blocks: crate::fsblkcnt64_t,
pub f_bfree: crate::fsblkcnt64_t,
pub f_bavail: crate::fsblkcnt64_t,
pub f_files: crate::fsblkcnt64_t,
pub f_ffree: crate::fsblkcnt64_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
pub f_spare: [crate::__fsword_t; 4],
}
pub struct statvfs64 {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt64_t,
pub f_bfree: crate::fsblkcnt64_t,
pub f_bavail: crate::fsblkcnt64_t,
pub f_files: crate::fsblkcnt64_t,
pub f_ffree: crate::fsblkcnt64_t,
pub f_favail: crate::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: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_atime: crate::time_t,
__glibc_reserved1: c_long,
pub shm_dtime: crate::time_t,
__glibc_reserved2: c_long,
pub shm_ctime: crate::time_t,
__glibc_reserved3: c_long,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__glibc_reserved5: c_ulong,
__glibc_reserved6: c_ulong,
}
pub struct msqid_ds {
pub msg_perm: crate::ipc_perm,
pub msg_stime: crate::time_t,
__glibc_reserved1: c_uint,
pub msg_rtime: crate::time_t,
__glibc_reserved2: c_uint,
pub msg_ctime: crate::time_t,
__glibc_reserved3: c_uint,
pub __msg_cbytes: c_ulong,
pub msg_qnum: crate::msgqnum_t,
pub msg_qbytes: crate::msglen_t,
pub msg_lspid: crate::pid_t,
pub msg_lrpid: crate::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,
}
}
s_no_extra_traits! {
#[repr(align(2))]
pub struct max_align_t {
priv_: [i8; 20],
}
}
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_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: crate::tcflag_t = 0o0010017;
pub const TAB1: crate::tcflag_t = 0x00000800;
pub const TAB2: crate::tcflag_t = 0x00001000;
pub const TAB3: crate::tcflag_t = 0x00001800;
pub const CR1: crate::tcflag_t = 0x00000200;
pub const CR2: crate::tcflag_t = 0x00000400;
pub const CR3: crate::tcflag_t = 0x00000600;
pub const FF1: crate::tcflag_t = 0x00008000;
pub const BS1: crate::tcflag_t = 0x00002000;
pub const VT1: crate::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: crate::tcflag_t = 0x00000400;
pub const IXOFF: crate::tcflag_t = 0x00001000;
pub const ONLCR: crate::tcflag_t = 0x4;
pub const CSIZE: crate::tcflag_t = 0x00000030;
pub const CS6: crate::tcflag_t = 0x00000010;
pub const CS7: crate::tcflag_t = 0x00000020;
pub const CS8: crate::tcflag_t = 0x00000030;
pub const CSTOPB: crate::tcflag_t = 0x00000040;
pub const CREAD: crate::tcflag_t = 0x00000080;
pub const PARENB: crate::tcflag_t = 0x00000100;
pub const PARODD: crate::tcflag_t = 0x00000200;
pub const HUPCL: crate::tcflag_t = 0x00000400;
pub const CLOCAL: crate::tcflag_t = 0x00000800;
pub const ECHOKE: crate::tcflag_t = 0x00000800;
pub const ECHOE: crate::tcflag_t = 0x00000010;
pub const ECHOK: crate::tcflag_t = 0x00000020;
pub const ECHONL: crate::tcflag_t = 0x00000040;
pub const ECHOPRT: crate::tcflag_t = 0x00000400;
pub const ECHOCTL: crate::tcflag_t = 0x00000200;
pub const ISIG: crate::tcflag_t = 0x00000001;
pub const ICANON: crate::tcflag_t = 0x00000002;
pub const PENDIN: crate::tcflag_t = 0x00004000;
pub const NOFLSH: crate::tcflag_t = 0x00000080;
pub const CIBAUD: crate::tcflag_t = 0o02003600000;
pub const CBAUDEX: crate::tcflag_t = 0o010000;
pub const VSWTC: usize = 7;
pub const OLCUC: crate::tcflag_t = 0o000002;
pub const NLDLY: crate::tcflag_t = 0o000400;
pub const CRDLY: crate::tcflag_t = 0o003000;
pub const TABDLY: crate::tcflag_t = 0o014000;
pub const BSDLY: crate::tcflag_t = 0o020000;
pub const FFDLY: crate::tcflag_t = 0o100000;
pub const VTDLY: crate::tcflag_t = 0o040000;
pub const XTABS: crate::tcflag_t = 0o014000;
pub const B0: crate::speed_t = 0o000000;
pub const B50: crate::speed_t = 0o000001;
pub const B75: crate::speed_t = 0o000002;
pub const B110: crate::speed_t = 0o000003;
pub const B134: crate::speed_t = 0o000004;
pub const B150: crate::speed_t = 0o000005;
pub const B200: crate::speed_t = 0o000006;
pub const B300: crate::speed_t = 0o000007;
pub const B600: crate::speed_t = 0o000010;
pub const B1200: crate::speed_t = 0o000011;
pub const B1800: crate::speed_t = 0o000012;
pub const B2400: crate::speed_t = 0o000013;
pub const B4800: crate::speed_t = 0o000014;
pub const B9600: crate::speed_t = 0o000015;
pub const B19200: crate::speed_t = 0o000016;
pub const B38400: crate::speed_t = 0o000017;
pub const EXTA: crate::speed_t = B19200;
pub const EXTB: crate::speed_t = B38400;
pub const B57600: crate::speed_t = 0o010001;
pub const B115200: crate::speed_t = 0o010002;
pub const B230400: crate::speed_t = 0o010003;
pub const B460800: crate::speed_t = 0o010004;
pub const B500000: crate::speed_t = 0o010005;
pub const B576000: crate::speed_t = 0o010006;
pub const B921600: crate::speed_t = 0o010007;
pub const B1000000: crate::speed_t = 0o010010;
pub const B1152000: crate::speed_t = 0o010011;
pub const B1500000: crate::speed_t = 0o010012;
pub const B2000000: crate::speed_t = 0o010013;
pub const B2500000: crate::speed_t = 0o010014;
pub const B3000000: crate::speed_t = 0o010015;
pub const B3500000: crate::speed_t = 0o010016;
pub const B4000000: crate::speed_t = 0o010017;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
pub const IEXTEN: crate::tcflag_t = 0x00008000;
pub const TOSTOP: crate::tcflag_t = 0x00000100;
pub const FLUSHO: crate::tcflag_t = 0x00001000;
pub const EXTPROC: crate::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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 127;
pub const SYS_init_module: c_long = 128;
pub const SYS_delete_module: c_long = 129;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
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;
@@ -0,0 +1,924 @@
use crate::prelude::*;
use crate::{off64_t, off_t};
pub type wchar_t = i32;
s! {
pub struct stat {
#[cfg(not(gnu_time_bits64))]
pub st_dev: c_ulong,
#[cfg(gnu_time_bits64)]
pub st_dev: crate::dev_t,
#[cfg(not(gnu_time_bits64))]
st_pad1: [c_long; 3],
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
#[cfg(not(gnu_time_bits64))]
pub st_rdev: c_ulong,
#[cfg(gnu_time_bits64)]
pub st_rdev: crate::dev_t,
#[cfg(not(gnu_file_offset_bits64))]
st_pad2: [c_long; 2],
#[cfg(all(not(gnu_time_bits64), gnu_file_offset_bits64))]
st_pad2: [c_long; 3],
pub st_size: off_t,
#[cfg(not(gnu_file_offset_bits64))]
st_pad3: c_long,
#[cfg(gnu_time_bits64)]
pub st_blksize: crate::blksize_t,
#[cfg(gnu_time_bits64)]
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
#[cfg(gnu_time_bits64)]
_atime_pad: c_int,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
#[cfg(gnu_time_bits64)]
_mtime_pad: c_int,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
#[cfg(gnu_time_bits64)]
_ctime_pad: c_int,
pub st_ctime_nsec: c_long,
#[cfg(not(gnu_time_bits64))]
pub st_blksize: crate::blksize_t,
#[cfg(all(not(gnu_time_bits64), gnu_file_offset_bits64))]
st_pad4: c_long,
#[cfg(not(gnu_time_bits64))]
pub st_blocks: crate::blkcnt_t,
#[cfg(not(gnu_time_bits64))]
st_pad5: [c_long; 14],
}
pub struct stat64 {
#[cfg(not(gnu_time_bits64))]
pub st_dev: c_ulong,
#[cfg(gnu_time_bits64)]
pub st_dev: crate::dev_t,
#[cfg(not(gnu_time_bits64))]
st_pad1: [c_long; 3],
pub st_ino: crate::ino64_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
#[cfg(not(gnu_time_bits64))]
pub st_rdev: c_ulong,
#[cfg(gnu_time_bits64)]
pub st_rdev: crate::dev_t,
#[cfg(not(gnu_time_bits64))]
st_pad2: [c_long; 3],
pub st_size: off64_t,
#[cfg(gnu_time_bits64)]
pub st_blksize: crate::blksize_t,
#[cfg(gnu_time_bits64)]
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
#[cfg(gnu_time_bits64)]
_atime_pad: c_int,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
#[cfg(gnu_time_bits64)]
_mtime_pad: c_int,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
#[cfg(gnu_time_bits64)]
_ctime_pad: c_int,
pub st_ctime_nsec: c_long,
#[cfg(not(gnu_time_bits64))]
pub st_blksize: crate::blksize_t,
#[cfg(not(gnu_time_bits64))]
st_pad3: c_long,
#[cfg(not(gnu_time_bits64))]
pub st_blocks: crate::blkcnt64_t,
#[cfg(not(gnu_time_bits64))]
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: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_files: crate::fsblkcnt_t,
pub f_ffree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_long,
pub f_flags: c_long,
f_spare: [c_long; 5],
}
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: crate::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],
}
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_flags: c_int,
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
pub sa_restorer: Option<extern "C" 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: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::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: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__unused4: c_ulong,
__unused5: c_ulong,
}
pub struct msqid_ds {
pub msg_perm: crate::ipc_perm,
#[cfg(all(not(gnu_time_bits64), target_endian = "big"))]
__glibc_reserved1: c_ulong,
pub msg_stime: crate::time_t,
#[cfg(all(not(gnu_time_bits64), target_endian = "little"))]
__glibc_reserved1: c_ulong,
#[cfg(all(not(gnu_time_bits64), target_endian = "big"))]
__glibc_reserved2: c_ulong,
pub msg_rtime: crate::time_t,
#[cfg(all(not(gnu_time_bits64), target_endian = "little"))]
__glibc_reserved2: c_ulong,
#[cfg(all(not(gnu_time_bits64), target_endian = "big"))]
__glibc_reserved3: c_ulong,
pub msg_ctime: crate::time_t,
#[cfg(target_endian = "little")]
__glibc_reserved3: c_ulong,
__msg_cbytes: c_ulong,
pub msg_qnum: crate::msgqnum_t,
pub msg_qbytes: crate::msglen_t,
pub msg_lspid: crate::pid_t,
pub msg_lrpid: crate::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,
#[cfg(not(gnu_file_offset_bits64))]
pub l_sysid: c_long,
pub l_pid: crate::pid_t,
#[cfg(not(gnu_file_offset_bits64))]
__glibc_reserved0: [c_long; 4],
}
}
s_no_extra_traits! {
#[repr(align(8))]
pub struct max_align_t {
priv_: [f32; 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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
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: crate::tcflag_t = 0x00000100;
pub const TOSTOP: crate::tcflag_t = 0x00008000;
pub const FLUSHO: crate::tcflag_t = 0x00002000;
pub const EXTPROC: crate::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;
cfg_if! {
if #[cfg(gnu_file_offset_bits64)] {
pub const F_GETLK: c_int = 33;
} else {
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: crate::tcflag_t = 0o0010017;
pub const TAB1: crate::tcflag_t = 0x00000800;
pub const TAB2: crate::tcflag_t = 0x00001000;
pub const TAB3: crate::tcflag_t = 0x00001800;
pub const CR1: crate::tcflag_t = 0x00000200;
pub const CR2: crate::tcflag_t = 0x00000400;
pub const CR3: crate::tcflag_t = 0x00000600;
pub const FF1: crate::tcflag_t = 0x00008000;
pub const BS1: crate::tcflag_t = 0x00002000;
pub const VT1: crate::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: crate::tcflag_t = 0x00000400;
pub const IXOFF: crate::tcflag_t = 0x00001000;
pub const ONLCR: crate::tcflag_t = 0x4;
pub const CSIZE: crate::tcflag_t = 0x00000030;
pub const CS6: crate::tcflag_t = 0x00000010;
pub const CS7: crate::tcflag_t = 0x00000020;
pub const CS8: crate::tcflag_t = 0x00000030;
pub const CSTOPB: crate::tcflag_t = 0x00000040;
pub const CREAD: crate::tcflag_t = 0x00000080;
pub const PARENB: crate::tcflag_t = 0x00000100;
pub const PARODD: crate::tcflag_t = 0x00000200;
pub const HUPCL: crate::tcflag_t = 0x00000400;
pub const CLOCAL: crate::tcflag_t = 0x00000800;
pub const ECHOKE: crate::tcflag_t = 0x00000800;
pub const ECHOE: crate::tcflag_t = 0x00000010;
pub const ECHOK: crate::tcflag_t = 0x00000020;
pub const ECHONL: crate::tcflag_t = 0x00000040;
pub const ECHOPRT: crate::tcflag_t = 0x00000400;
pub const ECHOCTL: crate::tcflag_t = 0x00000200;
pub const ISIG: crate::tcflag_t = 0x00000001;
pub const ICANON: crate::tcflag_t = 0x00000002;
pub const PENDIN: crate::tcflag_t = 0x00004000;
pub const NOFLSH: crate::tcflag_t = 0x00000080;
pub const CIBAUD: crate::tcflag_t = 0o02003600000;
pub const CBAUDEX: crate::tcflag_t = 0o010000;
pub const VSWTC: usize = 7;
pub const OLCUC: crate::tcflag_t = 0o000002;
pub const NLDLY: crate::tcflag_t = 0o000400;
pub const CRDLY: crate::tcflag_t = 0o003000;
pub const TABDLY: crate::tcflag_t = 0o014000;
pub const BSDLY: crate::tcflag_t = 0o020000;
pub const FFDLY: crate::tcflag_t = 0o100000;
pub const VTDLY: crate::tcflag_t = 0o040000;
pub const XTABS: crate::tcflag_t = 0o014000;
pub const B0: crate::speed_t = 0o000000;
pub const B50: crate::speed_t = 0o000001;
pub const B75: crate::speed_t = 0o000002;
pub const B110: crate::speed_t = 0o000003;
pub const B134: crate::speed_t = 0o000004;
pub const B150: crate::speed_t = 0o000005;
pub const B200: crate::speed_t = 0o000006;
pub const B300: crate::speed_t = 0o000007;
pub const B600: crate::speed_t = 0o000010;
pub const B1200: crate::speed_t = 0o000011;
pub const B1800: crate::speed_t = 0o000012;
pub const B2400: crate::speed_t = 0o000013;
pub const B4800: crate::speed_t = 0o000014;
pub const B9600: crate::speed_t = 0o000015;
pub const B19200: crate::speed_t = 0o000016;
pub const B38400: crate::speed_t = 0o000017;
pub const EXTA: crate::speed_t = B19200;
pub const EXTB: crate::speed_t = B38400;
pub const B57600: crate::speed_t = 0o010001;
pub const B115200: crate::speed_t = 0o010002;
pub const B230400: crate::speed_t = 0o010003;
pub const B460800: crate::speed_t = 0o010004;
pub const B500000: crate::speed_t = 0o010005;
pub const B576000: crate::speed_t = 0o010006;
pub const B921600: crate::speed_t = 0o010007;
pub const B1000000: crate::speed_t = 0o010010;
pub const B1152000: crate::speed_t = 0o010011;
pub const B1500000: crate::speed_t = 0o010012;
pub const B2000000: crate::speed_t = 0o010013;
pub const B2500000: crate::speed_t = 0o010014;
pub const B3000000: crate::speed_t = 0o010015;
pub const B3500000: crate::speed_t = 0o010016;
pub const B4000000: crate::speed_t = 0o010017;
pub const EHWPOISON: c_int = 168;
+491
View File
@@ -0,0 +1,491 @@
//! 32-bit specific definitions for linux-like values
use crate::prelude::*;
use crate::pthread_mutex_t;
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;
pub type __suseconds64_t = i64;
cfg_if! {
if #[cfg(target_arch = "riscv32")] {
pub type time_t = i64;
pub type suseconds_t = i64;
type __ino_t = c_ulong;
type __ino64_t = u64;
pub type ino_t = __ino64_t;
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 if #[cfg(gnu_time_bits64)] {
pub type time_t = i64;
pub type suseconds_t = i32;
type __ino_t = c_ulong;
type __ino64_t = u64;
pub type ino_t = __ino64_t;
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 = i32;
} else if #[cfg(gnu_file_offset_bits64)] {
pub type time_t = i32;
pub type suseconds_t = i32;
type __ino_t = c_ulong;
type __ino64_t = u64;
pub type ino_t = __ino64_t;
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 = i32;
} else {
pub type time_t = i32;
pub type suseconds_t = i32;
type __ino_t = c_ulong;
type __ino64_t = u64;
pub type ino_t = __ino_t;
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;
}
}
cfg_if! {
if #[cfg(not(any(
target_arch = "mips",
target_arch = "mips32r6",
target_arch = "powerpc",
target_arch = "sparc"
)))] {
s! {
pub struct stat {
pub st_dev: crate::dev_t,
#[cfg(not(gnu_time_bits64))]
__pad1: c_uint,
#[cfg(any(gnu_time_bits64, not(gnu_file_offset_bits64)))]
pub st_ino: crate::ino_t,
#[cfg(all(not(gnu_time_bits64), gnu_file_offset_bits64))]
__st_ino: __ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
#[cfg(not(gnu_time_bits64))]
__pad2: c_uint,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
#[cfg(gnu_time_bits64)]
_atime_pad: c_int,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
#[cfg(gnu_time_bits64)]
_mtime_pad: c_int,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
#[cfg(gnu_time_bits64)]
_ctime_pad: c_int,
#[cfg(not(gnu_file_offset_bits64))]
__glibc_reserved4: c_long,
#[cfg(not(gnu_file_offset_bits64))]
__glibc_reserved5: c_long,
#[cfg(all(not(gnu_time_bits64), gnu_file_offset_bits64))]
pub st_ino: crate::ino_t,
}
}
}
}
s! {
pub struct statvfs {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_favail: crate::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(all(not(gnu_time_bits64), target_arch = "powerpc"))]
__reserved: crate::__syscall_ulong_t,
pub sem_otime: crate::time_t,
#[cfg(not(any(
gnu_time_bits64,
target_arch = "mips",
target_arch = "mips32r6",
target_arch = "powerpc"
)))]
__reserved: crate::__syscall_ulong_t,
#[cfg(all(not(gnu_time_bits64), target_arch = "powerpc"))]
__reserved2: crate::__syscall_ulong_t,
pub sem_ctime: crate::time_t,
#[cfg(not(any(
gnu_time_bits64,
target_arch = "mips",
target_arch = "mips32r6",
target_arch = "powerpc"
)))]
__reserved2: crate::__syscall_ulong_t,
pub sem_nsems: crate::__syscall_ulong_t,
#[cfg(all(
gnu_time_bits64,
not(any(
target_arch = "mips",
target_arch = "mips32r6",
target_arch = "powerpc",
target_arch = "arm",
target_arch = "x86"
))
))]
__reserved2: crate::__syscall_ulong_t,
__glibc_reserved3: crate::__syscall_ulong_t,
__glibc_reserved4: crate::__syscall_ulong_t,
}
#[cfg(gnu_time_bits64)]
pub struct timex {
pub modes: c_uint,
_pad1: c_int,
pub offset: c_longlong,
pub freq: c_longlong,
pub maxerror: c_longlong,
pub esterror: c_longlong,
pub status: c_int,
_pad2: c_int,
pub constant: c_longlong,
pub precision: c_longlong,
pub tolerance: c_longlong,
pub time: crate::timeval,
pub tick: c_longlong,
pub ppsfreq: c_longlong,
pub jitter: c_longlong,
pub shift: c_int,
_pad3: c_int,
pub stabil: c_longlong,
pub jitcnt: c_longlong,
pub calcnt: c_longlong,
pub errcnt: c_longlong,
pub stbcnt: c_longlong,
pub tai: c_int,
pub __unused1: i32,
pub __unused2: i32,
pub __unused3: i32,
pub __unused4: i32,
pub __unused5: i32,
pub __unused6: i32,
pub __unused7: i32,
pub __unused8: i32,
pub __unused9: i32,
pub __unused10: i32,
pub __unused11: i32,
}
#[cfg(not(gnu_time_bits64))]
pub struct timex {
pub modes: c_uint,
pub offset: c_long,
pub freq: c_long,
pub maxerror: c_long,
pub esterror: c_long,
pub status: c_int,
pub constant: c_long,
pub precision: c_long,
pub tolerance: c_long,
pub time: crate::timeval,
pub tick: c_long,
pub ppsfreq: c_long,
pub jitter: c_long,
pub shift: c_int,
pub stabil: c_long,
pub jitcnt: c_long,
pub calcnt: c_long,
pub errcnt: c_long,
pub stbcnt: c_long,
pub tai: c_int,
pub __unused1: i32,
pub __unused2: i32,
pub __unused3: i32,
pub __unused4: i32,
pub __unused5: i32,
pub __unused6: i32,
pub __unused7: i32,
pub __unused8: i32,
pub __unused9: i32,
pub __unused10: i32,
pub __unused11: i32,
}
}
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_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_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;
}
}
cfg_if! {
if #[cfg(target_arch = "sparc")] {
pub const F_SETLK: c_int = 8;
pub const F_SETLKW: c_int = 9;
} else if #[cfg(all(
gnu_file_offset_bits64,
any(target_arch = "mips", target_arch = "mips32r6")
))] {
pub const F_SETLK: c_int = 34;
pub const F_SETLKW: c_int = 35;
} else if #[cfg(gnu_file_offset_bits64)] {
pub const F_SETLK: c_int = 13;
pub const F_SETLKW: c_int = 14;
} else {
pub const F_SETLK: c_int = 6;
pub const F_SETLKW: c_int = 7;
}
}
#[cfg(target_endian = "little")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::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: crate::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: crate::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: crate::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: crate::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: crate::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
}
}
+892
View File
@@ -0,0 +1,892 @@
use crate::prelude::*;
use crate::{off64_t, off_t};
pub type wchar_t = i32;
s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
pub sa_flags: c_int,
pub sa_restorer: Option<extern "C" fn()>,
}
pub struct statfs {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__fsword_t,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
f_spare: [crate::__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: crate::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: crate::pid_t,
}
pub struct ipc_perm {
__key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::gid_t,
pub mode: crate::mode_t,
__seq: u32,
__pad1: u32,
__glibc_reserved1: u64,
__glibc_reserved2: u64,
}
pub struct stat {
pub st_dev: crate::dev_t,
#[cfg(not(gnu_file_offset_bits64))]
__pad1: c_ushort,
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
#[cfg(not(gnu_time_bits64))]
__pad2: c_ushort,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
#[cfg(gnu_time_bits64)]
_atime_pad: c_int,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
#[cfg(gnu_time_bits64)]
_mtime_pad: c_int,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
#[cfg(gnu_time_bits64)]
_ctime_pad: c_int,
pub st_ctime_nsec: c_long,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved4: c_ulong,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved5: c_ulong,
}
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino64_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
#[cfg(not(gnu_time_bits64))]
__pad2: c_ushort,
pub st_size: off64_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt64_t,
pub st_atime: crate::time_t,
#[cfg(gnu_time_bits64)]
_atime_pad: c_int,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
#[cfg(gnu_time_bits64)]
_mtime_pad: c_int,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
#[cfg(gnu_time_bits64)]
_ctime_pad: c_int,
pub st_ctime_nsec: c_long,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved4: c_ulong,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved5: c_ulong,
}
pub struct statfs64 {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__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: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
pub f_spare: [crate::__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: crate::ipc_perm,
#[cfg(gnu_time_bits64)]
pub shm_segsz: size_t,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved1: c_uint,
pub shm_atime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved2: c_uint,
pub shm_dtime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved3: c_uint,
pub shm_ctime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved4: c_uint,
#[cfg(not(gnu_time_bits64))]
pub shm_segsz: size_t,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__glibc_reserved5: c_ulong,
__glibc_reserved6: c_ulong,
}
pub struct msqid_ds {
pub msg_perm: crate::ipc_perm,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved1: c_uint,
pub msg_stime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved2: c_uint,
pub msg_rtime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__glibc_reserved3: c_uint,
pub msg_ctime: crate::time_t,
pub __msg_cbytes: c_ulong,
pub msg_qnum: crate::msgqnum_t,
pub msg_qbytes: crate::msglen_t,
pub msg_lspid: crate::pid_t,
pub msg_lrpid: crate::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 = 0x20000;
pub const O_DIRECTORY: c_int = 0x4000;
pub const O_NOFOLLOW: c_int = 0x8000;
pub const O_LARGEFILE: c_int = 0o200000;
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 TCSANOW: c_int = 0;
pub const TCSADRAIN: c_int = 1;
pub const TCSAFLUSH: c_int = 2;
pub const MADV_SOFT_OFFLINE: c_int = 101;
pub const MAP_LOCKED: c_int = 0x00080;
pub const MAP_NORESERVE: c_int = 0x00040;
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 = 58;
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 = 0x2000;
pub const MCL_FUTURE: c_int = 0x4000;
pub const MCL_ONFAULT: c_int = 0x8000;
pub const POLLWRNORM: c_short = 0x100;
pub const POLLWRBAND: c_short = 0x200;
cfg_if! {
if #[cfg(gnu_file_offset_bits64)] {
pub const F_GETLK: c_int = 12;
} else {
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 = 0x4000;
pub const MINSIGSTKSZ: size_t = 4096;
pub const CBAUD: crate::tcflag_t = 0xff;
pub const TAB1: crate::tcflag_t = 0x400;
pub const TAB2: crate::tcflag_t = 0x800;
pub const TAB3: crate::tcflag_t = 0xc00;
pub const CR1: crate::tcflag_t = 0x1000;
pub const CR2: crate::tcflag_t = 0x2000;
pub const CR3: crate::tcflag_t = 0x3000;
pub const FF1: crate::tcflag_t = 0x4000;
pub const BS1: crate::tcflag_t = 0x8000;
pub const VT1: crate::tcflag_t = 0x10000;
pub const VWERASE: usize = 0xa;
pub const VREPRINT: usize = 0xb;
pub const VSUSP: usize = 0xc;
pub const VSTART: usize = 0xd;
pub const VSTOP: usize = 0xe;
pub const VDISCARD: usize = 0x10;
pub const VTIME: usize = 0x7;
pub const IXON: crate::tcflag_t = 0x200;
pub const IXOFF: crate::tcflag_t = 0x400;
pub const ONLCR: crate::tcflag_t = 0x2;
pub const CSIZE: crate::tcflag_t = 0x300;
pub const CS6: crate::tcflag_t = 0x100;
pub const CS7: crate::tcflag_t = 0x200;
pub const CS8: crate::tcflag_t = 0x300;
pub const CSTOPB: crate::tcflag_t = 0x400;
pub const CREAD: crate::tcflag_t = 0x800;
pub const PARENB: crate::tcflag_t = 0x1000;
pub const PARODD: crate::tcflag_t = 0x2000;
pub const HUPCL: crate::tcflag_t = 0x4000;
pub const CLOCAL: crate::tcflag_t = 0x8000;
pub const ECHOKE: crate::tcflag_t = 0x1;
pub const ECHOE: crate::tcflag_t = 0x2;
pub const ECHOK: crate::tcflag_t = 0x4;
pub const ECHONL: crate::tcflag_t = 0x10;
pub const ECHOPRT: crate::tcflag_t = 0x20;
pub const ECHOCTL: crate::tcflag_t = 0x40;
pub const ISIG: crate::tcflag_t = 0x80;
pub const ICANON: crate::tcflag_t = 0x100;
pub const PENDIN: crate::tcflag_t = 0x20000000;
pub const NOFLSH: crate::tcflag_t = 0x80000000;
pub const VSWTC: usize = 9;
pub const OLCUC: crate::tcflag_t = 0o000004;
pub const NLDLY: crate::tcflag_t = 0o001400;
pub const CRDLY: crate::tcflag_t = 0o030000;
pub const TABDLY: crate::tcflag_t = 0o006000;
pub const BSDLY: crate::tcflag_t = 0o100000;
pub const FFDLY: crate::tcflag_t = 0o040000;
pub const VTDLY: crate::tcflag_t = 0o200000;
pub const XTABS: crate::tcflag_t = 0o006000;
pub const B0: crate::speed_t = 0o000000;
pub const B50: crate::speed_t = 0o000001;
pub const B75: crate::speed_t = 0o000002;
pub const B110: crate::speed_t = 0o000003;
pub const B134: crate::speed_t = 0o000004;
pub const B150: crate::speed_t = 0o000005;
pub const B200: crate::speed_t = 0o000006;
pub const B300: crate::speed_t = 0o000007;
pub const B600: crate::speed_t = 0o000010;
pub const B1200: crate::speed_t = 0o000011;
pub const B1800: crate::speed_t = 0o000012;
pub const B2400: crate::speed_t = 0o000013;
pub const B4800: crate::speed_t = 0o000014;
pub const B9600: crate::speed_t = 0o000015;
pub const B19200: crate::speed_t = 0o000016;
pub const B38400: crate::speed_t = 0o000017;
pub const EXTA: crate::speed_t = B19200;
pub const EXTB: crate::speed_t = B38400;
pub const CBAUDEX: crate::speed_t = 0o000020;
pub const B57600: crate::speed_t = 0o0020;
pub const B115200: crate::speed_t = 0o0021;
pub const B230400: crate::speed_t = 0o0022;
pub const B460800: crate::speed_t = 0o0023;
pub const B500000: crate::speed_t = 0o0024;
pub const B576000: crate::speed_t = 0o0025;
pub const B921600: crate::speed_t = 0o0026;
pub const B1000000: crate::speed_t = 0o0027;
pub const B1152000: crate::speed_t = 0o0030;
pub const B1500000: crate::speed_t = 0o0031;
pub const B2000000: crate::speed_t = 0o0032;
pub const B2500000: crate::speed_t = 0o0033;
pub const B3000000: crate::speed_t = 0o0034;
pub const B3500000: crate::speed_t = 0o0035;
pub const B4000000: crate::speed_t = 0o0036;
pub const VEOL: usize = 6;
pub const VEOL2: usize = 8;
pub const VMIN: usize = 5;
pub const IEXTEN: crate::tcflag_t = 0x400;
pub const TOSTOP: crate::tcflag_t = 0x400000;
pub const FLUSHO: crate::tcflag_t = 0x800000;
pub const EXTPROC: crate::tcflag_t = 0x10000000;
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_vm86: 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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 127;
pub const SYS_init_module: c_long = 128;
pub const SYS_delete_module: c_long = 129;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
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; /* Syscall for Andrew File System */
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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_query_module: c_long = 166;
pub const SYS_poll: c_long = 167;
pub const SYS_nfsservctl: c_long = 168;
pub const SYS_setresgid: c_long = 169;
pub const SYS_getresgid: c_long = 170;
pub const SYS_prctl: c_long = 171;
pub const SYS_rt_sigreturn: c_long = 172;
pub const SYS_rt_sigaction: c_long = 173;
pub const SYS_rt_sigprocmask: c_long = 174;
pub const SYS_rt_sigpending: c_long = 175;
pub const SYS_rt_sigtimedwait: c_long = 176;
pub const SYS_rt_sigqueueinfo: c_long = 177;
pub const SYS_rt_sigsuspend: c_long = 178;
pub const SYS_pread64: c_long = 179;
pub const SYS_pwrite64: c_long = 180;
pub const SYS_chown: c_long = 181;
pub const SYS_getcwd: c_long = 182;
pub const SYS_capget: c_long = 183;
pub const SYS_capset: c_long = 184;
pub const SYS_sigaltstack: c_long = 185;
pub const SYS_sendfile: c_long = 186;
pub const SYS_getpmsg: c_long = 187; /* some people actually want streams */
pub const SYS_putpmsg: c_long = 188; /* some people actually want streams */
pub const SYS_vfork: c_long = 189;
pub const SYS_ugetrlimit: c_long = 190; /* SuS compliant getrlimit */
pub const SYS_readahead: 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_pciconfig_read: c_long = 198;
pub const SYS_pciconfig_write: c_long = 199;
pub const SYS_pciconfig_iobase: c_long = 200;
pub const SYS_multiplexer: c_long = 201;
pub const SYS_getdents64: c_long = 202;
pub const SYS_pivot_root: c_long = 203;
pub const SYS_fcntl64: c_long = 204;
pub const SYS_madvise: c_long = 205;
pub const SYS_mincore: c_long = 206;
pub const SYS_gettid: c_long = 207;
pub const SYS_tkill: c_long = 208;
pub const SYS_setxattr: c_long = 209;
pub const SYS_lsetxattr: c_long = 210;
pub const SYS_fsetxattr: c_long = 211;
pub const SYS_getxattr: c_long = 212;
pub const SYS_lgetxattr: c_long = 213;
pub const SYS_fgetxattr: c_long = 214;
pub const SYS_listxattr: c_long = 215;
pub const SYS_llistxattr: c_long = 216;
pub const SYS_flistxattr: c_long = 217;
pub const SYS_removexattr: c_long = 218;
pub const SYS_lremovexattr: c_long = 219;
pub const SYS_fremovexattr: c_long = 220;
pub const SYS_futex: c_long = 221;
pub const SYS_sched_setaffinity: c_long = 222;
pub const SYS_sched_getaffinity: c_long = 223;
pub const SYS_tuxcall: c_long = 225;
pub const SYS_sendfile64: c_long = 226;
pub const SYS_io_setup: c_long = 227;
pub const SYS_io_destroy: c_long = 228;
pub const SYS_io_getevents: c_long = 229;
pub const SYS_io_submit: c_long = 230;
pub const SYS_io_cancel: c_long = 231;
pub const SYS_set_tid_address: c_long = 232;
pub const SYS_fadvise64: c_long = 233;
pub const SYS_exit_group: c_long = 234;
pub const SYS_lookup_dcookie: c_long = 235;
pub const SYS_epoll_create: c_long = 236;
pub const SYS_epoll_ctl: c_long = 237;
pub const SYS_epoll_wait: c_long = 238;
pub const SYS_remap_file_pages: c_long = 239;
pub const SYS_timer_create: c_long = 240;
pub const SYS_timer_settime: c_long = 241;
pub const SYS_timer_gettime: c_long = 242;
pub const SYS_timer_getoverrun: c_long = 243;
pub const SYS_timer_delete: c_long = 244;
pub const SYS_clock_settime: c_long = 245;
pub const SYS_clock_gettime: c_long = 246;
pub const SYS_clock_getres: c_long = 247;
pub const SYS_clock_nanosleep: c_long = 248;
pub const SYS_swapcontext: c_long = 249;
pub const SYS_tgkill: c_long = 250;
pub const SYS_utimes: c_long = 251;
pub const SYS_statfs64: c_long = 252;
pub const SYS_fstatfs64: c_long = 253;
pub const SYS_fadvise64_64: c_long = 254;
pub const SYS_rtas: c_long = 255;
pub const SYS_sys_debug_setcontext: c_long = 256;
pub const SYS_migrate_pages: c_long = 258;
pub const SYS_mbind: c_long = 259;
pub const SYS_get_mempolicy: c_long = 260;
pub const SYS_set_mempolicy: c_long = 261;
pub const SYS_mq_open: c_long = 262;
pub const SYS_mq_unlink: c_long = 263;
pub const SYS_mq_timedsend: c_long = 264;
pub const SYS_mq_timedreceive: c_long = 265;
pub const SYS_mq_notify: c_long = 266;
pub const SYS_mq_getsetattr: c_long = 267;
pub const SYS_kexec_load: c_long = 268;
pub const SYS_add_key: c_long = 269;
pub const SYS_request_key: c_long = 270;
pub const SYS_keyctl: c_long = 271;
pub const SYS_waitid: c_long = 272;
pub const SYS_ioprio_set: c_long = 273;
pub const SYS_ioprio_get: c_long = 274;
pub const SYS_inotify_init: c_long = 275;
pub const SYS_inotify_add_watch: c_long = 276;
pub const SYS_inotify_rm_watch: c_long = 277;
pub const SYS_spu_run: c_long = 278;
pub const SYS_spu_create: c_long = 279;
pub const SYS_pselect6: c_long = 280;
pub const SYS_ppoll: c_long = 281;
pub const SYS_unshare: c_long = 282;
pub const SYS_splice: c_long = 283;
pub const SYS_tee: c_long = 284;
pub const SYS_vmsplice: c_long = 285;
pub const SYS_openat: c_long = 286;
pub const SYS_mkdirat: c_long = 287;
pub const SYS_mknodat: c_long = 288;
pub const SYS_fchownat: c_long = 289;
pub const SYS_futimesat: c_long = 290;
pub const SYS_fstatat64: c_long = 291;
pub const SYS_unlinkat: c_long = 292;
pub const SYS_renameat: c_long = 293;
pub const SYS_linkat: c_long = 294;
pub const SYS_symlinkat: c_long = 295;
pub const SYS_readlinkat: c_long = 296;
pub const SYS_fchmodat: c_long = 297;
pub const SYS_faccessat: c_long = 298;
pub const SYS_get_robust_list: c_long = 299;
pub const SYS_set_robust_list: c_long = 300;
pub const SYS_move_pages: c_long = 301;
pub const SYS_getcpu: c_long = 302;
pub const SYS_epoll_pwait: c_long = 303;
pub const SYS_utimensat: c_long = 304;
pub const SYS_signalfd: c_long = 305;
pub const SYS_timerfd_create: c_long = 306;
pub const SYS_eventfd: c_long = 307;
pub const SYS_sync_file_range2: c_long = 308;
pub const SYS_fallocate: c_long = 309;
pub const SYS_subpage_prot: c_long = 310;
pub const SYS_timerfd_settime: c_long = 311;
pub const SYS_timerfd_gettime: c_long = 312;
pub const SYS_signalfd4: c_long = 313;
pub const SYS_eventfd2: c_long = 314;
pub const SYS_epoll_create1: c_long = 315;
pub const SYS_dup3: c_long = 316;
pub const SYS_pipe2: c_long = 317;
pub const SYS_inotify_init1: c_long = 318;
pub const SYS_perf_event_open: c_long = 319;
pub const SYS_preadv: c_long = 320;
pub const SYS_pwritev: c_long = 321;
pub const SYS_rt_tgsigqueueinfo: c_long = 322;
pub const SYS_fanotify_init: c_long = 323;
pub const SYS_fanotify_mark: c_long = 324;
pub const SYS_prlimit64: c_long = 325;
pub const SYS_socket: c_long = 326;
pub const SYS_bind: c_long = 327;
pub const SYS_connect: c_long = 328;
pub const SYS_listen: c_long = 329;
pub const SYS_accept: c_long = 330;
pub const SYS_getsockname: c_long = 331;
pub const SYS_getpeername: c_long = 332;
pub const SYS_socketpair: c_long = 333;
pub const SYS_send: c_long = 334;
pub const SYS_sendto: c_long = 335;
pub const SYS_recv: c_long = 336;
pub const SYS_recvfrom: c_long = 337;
pub const SYS_shutdown: c_long = 338;
pub const SYS_setsockopt: c_long = 339;
pub const SYS_getsockopt: c_long = 340;
pub const SYS_sendmsg: c_long = 341;
pub const SYS_recvmsg: c_long = 342;
pub const SYS_recvmmsg: c_long = 343;
pub const SYS_accept4: c_long = 344;
pub const SYS_name_to_handle_at: c_long = 345;
pub const SYS_open_by_handle_at: c_long = 346;
pub const SYS_clock_adjtime: c_long = 347;
pub const SYS_syncfs: c_long = 348;
pub const SYS_sendmmsg: c_long = 349;
pub const SYS_setns: c_long = 350;
pub const SYS_process_vm_readv: c_long = 351;
pub const SYS_process_vm_writev: c_long = 352;
pub const SYS_finit_module: c_long = 353;
pub const SYS_kcmp: c_long = 354;
pub const SYS_sched_setattr: c_long = 355;
pub const SYS_sched_getattr: c_long = 356;
pub const SYS_renameat2: c_long = 357;
pub const SYS_seccomp: c_long = 358;
pub const SYS_getrandom: c_long = 359;
pub const SYS_memfd_create: c_long = 360;
pub const SYS_bpf: c_long = 361;
pub const SYS_execveat: c_long = 362;
pub const SYS_switch_endian: c_long = 363;
pub const SYS_userfaultfd: c_long = 364;
pub const SYS_membarrier: c_long = 365;
pub const SYS_mlock2: c_long = 378;
pub const SYS_copy_file_range: c_long = 379;
pub const SYS_preadv2: c_long = 380;
pub const SYS_pwritev2: c_long = 381;
pub const SYS_kexec_file_load: c_long = 382;
pub const SYS_statx: c_long = 383;
pub const SYS_rseq: c_long = 387;
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;
@@ -0,0 +1,808 @@
//! RISC-V-specific definitions for 32-bit linux-like values
use crate::prelude::*;
use crate::{off64_t, off_t};
pub type wchar_t = c_int;
s! {
pub struct msqid_ds {
pub msg_perm: crate::ipc_perm,
pub msg_stime: crate::time_t,
pub msg_rtime: crate::time_t,
pub msg_ctime: crate::time_t,
pub __msg_cbytes: c_ulong,
pub msg_qnum: crate::msgqnum_t,
pub msg_qbytes: crate::msglen_t,
pub msg_lspid: crate::pid_t,
pub msg_lrpid: crate::pid_t,
__glibc_reserved4: c_ulong,
__glibc_reserved5: c_ulong,
}
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino64_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
pub __pad1: crate::dev_t,
pub st_size: off64_t,
pub st_blksize: crate::blksize_t,
pub __pad2: c_int,
pub st_blocks: crate::blkcnt64_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__unused: [c_int; 2],
}
pub struct statfs {
pub f_type: c_long,
pub f_bsize: c_long,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_long,
pub f_frsize: c_long,
pub f_flags: c_long,
pub f_spare: [c_long; 4],
}
pub struct statfs64 {
pub f_type: c_long,
pub f_bsize: c_long,
pub f_blocks: crate::fsblkcnt64_t,
pub f_bfree: crate::fsblkcnt64_t,
pub f_bavail: crate::fsblkcnt64_t,
pub f_files: crate::fsfilcnt64_t,
pub f_ffree: crate::fsfilcnt64_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_long,
pub f_frsize: c_long,
pub f_flags: c_long,
pub f_spare: [c_long; 4],
}
pub struct statvfs64 {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt64_t,
pub f_bfree: crate::fsblkcnt64_t,
pub f_bavail: crate::fsblkcnt64_t,
pub f_files: crate::fsfilcnt64_t,
pub f_ffree: crate::fsfilcnt64_t,
pub f_favail: crate::fsfilcnt64_t,
pub f_fsid: c_ulong,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
pub __f_spare: [c_int; 6],
}
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: [u64; 0],
}
pub struct stack_t {
pub ss_sp: *mut c_void,
pub ss_flags: c_int,
pub ss_size: size_t,
}
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
pub sa_flags: c_int,
pub sa_restorer: Option<unsafe extern "C" fn()>,
}
pub struct ipc_perm {
pub __key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::gid_t,
pub mode: c_ushort,
__pad1: c_ushort,
pub __seq: c_ushort,
__pad2: c_ushort,
__unused1: c_ulong,
__unused2: c_ulong,
}
pub struct shmid_ds {
pub shm_perm: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__unused5: c_ulong,
__unused6: 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_pid: crate::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: crate::pid_t,
}
pub struct user_regs_struct {
pub pc: c_ulong,
pub ra: c_ulong,
pub sp: c_ulong,
pub gp: c_ulong,
pub tp: c_ulong,
pub t0: c_ulong,
pub t1: c_ulong,
pub t2: c_ulong,
pub s0: c_ulong,
pub s1: c_ulong,
pub a0: c_ulong,
pub a1: c_ulong,
pub a2: c_ulong,
pub a3: c_ulong,
pub a4: c_ulong,
pub a5: c_ulong,
pub a6: c_ulong,
pub a7: c_ulong,
pub s2: c_ulong,
pub s3: c_ulong,
pub s4: c_ulong,
pub s5: c_ulong,
pub s6: c_ulong,
pub s7: c_ulong,
pub s8: c_ulong,
pub s9: c_ulong,
pub s10: c_ulong,
pub s11: c_ulong,
pub t3: c_ulong,
pub t4: c_ulong,
pub t5: c_ulong,
pub t6: c_ulong,
}
}
s_no_extra_traits! {
pub struct ucontext_t {
pub __uc_flags: c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: crate::stack_t,
pub uc_sigmask: crate::sigset_t,
pub uc_mcontext: mcontext_t,
}
#[repr(align(16))]
pub struct mcontext_t {
pub __gregs: [c_ulong; 32],
pub __fpregs: __riscv_mc_fp_state,
}
pub union __riscv_mc_fp_state {
pub __f: __riscv_mc_f_ext_state,
pub __d: __riscv_mc_d_ext_state,
pub __q: __riscv_mc_q_ext_state,
}
pub struct __riscv_mc_f_ext_state {
pub __f: [c_uint; 32],
pub __fcsr: c_uint,
}
pub struct __riscv_mc_d_ext_state {
pub __f: [c_ulonglong; 32],
pub __fcsr: c_uint,
}
#[repr(align(16))]
pub struct __riscv_mc_q_ext_state {
pub __f: [c_ulonglong; 64],
pub __fcsr: c_uint,
pub __glibc_reserved: [c_uint; 3],
}
}
pub const O_LARGEFILE: c_int = 0;
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_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 = 1052672;
pub const MADV_SOFT_OFFLINE: c_int = 101;
pub const MAP_GROWSDOWN: c_int = 256;
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 SOCK_STREAM: c_int = 1;
pub const SOCK_DGRAM: c_int = 2;
pub const SA_SIGINFO: c_int = 4;
pub const SA_NOCLDWAIT: c_int = 2;
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 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;
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 = 0;
pub const SIG_UNBLOCK: c_int = 1;
pub const POLLWRNORM: c_short = 256;
pub const POLLWRBAND: c_short = 512;
pub const O_ASYNC: c_int = 8192;
pub const O_NDELAY: c_int = 2048;
pub const EFD_NONBLOCK: c_int = 2048;
pub const F_GETLK: c_int = 5;
pub const F_GETOWN: c_int = 9;
pub const F_SETOWN: c_int = 8;
pub const SFD_NONBLOCK: c_int = 2048;
pub const TCSANOW: c_int = 0;
pub const TCSADRAIN: c_int = 1;
pub const TCSAFLUSH: c_int = 2;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const O_DIRECT: c_int = 16384;
pub const O_DIRECTORY: c_int = 65536;
pub const O_NOFOLLOW: c_int = 131072;
pub const MAP_HUGETLB: c_int = 262144;
pub const MAP_LOCKED: c_int = 8192;
pub const MAP_NORESERVE: c_int = 16384;
pub const MAP_ANON: c_int = 32;
pub const MAP_ANONYMOUS: c_int = 32;
pub const MAP_DENYWRITE: c_int = 2048;
pub const MAP_EXECUTABLE: c_int = 4096;
pub const MAP_POPULATE: c_int = 32768;
pub const MAP_NONBLOCK: c_int = 65536;
pub const MAP_STACK: c_int = 131072;
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 MCL_CURRENT: c_int = 1;
pub const MCL_FUTURE: c_int = 2;
pub const MCL_ONFAULT: c_int = 4;
pub const SIGSTKSZ: size_t = 8192;
pub const MINSIGSTKSZ: size_t = 2048;
pub const CBAUD: crate::tcflag_t = 4111;
pub const TAB1: crate::tcflag_t = 2048;
pub const TAB2: crate::tcflag_t = 4096;
pub const TAB3: crate::tcflag_t = 6144;
pub const CR1: crate::tcflag_t = 512;
pub const CR2: crate::tcflag_t = 1024;
pub const CR3: crate::tcflag_t = 1536;
pub const FF1: crate::tcflag_t = 32768;
pub const BS1: crate::tcflag_t = 8192;
pub const VT1: crate::tcflag_t = 16384;
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: crate::tcflag_t = 1024;
pub const IXOFF: crate::tcflag_t = 4096;
pub const ONLCR: crate::tcflag_t = 4;
pub const CSIZE: crate::tcflag_t = 48;
pub const CS6: crate::tcflag_t = 16;
pub const CS7: crate::tcflag_t = 32;
pub const CS8: crate::tcflag_t = 48;
pub const CSTOPB: crate::tcflag_t = 64;
pub const CREAD: crate::tcflag_t = 128;
pub const PARENB: crate::tcflag_t = 256;
pub const PARODD: crate::tcflag_t = 512;
pub const HUPCL: crate::tcflag_t = 1024;
pub const CLOCAL: crate::tcflag_t = 2048;
pub const ECHOKE: crate::tcflag_t = 2048;
pub const ECHOE: crate::tcflag_t = 16;
pub const ECHOK: crate::tcflag_t = 32;
pub const ECHONL: crate::tcflag_t = 64;
pub const ECHOPRT: crate::tcflag_t = 1024;
pub const ECHOCTL: crate::tcflag_t = 512;
pub const ISIG: crate::tcflag_t = 1;
pub const ICANON: crate::tcflag_t = 2;
pub const PENDIN: crate::tcflag_t = 16384;
pub const NOFLSH: crate::tcflag_t = 128;
pub const CIBAUD: crate::tcflag_t = 269418496;
pub const CBAUDEX: crate::tcflag_t = 4096;
pub const VSWTC: usize = 7;
pub const OLCUC: crate::tcflag_t = 2;
pub const NLDLY: crate::tcflag_t = 256;
pub const CRDLY: crate::tcflag_t = 1536;
pub const TABDLY: crate::tcflag_t = 6144;
pub const BSDLY: crate::tcflag_t = 8192;
pub const FFDLY: crate::tcflag_t = 32768;
pub const VTDLY: crate::tcflag_t = 16384;
pub const XTABS: crate::tcflag_t = 6144;
pub const B0: crate::speed_t = 0;
pub const B50: crate::speed_t = 1;
pub const B75: crate::speed_t = 2;
pub const B110: crate::speed_t = 3;
pub const B134: crate::speed_t = 4;
pub const B150: crate::speed_t = 5;
pub const B200: crate::speed_t = 6;
pub const B300: crate::speed_t = 7;
pub const B600: crate::speed_t = 8;
pub const B1200: crate::speed_t = 9;
pub const B1800: crate::speed_t = 10;
pub const B2400: crate::speed_t = 11;
pub const B4800: crate::speed_t = 12;
pub const B9600: crate::speed_t = 13;
pub const B19200: crate::speed_t = 14;
pub const B38400: crate::speed_t = 15;
pub const EXTA: crate::speed_t = 14;
pub const EXTB: crate::speed_t = 15;
pub const B57600: crate::speed_t = 4097;
pub const B115200: crate::speed_t = 4098;
pub const B230400: crate::speed_t = 4099;
pub const B460800: crate::speed_t = 4100;
pub const B500000: crate::speed_t = 4101;
pub const B576000: crate::speed_t = 4102;
pub const B921600: crate::speed_t = 4103;
pub const B1000000: crate::speed_t = 4104;
pub const B1152000: crate::speed_t = 4105;
pub const B1500000: crate::speed_t = 4106;
pub const B2000000: crate::speed_t = 4107;
pub const B2500000: crate::speed_t = 4108;
pub const B3000000: crate::speed_t = 4109;
pub const B3500000: crate::speed_t = 4110;
pub const B4000000: crate::speed_t = 4111;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
pub const IEXTEN: crate::tcflag_t = 32768;
pub const TOSTOP: crate::tcflag_t = 256;
pub const FLUSHO: crate::tcflag_t = 4096;
pub const EXTPROC: crate::tcflag_t = 65536;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
pub const NGREG: usize = 32;
pub const REG_PC: usize = 0;
pub const REG_RA: usize = 1;
pub const REG_SP: usize = 2;
pub const REG_TP: usize = 4;
pub const REG_S0: usize = 8;
pub const REG_S1: usize = 9;
pub const REG_A0: usize = 10;
pub const REG_S2: usize = 18;
pub const REG_NARGS: usize = 8;
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_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;
@@ -0,0 +1,864 @@
//! SPARC-specific definitions for 32-bit linux-like values
use crate::prelude::*;
use crate::{off64_t, off_t};
pub type wchar_t = i32;
s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
pub sa_flags: c_int,
pub sa_restorer: Option<extern "C" fn()>,
}
pub struct statfs {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__fsword_t,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
f_spare: [crate::__fsword_t; 4],
}
pub struct siginfo_t {
pub si_signo: c_int,
pub si_errno: c_int,
pub si_code: c_int,
_pad: [c_int; 29],
_align: [usize; 0],
}
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: crate::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: crate::pid_t,
__reserved: c_short,
}
pub struct stack_t {
pub ss_sp: *mut c_void,
pub ss_flags: c_int,
pub ss_size: size_t,
}
pub struct stat {
pub st_dev: crate::dev_t,
#[cfg(not(gnu_file_offset_bits64))]
__pad1: c_ushort,
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad2: c_ushort,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__glibc_reserved4: c_ulong,
__glibc_reserved5: c_ulong,
}
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino64_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad2: c_ushort,
pub st_size: off64_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt64_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__glibc_reserved4: c_ulong,
__glibc_reserved5: c_ulong,
}
pub struct statfs64 {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__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: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
pub f_spare: [crate::__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 ipc_perm {
pub __key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::gid_t,
__pad1: c_ushort,
pub mode: c_ushort,
__pad2: c_ushort,
pub __seq: c_ushort,
__unused1: c_ulonglong,
__unused2: c_ulonglong,
}
pub struct shmid_ds {
pub shm_perm: crate::ipc_perm,
#[cfg(gnu_time_bits64)]
pub shm_segsz: size_t,
#[cfg(not(gnu_time_bits64))]
__pad1: c_uint,
pub shm_atime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__pad2: c_uint,
pub shm_dtime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__pad3: c_uint,
pub shm_ctime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
pub shm_segsz: size_t,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__reserved1: c_ulong,
__reserved2: c_ulong,
}
pub struct msqid_ds {
pub msg_perm: crate::ipc_perm,
#[cfg(not(gnu_time_bits64))]
__pad1: c_uint,
pub msg_stime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__pad2: c_uint,
pub msg_rtime: crate::time_t,
#[cfg(not(gnu_time_bits64))]
__pad3: c_uint,
pub msg_ctime: crate::time_t,
pub __msg_cbytes: c_ulong,
pub msg_qnum: crate::msgqnum_t,
pub msg_qbytes: crate::msglen_t,
pub msg_lspid: crate::pid_t,
pub msg_lrpid: crate::pid_t,
__glibc_reserved4: c_ulong,
__glibc_reserved5: c_ulong,
}
}
s_no_extra_traits! {
#[repr(align(8))]
pub struct max_align_t {
priv_: [i64; 3],
}
}
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_APPEND: c_int = 0x8;
pub const O_CREAT: c_int = 0x200;
pub const O_EXCL: c_int = 0x800;
pub const O_NOCTTY: c_int = 0x8000;
pub const O_NONBLOCK: c_int = 0x4000;
pub const O_SYNC: c_int = 0x802000;
pub const O_RSYNC: c_int = 0x802000;
pub const O_DSYNC: c_int = 0x2000;
pub const O_FSYNC: c_int = 0x802000;
pub const MADV_SOFT_OFFLINE: c_int = 101;
pub const MAP_GROWSDOWN: c_int = 0x0200;
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_SYNC: c_int = 0x080000;
pub const EDEADLK: c_int = 78;
pub const ENAMETOOLONG: c_int = 63;
pub const ENOLCK: c_int = 79;
pub const ENOSYS: c_int = 90;
pub const ENOTEMPTY: c_int = 66;
pub const ELOOP: c_int = 62;
pub const ENOMSG: c_int = 75;
pub const EIDRM: c_int = 77;
pub const ECHRNG: c_int = 94;
pub const EL2NSYNC: c_int = 95;
pub const EL3HLT: c_int = 96;
pub const EL3RST: c_int = 97;
pub const ELNRNG: c_int = 98;
pub const EUNATCH: c_int = 99;
pub const ENOCSI: c_int = 100;
pub const EL2HLT: c_int = 101;
pub const EBADE: c_int = 102;
pub const EBADR: c_int = 103;
pub const EXFULL: c_int = 104;
pub const ENOANO: c_int = 105;
pub const EBADRQC: c_int = 106;
pub const EBADSLT: c_int = 107;
pub const EMULTIHOP: c_int = 87;
pub const EOVERFLOW: c_int = 92;
pub const ENOTUNIQ: c_int = 115;
pub const EBADFD: c_int = 93;
pub const EBADMSG: c_int = 76;
pub const EREMCHG: c_int = 89;
pub const ELIBACC: c_int = 114;
pub const ELIBBAD: c_int = 112;
pub const ELIBSCN: c_int = 124;
pub const ELIBMAX: c_int = 123;
pub const ELIBEXEC: c_int = 110;
pub const EILSEQ: c_int = 122;
pub const ERESTART: c_int = 116;
pub const ESTRPIPE: c_int = 91;
pub const EUSERS: c_int = 68;
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 EHOSTDOWN: c_int = 64;
pub const EHOSTUNREACH: c_int = 65;
pub const EALREADY: c_int = 37;
pub const EINPROGRESS: c_int = 36;
pub const ESTALE: c_int = 70;
pub const EDQUOT: c_int = 69;
pub const ENOMEDIUM: c_int = 125;
pub const EMEDIUMTYPE: c_int = 126;
pub const ECANCELED: c_int = 127;
pub const ENOKEY: c_int = 128;
pub const EKEYEXPIRED: c_int = 129;
pub const EKEYREVOKED: c_int = 130;
pub const EKEYREJECTED: c_int = 131;
pub const EOWNERDEAD: c_int = 132;
pub const ENOTRECOVERABLE: c_int = 133;
pub const EHWPOISON: c_int = 135;
pub const ERFKILL: c_int = 134;
pub const SOCK_STREAM: c_int = 1;
pub const SOCK_DGRAM: c_int = 2;
pub const SA_SIGINFO: c_int = 0x200;
pub const SA_NOCLDWAIT: c_int = 0x100;
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 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 SIGPOLL: c_int = 23;
pub const SIGPWR: c_int = 29;
pub const SIG_SETMASK: c_int = 4;
pub const SIG_BLOCK: c_int = 1;
pub const SIG_UNBLOCK: c_int = 2;
pub const POLLWRNORM: c_short = 4;
pub const POLLWRBAND: c_short = 0x100;
pub const O_ASYNC: c_int = 0x40;
pub const O_NDELAY: c_int = 0x4004;
pub const EFD_NONBLOCK: c_int = 0x4000;
pub const F_GETLK: c_int = 7;
pub const F_GETOWN: c_int = 5;
pub const F_SETOWN: c_int = 6;
pub const SFD_NONBLOCK: c_int = 0x4000;
pub const TCSANOW: c_int = 0;
pub const TCSADRAIN: c_int = 1;
pub const TCSAFLUSH: c_int = 2;
pub const O_DIRECTORY: c_int = 0o200000;
pub const O_NOFOLLOW: c_int = 0o400000;
pub const O_LARGEFILE: c_int = 0x40000;
pub const O_DIRECT: c_int = 0x100000;
pub const MAP_LOCKED: c_int = 0x0100;
pub const MAP_NORESERVE: c_int = 0x00040;
pub const EDEADLOCK: c_int = 108;
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 MCL_CURRENT: c_int = 0x2000;
pub const MCL_FUTURE: c_int = 0x4000;
pub const MCL_ONFAULT: c_int = 0x8000;
pub const SIGSTKSZ: size_t = 16384;
pub const MINSIGSTKSZ: size_t = 4096;
pub const CBAUD: crate::tcflag_t = 0x0000100f;
pub const TAB1: crate::tcflag_t = 0x800;
pub const TAB2: crate::tcflag_t = 0x1000;
pub const TAB3: crate::tcflag_t = 0x1800;
pub const CR1: crate::tcflag_t = 0x200;
pub const CR2: crate::tcflag_t = 0x400;
pub const CR3: crate::tcflag_t = 0x600;
pub const FF1: crate::tcflag_t = 0x8000;
pub const BS1: crate::tcflag_t = 0x2000;
pub const VT1: crate::tcflag_t = 0x4000;
pub const VWERASE: usize = 0xe;
pub const VREPRINT: usize = 0xc;
pub const VSUSP: usize = 0xa;
pub const VSTART: usize = 0x8;
pub const VSTOP: usize = 0x9;
pub const VDISCARD: usize = 0xd;
pub const VTIME: usize = 0x5;
pub const IXON: crate::tcflag_t = 0x400;
pub const IXOFF: crate::tcflag_t = 0x1000;
pub const ONLCR: crate::tcflag_t = 0x4;
pub const CSIZE: crate::tcflag_t = 0x30;
pub const CS6: crate::tcflag_t = 0x10;
pub const CS7: crate::tcflag_t = 0x20;
pub const CS8: crate::tcflag_t = 0x30;
pub const CSTOPB: crate::tcflag_t = 0x40;
pub const CREAD: crate::tcflag_t = 0x80;
pub const PARENB: crate::tcflag_t = 0x100;
pub const PARODD: crate::tcflag_t = 0x200;
pub const HUPCL: crate::tcflag_t = 0x400;
pub const CLOCAL: crate::tcflag_t = 0x800;
pub const ECHOKE: crate::tcflag_t = 0x800;
pub const ECHOE: crate::tcflag_t = 0x10;
pub const ECHOK: crate::tcflag_t = 0x20;
pub const ECHONL: crate::tcflag_t = 0x40;
pub const ECHOPRT: crate::tcflag_t = 0x400;
pub const ECHOCTL: crate::tcflag_t = 0x200;
pub const ISIG: crate::tcflag_t = 0x1;
pub const ICANON: crate::tcflag_t = 0x2;
pub const PENDIN: crate::tcflag_t = 0x4000;
pub const NOFLSH: crate::tcflag_t = 0x80;
pub const CIBAUD: crate::tcflag_t = 0o02003600000;
pub const CBAUDEX: crate::tcflag_t = 0x00001000;
pub const VSWTC: usize = 7;
pub const OLCUC: crate::tcflag_t = 0o000002;
pub const NLDLY: crate::tcflag_t = 0o000400;
pub const CRDLY: crate::tcflag_t = 0o003000;
pub const TABDLY: crate::tcflag_t = 0o014000;
pub const BSDLY: crate::tcflag_t = 0o020000;
pub const FFDLY: crate::tcflag_t = 0o100000;
pub const VTDLY: crate::tcflag_t = 0o040000;
pub const XTABS: crate::tcflag_t = 0o014000;
pub const B0: crate::speed_t = 0o000000;
pub const B50: crate::speed_t = 0o000001;
pub const B75: crate::speed_t = 0o000002;
pub const B110: crate::speed_t = 0o000003;
pub const B134: crate::speed_t = 0o000004;
pub const B150: crate::speed_t = 0o000005;
pub const B200: crate::speed_t = 0o000006;
pub const B300: crate::speed_t = 0o000007;
pub const B600: crate::speed_t = 0o000010;
pub const B1200: crate::speed_t = 0o000011;
pub const B1800: crate::speed_t = 0o000012;
pub const B2400: crate::speed_t = 0o000013;
pub const B4800: crate::speed_t = 0o000014;
pub const B9600: crate::speed_t = 0o000015;
pub const B19200: crate::speed_t = 0o000016;
pub const B38400: crate::speed_t = 0o000017;
pub const EXTA: crate::speed_t = B19200;
pub const EXTB: crate::speed_t = B38400;
pub const B57600: crate::speed_t = 0x1001;
pub const B115200: crate::speed_t = 0x1002;
pub const B230400: crate::speed_t = 0x1003;
pub const B460800: crate::speed_t = 0x1004;
pub const B76800: crate::speed_t = 0x1005;
pub const B153600: crate::speed_t = 0x1006;
pub const B307200: crate::speed_t = 0x1007;
pub const B614400: crate::speed_t = 0x1008;
pub const B921600: crate::speed_t = 0x1009;
pub const B500000: crate::speed_t = 0x100a;
pub const B576000: crate::speed_t = 0x100b;
pub const B1000000: crate::speed_t = 0x100c;
pub const B1152000: crate::speed_t = 0x100d;
pub const B1500000: crate::speed_t = 0x100e;
pub const B2000000: crate::speed_t = 0x100f;
pub const VEOL: usize = 5;
pub const VEOL2: usize = 6;
pub const VMIN: usize = 4;
pub const IEXTEN: crate::tcflag_t = 0x8000;
pub const TOSTOP: crate::tcflag_t = 0x100;
pub const FLUSHO: crate::tcflag_t = 0x1000;
pub const EXTPROC: crate::tcflag_t = 0x10000;
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_wait4: 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_execv: c_long = 11;
pub const SYS_chdir: c_long = 12;
pub const SYS_chown: 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_brk: c_long = 17;
pub const SYS_perfctr: c_long = 18;
pub const SYS_lseek: c_long = 19;
pub const SYS_getpid: c_long = 20;
pub const SYS_capget: c_long = 21;
pub const SYS_capset: c_long = 22;
pub const SYS_setuid: c_long = 23;
pub const SYS_getuid: c_long = 24;
pub const SYS_vmsplice: c_long = 25;
pub const SYS_ptrace: c_long = 26;
pub const SYS_alarm: c_long = 27;
pub const SYS_sigaltstack: c_long = 28;
pub const SYS_pause: c_long = 29;
pub const SYS_utime: c_long = 30;
pub const SYS_lchown32: c_long = 31;
pub const SYS_fchown32: c_long = 32;
pub const SYS_access: c_long = 33;
pub const SYS_nice: c_long = 34;
pub const SYS_chown32: c_long = 35;
pub const SYS_sync: c_long = 36;
pub const SYS_kill: c_long = 37;
pub const SYS_stat: c_long = 38;
pub const SYS_sendfile: c_long = 39;
pub const SYS_lstat: 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_getuid32: c_long = 44;
pub const SYS_umount2: 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_getgid32: c_long = 53;
pub const SYS_ioctl: c_long = 54;
pub const SYS_reboot: c_long = 55;
pub const SYS_mmap2: c_long = 56;
pub const SYS_symlink: c_long = 57;
pub const SYS_readlink: c_long = 58;
pub const SYS_execve: c_long = 59;
pub const SYS_umask: c_long = 60;
pub const SYS_chroot: c_long = 61;
pub const SYS_fstat: c_long = 62;
pub const SYS_fstat64: c_long = 63;
pub const SYS_getpagesize: c_long = 64;
pub const SYS_msync: c_long = 65;
pub const SYS_vfork: c_long = 66;
pub const SYS_pread64: c_long = 67;
pub const SYS_pwrite64: c_long = 68;
pub const SYS_geteuid32: c_long = 69;
pub const SYS_getegid32: c_long = 70;
pub const SYS_mmap: c_long = 71;
pub const SYS_setreuid32: c_long = 72;
pub const SYS_munmap: c_long = 73;
pub const SYS_mprotect: c_long = 74;
pub const SYS_madvise: c_long = 75;
pub const SYS_vhangup: c_long = 76;
pub const SYS_truncate64: c_long = 77;
pub const SYS_mincore: c_long = 78;
pub const SYS_getgroups: c_long = 79;
pub const SYS_setgroups: c_long = 80;
pub const SYS_getpgrp: c_long = 81;
pub const SYS_setgroups32: c_long = 82;
pub const SYS_setitimer: c_long = 83;
pub const SYS_ftruncate64: c_long = 84;
pub const SYS_swapon: c_long = 85;
pub const SYS_getitimer: c_long = 86;
pub const SYS_setuid32: c_long = 87;
pub const SYS_sethostname: c_long = 88;
pub const SYS_setgid32: c_long = 89;
pub const SYS_dup2: c_long = 90;
pub const SYS_setfsuid32: c_long = 91;
pub const SYS_fcntl: c_long = 92;
pub const SYS_select: c_long = 93;
pub const SYS_setfsgid32: c_long = 94;
pub const SYS_fsync: c_long = 95;
pub const SYS_setpriority: c_long = 96;
pub const SYS_socket: c_long = 97;
pub const SYS_connect: c_long = 98;
pub const SYS_accept: c_long = 99;
pub const SYS_getpriority: c_long = 100;
pub const SYS_rt_sigreturn: c_long = 101;
pub const SYS_rt_sigaction: c_long = 102;
pub const SYS_rt_sigprocmask: c_long = 103;
pub const SYS_rt_sigpending: c_long = 104;
pub const SYS_rt_sigtimedwait: c_long = 105;
pub const SYS_rt_sigqueueinfo: c_long = 106;
pub const SYS_rt_sigsuspend: c_long = 107;
pub const SYS_setresuid32: c_long = 108;
pub const SYS_getresuid32: c_long = 109;
pub const SYS_setresgid32: c_long = 110;
pub const SYS_getresgid32: c_long = 111;
pub const SYS_setregid32: c_long = 112;
pub const SYS_recvmsg: c_long = 113;
pub const SYS_sendmsg: c_long = 114;
pub const SYS_getgroups32: c_long = 115;
pub const SYS_gettimeofday: c_long = 116;
pub const SYS_getrusage: c_long = 117;
pub const SYS_getsockopt: c_long = 118;
pub const SYS_getcwd: c_long = 119;
pub const SYS_readv: c_long = 120;
pub const SYS_writev: c_long = 121;
pub const SYS_settimeofday: c_long = 122;
pub const SYS_fchown: c_long = 123;
pub const SYS_fchmod: c_long = 124;
pub const SYS_recvfrom: c_long = 125;
pub const SYS_setreuid: c_long = 126;
pub const SYS_setregid: c_long = 127;
pub const SYS_rename: c_long = 128;
pub const SYS_truncate: c_long = 129;
pub const SYS_ftruncate: c_long = 130;
pub const SYS_flock: c_long = 131;
pub const SYS_lstat64: c_long = 132;
pub const SYS_sendto: c_long = 133;
pub const SYS_shutdown: c_long = 134;
pub const SYS_socketpair: c_long = 135;
pub const SYS_mkdir: c_long = 136;
pub const SYS_rmdir: c_long = 137;
pub const SYS_utimes: c_long = 138;
pub const SYS_stat64: c_long = 139;
pub const SYS_sendfile64: c_long = 140;
pub const SYS_getpeername: c_long = 141;
pub const SYS_futex: c_long = 142;
pub const SYS_gettid: c_long = 143;
pub const SYS_getrlimit: c_long = 144;
pub const SYS_setrlimit: c_long = 145;
pub const SYS_pivot_root: c_long = 146;
pub const SYS_prctl: c_long = 147;
pub const SYS_pciconfig_read: c_long = 148;
pub const SYS_pciconfig_write: c_long = 149;
pub const SYS_getsockname: c_long = 150;
pub const SYS_inotify_init: c_long = 151;
pub const SYS_inotify_add_watch: c_long = 152;
pub const SYS_poll: c_long = 153;
pub const SYS_getdents64: c_long = 154;
pub const SYS_fcntl64: c_long = 155;
pub const SYS_inotify_rm_watch: c_long = 156;
pub const SYS_statfs: c_long = 157;
pub const SYS_fstatfs: c_long = 158;
pub const SYS_umount: c_long = 159;
pub const SYS_sched_set_affinity: c_long = 160;
pub const SYS_sched_get_affinity: c_long = 161;
pub const SYS_getdomainname: c_long = 162;
pub const SYS_setdomainname: c_long = 163;
pub const SYS_quotactl: c_long = 165;
pub const SYS_set_tid_address: c_long = 166;
pub const SYS_mount: c_long = 167;
pub const SYS_ustat: c_long = 168;
pub const SYS_setxattr: c_long = 169;
pub const SYS_lsetxattr: c_long = 170;
pub const SYS_fsetxattr: c_long = 171;
pub const SYS_getxattr: c_long = 172;
pub const SYS_lgetxattr: c_long = 173;
pub const SYS_getdents: c_long = 174;
pub const SYS_setsid: c_long = 175;
pub const SYS_fchdir: c_long = 176;
pub const SYS_fgetxattr: c_long = 177;
pub const SYS_listxattr: c_long = 178;
pub const SYS_llistxattr: c_long = 179;
pub const SYS_flistxattr: c_long = 180;
pub const SYS_removexattr: c_long = 181;
pub const SYS_lremovexattr: c_long = 182;
pub const SYS_sigpending: c_long = 183;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_query_module: c_long = 184;
pub const SYS_setpgid: c_long = 185;
pub const SYS_fremovexattr: c_long = 186;
pub const SYS_tkill: c_long = 187;
pub const SYS_exit_group: c_long = 188;
pub const SYS_uname: c_long = 189;
pub const SYS_init_module: c_long = 190;
pub const SYS_personality: c_long = 191;
pub const SYS_remap_file_pages: c_long = 192;
pub const SYS_epoll_create: c_long = 193;
pub const SYS_epoll_ctl: c_long = 194;
pub const SYS_epoll_wait: c_long = 195;
pub const SYS_ioprio_set: c_long = 196;
pub const SYS_getppid: c_long = 197;
pub const SYS_sigaction: c_long = 198;
pub const SYS_sgetmask: c_long = 199;
pub const SYS_ssetmask: c_long = 200;
pub const SYS_sigsuspend: c_long = 201;
pub const SYS_oldlstat: c_long = 202;
pub const SYS_uselib: c_long = 203;
pub const SYS_readdir: c_long = 204;
pub const SYS_readahead: c_long = 205;
pub const SYS_socketcall: c_long = 206;
pub const SYS_syslog: c_long = 207;
pub const SYS_lookup_dcookie: c_long = 208;
pub const SYS_fadvise64: c_long = 209;
pub const SYS_fadvise64_64: c_long = 210;
pub const SYS_tgkill: c_long = 211;
pub const SYS_waitpid: c_long = 212;
pub const SYS_swapoff: c_long = 213;
pub const SYS_sysinfo: c_long = 214;
pub const SYS_ipc: c_long = 215;
pub const SYS_sigreturn: c_long = 216;
pub const SYS_clone: c_long = 217;
pub const SYS_ioprio_get: c_long = 218;
pub const SYS_adjtimex: c_long = 219;
pub const SYS_sigprocmask: c_long = 220;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 221;
pub const SYS_delete_module: c_long = 222;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_get_kernel_syms: c_long = 223;
pub const SYS_getpgid: c_long = 224;
pub const SYS_bdflush: c_long = 225;
pub const SYS_sysfs: c_long = 226;
pub const SYS_afs_syscall: c_long = 227;
pub const SYS_setfsuid: c_long = 228;
pub const SYS_setfsgid: c_long = 229;
pub const SYS__newselect: c_long = 230;
pub const SYS_time: c_long = 231;
pub const SYS_splice: c_long = 232;
pub const SYS_stime: c_long = 233;
pub const SYS_statfs64: c_long = 234;
pub const SYS_fstatfs64: c_long = 235;
pub const SYS__llseek: c_long = 236;
pub const SYS_mlock: c_long = 237;
pub const SYS_munlock: c_long = 238;
pub const SYS_mlockall: c_long = 239;
pub const SYS_munlockall: c_long = 240;
pub const SYS_sched_setparam: c_long = 241;
pub const SYS_sched_getparam: c_long = 242;
pub const SYS_sched_setscheduler: c_long = 243;
pub const SYS_sched_getscheduler: c_long = 244;
pub const SYS_sched_yield: c_long = 245;
pub const SYS_sched_get_priority_max: c_long = 246;
pub const SYS_sched_get_priority_min: c_long = 247;
pub const SYS_sched_rr_get_interval: c_long = 248;
pub const SYS_nanosleep: c_long = 249;
pub const SYS_mremap: c_long = 250;
pub const SYS__sysctl: c_long = 251;
pub const SYS_getsid: c_long = 252;
pub const SYS_fdatasync: c_long = 253;
pub const SYS_nfsservctl: c_long = 254;
pub const SYS_sync_file_range: c_long = 255;
pub const SYS_clock_settime: c_long = 256;
pub const SYS_clock_gettime: c_long = 257;
pub const SYS_clock_getres: c_long = 258;
pub const SYS_clock_nanosleep: c_long = 259;
pub const SYS_sched_getaffinity: c_long = 260;
pub const SYS_sched_setaffinity: c_long = 261;
pub const SYS_timer_settime: c_long = 262;
pub const SYS_timer_gettime: c_long = 263;
pub const SYS_timer_getoverrun: c_long = 264;
pub const SYS_timer_delete: c_long = 265;
pub const SYS_timer_create: c_long = 266;
pub const SYS_io_setup: c_long = 268;
pub const SYS_io_destroy: c_long = 269;
pub const SYS_io_submit: c_long = 270;
pub const SYS_io_cancel: c_long = 271;
pub const SYS_io_getevents: c_long = 272;
pub const SYS_mq_open: c_long = 273;
pub const SYS_mq_unlink: c_long = 274;
pub const SYS_mq_timedsend: c_long = 275;
pub const SYS_mq_timedreceive: c_long = 276;
pub const SYS_mq_notify: c_long = 277;
pub const SYS_mq_getsetattr: c_long = 278;
pub const SYS_waitid: c_long = 279;
pub const SYS_tee: c_long = 280;
pub const SYS_add_key: c_long = 281;
pub const SYS_request_key: c_long = 282;
pub const SYS_keyctl: c_long = 283;
pub const SYS_openat: c_long = 284;
pub const SYS_mkdirat: c_long = 285;
pub const SYS_mknodat: c_long = 286;
pub const SYS_fchownat: c_long = 287;
pub const SYS_futimesat: c_long = 288;
pub const SYS_fstatat64: c_long = 289;
pub const SYS_unlinkat: c_long = 290;
pub const SYS_renameat: c_long = 291;
pub const SYS_linkat: c_long = 292;
pub const SYS_symlinkat: c_long = 293;
pub const SYS_readlinkat: c_long = 294;
pub const SYS_fchmodat: c_long = 295;
pub const SYS_faccessat: c_long = 296;
pub const SYS_pselect6: c_long = 297;
pub const SYS_ppoll: c_long = 298;
pub const SYS_unshare: c_long = 299;
pub const SYS_set_robust_list: c_long = 300;
pub const SYS_get_robust_list: c_long = 301;
pub const SYS_migrate_pages: c_long = 302;
pub const SYS_mbind: c_long = 303;
pub const SYS_get_mempolicy: c_long = 304;
pub const SYS_set_mempolicy: c_long = 305;
pub const SYS_kexec_load: c_long = 306;
pub const SYS_move_pages: c_long = 307;
pub const SYS_getcpu: c_long = 308;
pub const SYS_epoll_pwait: c_long = 309;
pub const SYS_utimensat: c_long = 310;
pub const SYS_signalfd: c_long = 311;
pub const SYS_timerfd_create: c_long = 312;
pub const SYS_eventfd: c_long = 313;
pub const SYS_fallocate: c_long = 314;
pub const SYS_timerfd_settime: c_long = 315;
pub const SYS_timerfd_gettime: c_long = 316;
pub const SYS_signalfd4: c_long = 317;
pub const SYS_eventfd2: c_long = 318;
pub const SYS_epoll_create1: c_long = 319;
pub const SYS_dup3: c_long = 320;
pub const SYS_pipe2: c_long = 321;
pub const SYS_inotify_init1: c_long = 322;
pub const SYS_accept4: c_long = 323;
pub const SYS_preadv: c_long = 324;
pub const SYS_pwritev: c_long = 325;
pub const SYS_rt_tgsigqueueinfo: c_long = 326;
pub const SYS_perf_event_open: c_long = 327;
pub const SYS_recvmmsg: c_long = 328;
pub const SYS_fanotify_init: c_long = 329;
pub const SYS_fanotify_mark: c_long = 330;
pub const SYS_prlimit64: c_long = 331;
pub const SYS_name_to_handle_at: c_long = 332;
pub const SYS_open_by_handle_at: c_long = 333;
pub const SYS_clock_adjtime: c_long = 334;
pub const SYS_syncfs: c_long = 335;
pub const SYS_sendmmsg: c_long = 336;
pub const SYS_setns: c_long = 337;
pub const SYS_process_vm_readv: c_long = 338;
pub const SYS_process_vm_writev: c_long = 339;
pub const SYS_kern_features: c_long = 340;
pub const SYS_kcmp: c_long = 341;
pub const SYS_finit_module: c_long = 342;
pub const SYS_sched_setattr: c_long = 343;
pub const SYS_sched_getattr: c_long = 344;
pub const SYS_renameat2: c_long = 345;
pub const SYS_seccomp: c_long = 346;
pub const SYS_getrandom: c_long = 347;
pub const SYS_memfd_create: c_long = 348;
pub const SYS_bpf: c_long = 349;
pub const SYS_execveat: c_long = 350;
pub const SYS_membarrier: c_long = 351;
pub const SYS_userfaultfd: c_long = 352;
pub const SYS_bind: c_long = 353;
pub const SYS_listen: c_long = 354;
pub const SYS_setsockopt: c_long = 355;
pub const SYS_mlock2: c_long = 356;
pub const SYS_copy_file_range: c_long = 357;
pub const SYS_preadv2: c_long = 358;
pub const SYS_pwritev2: c_long = 359;
pub const SYS_statx: c_long = 360;
pub const SYS_rseq: c_long = 365;
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;
// Reserved in the kernel, but not actually implemented yet
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;
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,54 @@
use crate::prelude::*;
use crate::pthread_mutex_t;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 48;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
#[cfg(target_endian = "little")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::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, 0, 0, 0, 0, 0, 0,
0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::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, 0, 0, 0, 0, 0, 0,
0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::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, 0, 0, 0, 0, 0, 0,
0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::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, 0, 0, 0, 0, 0, 0,
0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::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, 0, 0, 0, 0, 0, 0,
0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::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, 0, 0, 0, 0, 0, 0,
0, 0,
],
};
pub const SYS_sync_file_range2: c_long = 84;
@@ -0,0 +1,57 @@
use crate::prelude::*;
use crate::pthread_mutex_t;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 48;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 8;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 8;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
#[cfg(target_endian = "little")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
pub const SYS_renameat: c_long = 38;
pub const SYS_sync_file_range: c_long = 84;
pub const SYS_getrlimit: c_long = 163;
pub const SYS_setrlimit: c_long = 164;
@@ -0,0 +1,973 @@
//! AArch64-specific definitions for 64-bit linux-like values
use crate::prelude::*;
use crate::{off64_t, off_t};
pub type wchar_t = u32;
pub type nlink_t = u32;
pub type blksize_t = i32;
pub type suseconds_t = i64;
pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;
s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
#[cfg(target_arch = "sparc64")]
__reserved0: c_int,
pub sa_flags: c_int,
pub sa_restorer: Option<extern "C" fn()>,
}
pub struct statfs {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__fsword_t,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
f_spare: [crate::__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: crate::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: crate::pid_t,
}
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad1: crate::dev_t,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
__pad2: c_int,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__unused: [c_int; 2],
}
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad1: crate::dev_t,
pub st_size: off64_t,
pub st_blksize: crate::blksize_t,
__pad2: c_int,
pub st_blocks: crate::blkcnt64_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__unused: [c_int; 2],
}
pub struct statfs64 {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__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: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
pub f_spare: [crate::__fsword_t; 4],
}
pub struct statvfs {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_favail: crate::fsfilcnt_t,
pub f_fsid: c_ulong,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
__f_spare: [c_int; 6],
}
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_attr_t {
__size: [usize; 8],
}
pub struct user_regs_struct {
pub regs: [c_ulonglong; 31],
pub sp: c_ulonglong,
pub pc: c_ulonglong,
pub pstate: c_ulonglong,
}
pub struct ipc_perm {
pub __key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::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: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__unused4: c_ulong,
__unused5: 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 ucontext_t {
pub uc_flags: c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: crate::stack_t,
pub uc_sigmask: crate::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,
__reserved: [u64; 512],
}
pub struct user_fpsimd_struct {
pub vregs: [crate::__uint128_t; 32],
pub fpsr: c_uint,
pub fpcr: c_uint,
}
#[repr(align(8))]
pub struct clone_args {
pub flags: c_ulonglong,
pub pidfd: c_ulonglong,
pub child_tid: c_ulonglong,
pub parent_tid: c_ulonglong,
pub exit_signal: c_ulonglong,
pub stack: c_ulonglong,
pub stack_size: c_ulonglong,
pub tls: c_ulonglong,
pub set_tid: c_ulonglong,
pub set_tid_size: c_ulonglong,
pub cgroup: c_ulonglong,
}
}
s_no_extra_traits! {
#[repr(align(16))]
pub struct max_align_t {
priv_: [f32; 8],
}
}
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_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_NOATIME: c_int = 0o1000000;
pub const O_PATH: c_int = 0o10000000;
pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY;
pub const MADV_SOFT_OFFLINE: c_int = 101;
pub const MAP_GROWSDOWN: c_int = 0x0100;
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 POSIX_FADV_DONTNEED: c_int = 4;
pub const POSIX_FADV_NOREUSE: c_int = 5;
pub const SOCK_STREAM: c_int = 1;
pub const SOCK_DGRAM: c_int = 2;
pub const SA_ONSTACK: c_int = 0x08000000;
pub const SA_SIGINFO: c_int = 0x00000004;
pub const SA_NOCLDWAIT: c_int = 0x00000002;
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 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 POLLWRNORM: c_short = 0x100;
pub const POLLWRBAND: c_short = 0x200;
pub const O_ASYNC: c_int = 0x2000;
pub const O_NDELAY: c_int = 0x800;
pub const PTRACE_DETACH: c_uint = 17;
pub const EFD_NONBLOCK: c_int = 0x800;
pub const F_GETLK: c_int = 5;
pub const F_GETOWN: c_int = 9;
pub const F_SETOWN: c_int = 8;
pub const F_SETLK: c_int = 6;
pub const F_SETLKW: c_int = 7;
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 F_RDLCK: c_int = 0;
pub const F_WRLCK: c_int = 1;
pub const F_UNLCK: c_int = 2;
pub const SFD_NONBLOCK: c_int = 0x0800;
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;
pub const O_DIRECT: c_int = 0x10000;
pub const O_DIRECTORY: c_int = 0x4000;
pub const O_NOFOLLOW: c_int = 0x8000;
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_SYNC: c_int = 0x080000;
pub const EDEADLOCK: c_int = 35;
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 = 16384;
pub const MINSIGSTKSZ: size_t = 5120;
pub const CBAUD: crate::tcflag_t = 0o0010017;
pub const TAB1: crate::tcflag_t = 0x00000800;
pub const TAB2: crate::tcflag_t = 0x00001000;
pub const TAB3: crate::tcflag_t = 0x00001800;
pub const CR1: crate::tcflag_t = 0x00000200;
pub const CR2: crate::tcflag_t = 0x00000400;
pub const CR3: crate::tcflag_t = 0x00000600;
pub const FF1: crate::tcflag_t = 0x00008000;
pub const BS1: crate::tcflag_t = 0x00002000;
pub const VT1: crate::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: crate::tcflag_t = 0x00000400;
pub const IXOFF: crate::tcflag_t = 0x00001000;
pub const ONLCR: crate::tcflag_t = 0x4;
pub const CSIZE: crate::tcflag_t = 0x00000030;
pub const CS6: crate::tcflag_t = 0x00000010;
pub const CS7: crate::tcflag_t = 0x00000020;
pub const CS8: crate::tcflag_t = 0x00000030;
pub const CSTOPB: crate::tcflag_t = 0x00000040;
pub const CREAD: crate::tcflag_t = 0x00000080;
pub const PARENB: crate::tcflag_t = 0x00000100;
pub const PARODD: crate::tcflag_t = 0x00000200;
pub const HUPCL: crate::tcflag_t = 0x00000400;
pub const CLOCAL: crate::tcflag_t = 0x00000800;
pub const ECHOKE: crate::tcflag_t = 0x00000800;
pub const ECHOE: crate::tcflag_t = 0x00000010;
pub const ECHOK: crate::tcflag_t = 0x00000020;
pub const ECHONL: crate::tcflag_t = 0x00000040;
pub const ECHOPRT: crate::tcflag_t = 0x00000400;
pub const ECHOCTL: crate::tcflag_t = 0x00000200;
pub const ISIG: crate::tcflag_t = 0x00000001;
pub const ICANON: crate::tcflag_t = 0x00000002;
pub const PENDIN: crate::tcflag_t = 0x00004000;
pub const NOFLSH: crate::tcflag_t = 0x00000080;
pub const CIBAUD: crate::tcflag_t = 0o02003600000;
pub const CBAUDEX: crate::tcflag_t = 0o010000;
pub const VSWTC: usize = 7;
pub const OLCUC: crate::tcflag_t = 0o000002;
pub const NLDLY: crate::tcflag_t = 0o000400;
pub const CRDLY: crate::tcflag_t = 0o003000;
pub const TABDLY: crate::tcflag_t = 0o014000;
pub const BSDLY: crate::tcflag_t = 0o020000;
pub const FFDLY: crate::tcflag_t = 0o100000;
pub const VTDLY: crate::tcflag_t = 0o040000;
pub const XTABS: crate::tcflag_t = 0o014000;
pub const B0: crate::speed_t = 0o000000;
pub const B50: crate::speed_t = 0o000001;
pub const B75: crate::speed_t = 0o000002;
pub const B110: crate::speed_t = 0o000003;
pub const B134: crate::speed_t = 0o000004;
pub const B150: crate::speed_t = 0o000005;
pub const B200: crate::speed_t = 0o000006;
pub const B300: crate::speed_t = 0o000007;
pub const B600: crate::speed_t = 0o000010;
pub const B1200: crate::speed_t = 0o000011;
pub const B1800: crate::speed_t = 0o000012;
pub const B2400: crate::speed_t = 0o000013;
pub const B4800: crate::speed_t = 0o000014;
pub const B9600: crate::speed_t = 0o000015;
pub const B19200: crate::speed_t = 0o000016;
pub const B38400: crate::speed_t = 0o000017;
pub const EXTA: crate::speed_t = B19200;
pub const EXTB: crate::speed_t = B38400;
pub const B57600: crate::speed_t = 0o010001;
pub const B115200: crate::speed_t = 0o010002;
pub const B230400: crate::speed_t = 0o010003;
pub const B460800: crate::speed_t = 0o010004;
pub const B500000: crate::speed_t = 0o010005;
pub const B576000: crate::speed_t = 0o010006;
pub const B921600: crate::speed_t = 0o010007;
pub const B1000000: crate::speed_t = 0o010010;
pub const B1152000: crate::speed_t = 0o010011;
pub const B1500000: crate::speed_t = 0o010012;
pub const B2000000: crate::speed_t = 0o010013;
pub const B2500000: crate::speed_t = 0o010014;
pub const B3000000: crate::speed_t = 0o010015;
pub const B3500000: crate::speed_t = 0o010016;
pub const B4000000: crate::speed_t = 0o010017;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
pub const IEXTEN: crate::tcflag_t = 0x00008000;
pub const TOSTOP: crate::tcflag_t = 0x00000100;
pub const FLUSHO: crate::tcflag_t = 0x00001000;
pub const EXTPROC: crate::tcflag_t = 0x00010000;
pub const TCSANOW: c_int = 0;
pub const TCSADRAIN: c_int = 1;
pub const TCSAFLUSH: c_int = 2;
// sys/auxv.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;
// FIXME(linux): enable these again once linux-api-headers are up to date enough on CI.
// See discussion in https://github.com/rust-lang/libc/pull/1638
//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_MTE: c_ulong = 1 << 18;
// linux/prctl.h
pub const PR_PAC_RESET_KEYS: c_int = 54;
pub const PR_SET_TAGGED_ADDR_CTRL: c_int = 55;
pub const PR_GET_TAGGED_ADDR_CTRL: c_int = 56;
pub const PR_PAC_SET_ENABLED_KEYS: c_int = 60;
pub const PR_PAC_GET_ENABLED_KEYS: c_int = 61;
pub const PR_TAGGED_ADDR_ENABLE: c_ulong = 1;
pub const PR_PAC_APIAKEY: c_ulong = 1 << 0;
pub const PR_PAC_APIBKEY: c_ulong = 1 << 1;
pub const PR_PAC_APDAKEY: c_ulong = 1 << 2;
pub const PR_PAC_APDBKEY: c_ulong = 1 << 3;
pub const PR_PAC_APGAKEY: c_ulong = 1 << 4;
pub const PR_SME_SET_VL: c_int = 63;
pub const PR_SME_GET_VL: c_int = 64;
pub const PR_SME_VL_LEN_MAX: c_int = 0xffff;
pub const PR_SME_SET_VL_INHERIT: c_ulong = 1 << 17;
pub const PR_SME_SET_VL_ONE_EXEC: c_ulong = 1 << 18;
// Syscall table
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;
// 38 is renameat only on LP64
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_statfs: c_long = 43;
pub const SYS_fstatfs: c_long = 44;
pub const SYS_truncate: c_long = 45;
pub const SYS_ftruncate: c_long = 46;
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_newfstatat: c_long = 79;
pub const SYS_fstat: c_long = 80;
pub const SYS_sync: c_long = 81;
pub const SYS_fsync: c_long = 82;
pub const SYS_fdatasync: c_long = 83;
// 84 sync_file_range on LP64 and sync_file_range2 on ILP32
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;
// 163 is getrlimit only on LP64
// 164 is setrlimit only on LP64
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_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_rseq: c_long = 293;
pub const SYS_kexec_file_load: 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;
pub const SYS_mseal: c_long = 462;
pub const PROT_BTI: c_int = 0x10;
pub const PROT_MTE: c_int = 0x20;
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;
pub fn getcontext(ucp: *mut ucontext_t) -> c_int;
pub fn setcontext(ucp: *const ucontext_t) -> c_int;
pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: c_int, ...);
pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> c_int;
}
cfg_if! {
if #[cfg(target_pointer_width = "32")] {
mod ilp32;
pub use self::ilp32::*;
} else {
mod lp64;
pub use self::lp64::*;
}
}
@@ -0,0 +1,922 @@
use crate::prelude::*;
use crate::{off64_t, off_t, pthread_mutex_t};
pub type wchar_t = i32;
pub type blksize_t = i32;
pub type nlink_t = u32;
pub type suseconds_t = i64;
pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;
s! {
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad1: crate::dev_t,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
__pad2: c_int,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__unused: [c_int; 2],
}
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino64_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
pub __pad1: crate::dev_t,
pub st_size: off64_t,
pub st_blksize: crate::blksize_t,
pub __pad2: c_int,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__unused: [c_int; 2],
}
pub struct statfs {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__fsword_t,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
pub f_spare: [crate::__fsword_t; 4],
}
pub struct statfs64 {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__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: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
pub f_spare: [crate::__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: crate::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: crate::pid_t,
}
pub struct statvfs {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_favail: crate::fsfilcnt_t,
pub f_fsid: c_ulong,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
__f_spare: [c_int; 6],
}
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_attr_t {
__size: [c_ulong; 7],
}
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
pub sa_flags: c_int,
pub sa_restorer: Option<extern "C" fn()>,
}
pub struct stack_t {
pub ss_sp: *mut c_void,
pub ss_flags: c_int,
pub ss_size: size_t,
}
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: [u64; 0],
}
pub struct ipc_perm {
pub __key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::gid_t,
pub mode: c_uint,
pub __seq: c_ushort,
__pad2: c_ushort,
__unused1: c_ulong,
__unused2: c_ulong,
}
pub struct shmid_ds {
pub shm_perm: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__unused4: c_ulong,
__unused5: c_ulong,
}
pub struct user_regs_struct {
pub regs: [u64; 32],
pub orig_a0: u64,
pub csr_era: u64,
pub csr_badv: u64,
pub reserved: [u64; 10],
}
pub struct user_fp_struct {
pub fpr: [u64; 32],
pub fcc: u64,
pub fcsr: u32,
}
pub struct ucontext_t {
pub uc_flags: c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: crate::stack_t,
pub uc_sigmask: crate::sigset_t,
pub uc_mcontext: mcontext_t,
}
#[repr(align(16))]
pub struct mcontext_t {
pub __pc: c_ulonglong,
pub __gregs: [c_ulonglong; 32],
pub __flags: c_uint,
pub __extcontext: [c_ulonglong; 0],
}
#[repr(align(8))]
pub struct clone_args {
pub flags: c_ulonglong,
pub pidfd: c_ulonglong,
pub child_tid: c_ulonglong,
pub parent_tid: c_ulonglong,
pub exit_signal: c_ulonglong,
pub stack: c_ulonglong,
pub stack_size: c_ulonglong,
pub tls: c_ulonglong,
pub set_tid: c_ulonglong,
pub set_tid_size: c_ulonglong,
pub cgroup: c_ulonglong,
}
}
s_no_extra_traits! {
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 4],
}
}
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
#[cfg(target_endian = "little")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
pub const HWCAP_LOONGARCH_CPUCFG: c_ulong = 1 << 0;
pub const HWCAP_LOONGARCH_LAM: c_ulong = 1 << 1;
pub const HWCAP_LOONGARCH_UAL: c_ulong = 1 << 2;
pub const HWCAP_LOONGARCH_FPU: c_ulong = 1 << 3;
pub const HWCAP_LOONGARCH_LSX: c_ulong = 1 << 4;
pub const HWCAP_LOONGARCH_LASX: c_ulong = 1 << 5;
pub const HWCAP_LOONGARCH_CRC32: c_ulong = 1 << 6;
pub const HWCAP_LOONGARCH_COMPLEX: c_ulong = 1 << 7;
pub const HWCAP_LOONGARCH_CRYPTO: c_ulong = 1 << 8;
pub const HWCAP_LOONGARCH_LVZ: c_ulong = 1 << 9;
pub const HWCAP_LOONGARCH_LBT_X86: c_ulong = 1 << 10;
pub const HWCAP_LOONGARCH_LBT_ARM: c_ulong = 1 << 11;
pub const HWCAP_LOONGARCH_LBT_MIPS: c_ulong = 1 << 12;
pub const HWCAP_LOONGARCH_PTW: c_ulong = 1 << 13;
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_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_statfs: c_long = 43;
pub const SYS_fstatfs: c_long = 44;
pub const SYS_truncate: c_long = 45;
pub const SYS_ftruncate: c_long = 46;
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_sendfile: c_long = 71;
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_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_fadvise64: c_long = 223;
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_io_pgetevents: c_long = 292;
pub const SYS_rseq: c_long = 293;
pub const SYS_kexec_file_load: 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_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 POSIX_FADV_DONTNEED: c_int = 4;
pub const POSIX_FADV_NOREUSE: c_int = 5;
pub const O_DIRECT: c_int = 0o00040000;
pub const O_DIRECTORY: c_int = 0o00200000;
pub const O_NOFOLLOW: c_int = 0o00400000;
pub const O_TRUNC: c_int = 0o00001000;
pub const O_NOATIME: c_int = 0o1000000;
pub const O_CLOEXEC: c_int = 0o02000000;
pub const O_PATH: c_int = 0o10000000;
pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY;
pub const O_APPEND: c_int = 0o00002000;
pub const O_CREAT: c_int = 0o00000100;
pub const O_EXCL: c_int = 0o00000200;
pub const O_NOCTTY: c_int = 0o00000400;
pub const O_NONBLOCK: c_int = 0o00004000;
pub const FASYNC: c_int = 0o00020000;
pub const O_SYNC: c_int = 0o04010000;
pub const O_RSYNC: c_int = 0o04010000;
pub const O_FSYNC: c_int = O_SYNC;
pub const O_ASYNC: c_int = 0o00020000;
pub const O_DSYNC: c_int = 0o00010000;
pub const O_NDELAY: c_int = O_NONBLOCK;
pub const F_RDLCK: c_int = 0;
pub const F_WRLCK: c_int = 1;
pub const F_UNLCK: c_int = 2;
pub const F_GETLK: c_int = 5;
pub const F_SETLK: c_int = 6;
pub const F_SETLKW: c_int = 7;
pub const F_SETOWN: c_int = 8;
pub const F_GETOWN: c_int = 9;
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 EDEADLK: c_int = 35;
pub const EDEADLOCK: 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 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 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 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 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 ERFKILL: c_int = 132;
pub const EHWPOISON: c_int = 133;
pub const MADV_SOFT_OFFLINE: c_int = 101;
pub const MAP_NORESERVE: c_int = 0x4000;
pub const MAP_ANONYMOUS: c_int = 0x0020;
pub const MAP_ANON: c_int = 0x0020;
pub const MAP_GROWSDOWN: c_int = 0x0100;
pub const MAP_DENYWRITE: c_int = 0x0800;
pub const MAP_EXECUTABLE: c_int = 0x1000;
pub const MAP_LOCKED: c_int = 0x2000;
pub const MAP_POPULATE: c_int = 0x8000;
pub const MAP_NONBLOCK: c_int = 0x10000;
pub const MAP_STACK: c_int = 0x20000;
pub const MAP_HUGETLB: c_int = 0x40000;
pub const MAP_SYNC: c_int = 0x080000;
pub const MCL_CURRENT: c_int = 0x0001;
pub const MCL_FUTURE: c_int = 0x0002;
pub const MCL_ONFAULT: c_int = 0x0004;
pub const SOCK_STREAM: c_int = 1;
pub const SOCK_DGRAM: c_int = 2;
pub const SFD_NONBLOCK: c_int = 0x800;
pub const SFD_CLOEXEC: c_int = 0x080000;
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 SA_ONSTACK: c_int = 0x08000000;
pub const SA_SIGINFO: c_int = 0x00000004;
pub const SA_NOCLDWAIT: c_int = 0x00000002;
pub const SIG_BLOCK: c_int = 0;
pub const SIG_UNBLOCK: c_int = 1;
pub const SIG_SETMASK: c_int = 2;
pub const SIGBUS: c_int = 7;
pub const SIGUSR1: c_int = 10;
pub const SIGUSR2: c_int = 12;
pub const SIGSTKFLT: c_int = 16;
pub const SIGCHLD: c_int = 17;
pub const SIGCONT: c_int = 18;
pub const SIGSTOP: c_int = 19;
pub const SIGTSTP: c_int = 20;
pub const SIGTTIN: c_int = 21;
pub const SIGTTOU: c_int = 22;
pub const SIGURG: c_int = 23;
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 SIGIO: c_int = 29;
pub const SIGPOLL: c_int = 29;
pub const SIGPWR: c_int = 30;
pub const SIGSYS: c_int = 31;
pub const SIGUNUSED: c_int = 31;
pub const POLLWRNORM: c_short = 0x100;
pub const POLLWRBAND: c_short = 0x200;
pub const PTRACE_GETFPREGS: c_uint = 14;
pub const PTRACE_SETFPREGS: c_uint = 15;
pub const PTRACE_DETACH: c_uint = 17;
pub const PTRACE_GETFPXREGS: c_uint = 18;
pub const PTRACE_SETFPXREGS: c_uint = 19;
pub const PTRACE_GETREGS: c_uint = 12;
pub const PTRACE_SETREGS: c_uint = 13;
pub const PTRACE_SYSEMU: c_uint = 31;
pub const PTRACE_SYSEMU_SINGLESTEP: c_uint = 32;
pub const RTLD_DEEPBIND: c_int = 0x8;
pub const RTLD_GLOBAL: c_int = 0x100;
pub const RTLD_NOLOAD: c_int = 0x4;
pub const VEOF: usize = 4;
pub const VTIME: usize = 5;
pub const VMIN: usize = 6;
pub const VSWTC: usize = 7;
pub const VSTART: usize = 8;
pub const VSTOP: usize = 9;
pub const VSUSP: usize = 10;
pub const VEOL: usize = 11;
pub const VREPRINT: usize = 12;
pub const VDISCARD: usize = 13;
pub const VWERASE: usize = 14;
pub const VEOL2: usize = 16;
pub const IEXTEN: crate::tcflag_t = 0x00008000;
pub const TOSTOP: crate::tcflag_t = 0x00000100;
pub const FLUSHO: crate::tcflag_t = 0x00001000;
pub const EXTPROC: crate::tcflag_t = 0x00010000;
pub const TCSANOW: c_int = 0;
pub const TCSADRAIN: c_int = 1;
pub const TCSAFLUSH: c_int = 2;
pub const SIGSTKSZ: size_t = 16384;
pub const MINSIGSTKSZ: size_t = 4096;
pub const CBAUD: crate::tcflag_t = 0o0010017;
pub const CSIZE: crate::tcflag_t = 0x00000030;
pub const CS6: crate::tcflag_t = 0x00000010;
pub const CS7: crate::tcflag_t = 0x00000020;
pub const CS8: crate::tcflag_t = 0x00000030;
pub const CSTOPB: crate::tcflag_t = 0x00000040;
pub const CREAD: crate::tcflag_t = 0x00000080;
pub const PARENB: crate::tcflag_t = 0x00000100;
pub const PARODD: crate::tcflag_t = 0x00000200;
pub const HUPCL: crate::tcflag_t = 0x00000400;
pub const CLOCAL: crate::tcflag_t = 0x00000800;
pub const CIBAUD: crate::tcflag_t = 0o02003600000;
pub const CBAUDEX: crate::tcflag_t = 0o010000;
pub const B0: crate::speed_t = 0o000000;
pub const B50: crate::speed_t = 0o000001;
pub const B75: crate::speed_t = 0o000002;
pub const B110: crate::speed_t = 0o000003;
pub const B134: crate::speed_t = 0o000004;
pub const B150: crate::speed_t = 0o000005;
pub const B200: crate::speed_t = 0o000006;
pub const B300: crate::speed_t = 0o000007;
pub const B600: crate::speed_t = 0o000010;
pub const B1200: crate::speed_t = 0o000011;
pub const B1800: crate::speed_t = 0o000012;
pub const B2400: crate::speed_t = 0o000013;
pub const B4800: crate::speed_t = 0o000014;
pub const B9600: crate::speed_t = 0o000015;
pub const B19200: crate::speed_t = 0o000016;
pub const B38400: crate::speed_t = 0o000017;
pub const EXTA: crate::speed_t = B19200;
pub const EXTB: crate::speed_t = B38400;
pub const B57600: crate::speed_t = 0o010001;
pub const B115200: crate::speed_t = 0o010002;
pub const B230400: crate::speed_t = 0o010003;
pub const B460800: crate::speed_t = 0o010004;
pub const B500000: crate::speed_t = 0o010005;
pub const B576000: crate::speed_t = 0o010006;
pub const B921600: crate::speed_t = 0o010007;
pub const B1000000: crate::speed_t = 0o010010;
pub const B1152000: crate::speed_t = 0o010011;
pub const B1500000: crate::speed_t = 0o010012;
pub const B2000000: crate::speed_t = 0o010013;
pub const B2500000: crate::speed_t = 0o010014;
pub const B3000000: crate::speed_t = 0o010015;
pub const B3500000: crate::speed_t = 0o010016;
pub const B4000000: crate::speed_t = 0o010017;
pub const TAB1: crate::tcflag_t = 0x00000800;
pub const TAB2: crate::tcflag_t = 0x00001000;
pub const TAB3: crate::tcflag_t = 0x00001800;
pub const CR1: crate::tcflag_t = 0x00000200;
pub const CR2: crate::tcflag_t = 0x00000400;
pub const CR3: crate::tcflag_t = 0x00000600;
pub const FF1: crate::tcflag_t = 0x00008000;
pub const BS1: crate::tcflag_t = 0x00002000;
pub const OLCUC: crate::tcflag_t = 0o000002;
pub const NLDLY: crate::tcflag_t = 0o000400;
pub const CRDLY: crate::tcflag_t = 0o003000;
pub const TABDLY: crate::tcflag_t = 0o014000;
pub const BSDLY: crate::tcflag_t = 0o020000;
pub const FFDLY: crate::tcflag_t = 0o100000;
pub const VTDLY: crate::tcflag_t = 0o040000;
pub const XTABS: crate::tcflag_t = 0o014000;
pub const VT1: crate::tcflag_t = 0x00004000;
pub const ONLCR: crate::tcflag_t = 0x4;
pub const IXON: crate::tcflag_t = 0x00000400;
pub const IXOFF: crate::tcflag_t = 0x00001000;
pub const ECHOKE: crate::tcflag_t = 0x00000800;
pub const ECHOE: crate::tcflag_t = 0x00000010;
pub const ECHOK: crate::tcflag_t = 0x00000020;
pub const ECHONL: crate::tcflag_t = 0x00000040;
pub const ECHOPRT: crate::tcflag_t = 0x00000400;
pub const ECHOCTL: crate::tcflag_t = 0x00000200;
pub const ISIG: crate::tcflag_t = 0x00000001;
pub const ICANON: crate::tcflag_t = 0x00000002;
pub const XCASE: crate::tcflag_t = 0x00000004;
pub const PENDIN: crate::tcflag_t = 0x00004000;
pub const NOFLSH: crate::tcflag_t = 0x00000080;
pub const NCCS: usize = 32;
pub const EPOLL_CLOEXEC: c_int = 0x80000;
pub const EFD_CLOEXEC: c_int = 0x80000;
pub const EFD_NONBLOCK: c_int = 0x800;
@@ -0,0 +1,929 @@
use crate::prelude::*;
use crate::{off64_t, off_t, pthread_mutex_t};
pub type blksize_t = i64;
pub type nlink_t = u64;
pub type suseconds_t = i64;
pub type wchar_t = i32;
pub type __u64 = c_ulong;
pub type __s64 = c_long;
s! {
pub struct stat {
pub st_dev: c_ulong,
st_pad1: [c_long; 2],
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: c_ulong,
st_pad2: [c_ulong; 1],
pub st_size: off_t,
st_pad3: c_long,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
pub st_blksize: crate::blksize_t,
st_pad4: c_long,
pub st_blocks: crate::blkcnt_t,
st_pad5: [c_long; 7],
}
pub struct statfs {
pub f_type: c_long,
pub f_bsize: c_long,
pub f_frsize: c_long,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_files: crate::fsblkcnt_t,
pub f_ffree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_long,
f_spare: [c_long; 6],
}
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: crate::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: crate::pid_t,
}
pub struct stat64 {
pub st_dev: c_ulong,
st_pad1: [c_long; 2],
pub st_ino: crate::ino64_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: c_ulong,
st_pad2: [c_long; 2],
pub st_size: off64_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
pub st_blksize: crate::blksize_t,
st_pad3: c_long,
pub st_blocks: crate::blkcnt64_t,
st_pad5: [c_long; 7],
}
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: crate::fsid_t,
pub f_namelen: c_long,
pub f_flags: c_long,
pub f_spare: [c_long; 5],
}
pub struct statvfs {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_favail: crate::fsfilcnt_t,
pub f_fsid: c_ulong,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
__f_spare: [c_int; 6],
}
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_attr_t {
__size: [c_ulong; 7],
}
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_flags: c_int,
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
pub sa_restorer: Option<extern "C" fn()>,
}
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,
_pad: c_int,
_pad2: [c_long; 14],
}
pub struct ipc_perm {
pub __key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::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: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__unused4: c_ulong,
__unused5: c_ulong,
}
}
s_no_extra_traits! {
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 4],
}
}
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
#[cfg(target_endian = "little")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
pub const SYS_read: c_long = 5000 + 0;
pub const SYS_write: c_long = 5000 + 1;
pub const SYS_open: c_long = 5000 + 2;
pub const SYS_close: c_long = 5000 + 3;
pub const SYS_stat: c_long = 5000 + 4;
pub const SYS_fstat: c_long = 5000 + 5;
pub const SYS_lstat: c_long = 5000 + 6;
pub const SYS_poll: c_long = 5000 + 7;
pub const SYS_lseek: c_long = 5000 + 8;
pub const SYS_mmap: c_long = 5000 + 9;
pub const SYS_mprotect: c_long = 5000 + 10;
pub const SYS_munmap: c_long = 5000 + 11;
pub const SYS_brk: c_long = 5000 + 12;
pub const SYS_rt_sigaction: c_long = 5000 + 13;
pub const SYS_rt_sigprocmask: c_long = 5000 + 14;
pub const SYS_ioctl: c_long = 5000 + 15;
pub const SYS_pread64: c_long = 5000 + 16;
pub const SYS_pwrite64: c_long = 5000 + 17;
pub const SYS_readv: c_long = 5000 + 18;
pub const SYS_writev: c_long = 5000 + 19;
pub const SYS_access: c_long = 5000 + 20;
pub const SYS_pipe: c_long = 5000 + 21;
pub const SYS__newselect: c_long = 5000 + 22;
pub const SYS_sched_yield: c_long = 5000 + 23;
pub const SYS_mremap: c_long = 5000 + 24;
pub const SYS_msync: c_long = 5000 + 25;
pub const SYS_mincore: c_long = 5000 + 26;
pub const SYS_madvise: c_long = 5000 + 27;
pub const SYS_shmget: c_long = 5000 + 28;
pub const SYS_shmat: c_long = 5000 + 29;
pub const SYS_shmctl: c_long = 5000 + 30;
pub const SYS_dup: c_long = 5000 + 31;
pub const SYS_dup2: c_long = 5000 + 32;
pub const SYS_pause: c_long = 5000 + 33;
pub const SYS_nanosleep: c_long = 5000 + 34;
pub const SYS_getitimer: c_long = 5000 + 35;
pub const SYS_setitimer: c_long = 5000 + 36;
pub const SYS_alarm: c_long = 5000 + 37;
pub const SYS_getpid: c_long = 5000 + 38;
pub const SYS_sendfile: c_long = 5000 + 39;
pub const SYS_socket: c_long = 5000 + 40;
pub const SYS_connect: c_long = 5000 + 41;
pub const SYS_accept: c_long = 5000 + 42;
pub const SYS_sendto: c_long = 5000 + 43;
pub const SYS_recvfrom: c_long = 5000 + 44;
pub const SYS_sendmsg: c_long = 5000 + 45;
pub const SYS_recvmsg: c_long = 5000 + 46;
pub const SYS_shutdown: c_long = 5000 + 47;
pub const SYS_bind: c_long = 5000 + 48;
pub const SYS_listen: c_long = 5000 + 49;
pub const SYS_getsockname: c_long = 5000 + 50;
pub const SYS_getpeername: c_long = 5000 + 51;
pub const SYS_socketpair: c_long = 5000 + 52;
pub const SYS_setsockopt: c_long = 5000 + 53;
pub const SYS_getsockopt: c_long = 5000 + 54;
pub const SYS_clone: c_long = 5000 + 55;
pub const SYS_fork: c_long = 5000 + 56;
pub const SYS_execve: c_long = 5000 + 57;
pub const SYS_exit: c_long = 5000 + 58;
pub const SYS_wait4: c_long = 5000 + 59;
pub const SYS_kill: c_long = 5000 + 60;
pub const SYS_uname: c_long = 5000 + 61;
pub const SYS_semget: c_long = 5000 + 62;
pub const SYS_semop: c_long = 5000 + 63;
pub const SYS_semctl: c_long = 5000 + 64;
pub const SYS_shmdt: c_long = 5000 + 65;
pub const SYS_msgget: c_long = 5000 + 66;
pub const SYS_msgsnd: c_long = 5000 + 67;
pub const SYS_msgrcv: c_long = 5000 + 68;
pub const SYS_msgctl: c_long = 5000 + 69;
pub const SYS_fcntl: c_long = 5000 + 70;
pub const SYS_flock: c_long = 5000 + 71;
pub const SYS_fsync: c_long = 5000 + 72;
pub const SYS_fdatasync: c_long = 5000 + 73;
pub const SYS_truncate: c_long = 5000 + 74;
pub const SYS_ftruncate: c_long = 5000 + 75;
pub const SYS_getdents: c_long = 5000 + 76;
pub const SYS_getcwd: c_long = 5000 + 77;
pub const SYS_chdir: c_long = 5000 + 78;
pub const SYS_fchdir: c_long = 5000 + 79;
pub const SYS_rename: c_long = 5000 + 80;
pub const SYS_mkdir: c_long = 5000 + 81;
pub const SYS_rmdir: c_long = 5000 + 82;
pub const SYS_creat: c_long = 5000 + 83;
pub const SYS_link: c_long = 5000 + 84;
pub const SYS_unlink: c_long = 5000 + 85;
pub const SYS_symlink: c_long = 5000 + 86;
pub const SYS_readlink: c_long = 5000 + 87;
pub const SYS_chmod: c_long = 5000 + 88;
pub const SYS_fchmod: c_long = 5000 + 89;
pub const SYS_chown: c_long = 5000 + 90;
pub const SYS_fchown: c_long = 5000 + 91;
pub const SYS_lchown: c_long = 5000 + 92;
pub const SYS_umask: c_long = 5000 + 93;
pub const SYS_gettimeofday: c_long = 5000 + 94;
pub const SYS_getrlimit: c_long = 5000 + 95;
pub const SYS_getrusage: c_long = 5000 + 96;
pub const SYS_sysinfo: c_long = 5000 + 97;
pub const SYS_times: c_long = 5000 + 98;
pub const SYS_ptrace: c_long = 5000 + 99;
pub const SYS_getuid: c_long = 5000 + 100;
pub const SYS_syslog: c_long = 5000 + 101;
pub const SYS_getgid: c_long = 5000 + 102;
pub const SYS_setuid: c_long = 5000 + 103;
pub const SYS_setgid: c_long = 5000 + 104;
pub const SYS_geteuid: c_long = 5000 + 105;
pub const SYS_getegid: c_long = 5000 + 106;
pub const SYS_setpgid: c_long = 5000 + 107;
pub const SYS_getppid: c_long = 5000 + 108;
pub const SYS_getpgrp: c_long = 5000 + 109;
pub const SYS_setsid: c_long = 5000 + 110;
pub const SYS_setreuid: c_long = 5000 + 111;
pub const SYS_setregid: c_long = 5000 + 112;
pub const SYS_getgroups: c_long = 5000 + 113;
pub const SYS_setgroups: c_long = 5000 + 114;
pub const SYS_setresuid: c_long = 5000 + 115;
pub const SYS_getresuid: c_long = 5000 + 116;
pub const SYS_setresgid: c_long = 5000 + 117;
pub const SYS_getresgid: c_long = 5000 + 118;
pub const SYS_getpgid: c_long = 5000 + 119;
pub const SYS_setfsuid: c_long = 5000 + 120;
pub const SYS_setfsgid: c_long = 5000 + 121;
pub const SYS_getsid: c_long = 5000 + 122;
pub const SYS_capget: c_long = 5000 + 123;
pub const SYS_capset: c_long = 5000 + 124;
pub const SYS_rt_sigpending: c_long = 5000 + 125;
pub const SYS_rt_sigtimedwait: c_long = 5000 + 126;
pub const SYS_rt_sigqueueinfo: c_long = 5000 + 127;
pub const SYS_rt_sigsuspend: c_long = 5000 + 128;
pub const SYS_sigaltstack: c_long = 5000 + 129;
pub const SYS_utime: c_long = 5000 + 130;
pub const SYS_mknod: c_long = 5000 + 131;
pub const SYS_personality: c_long = 5000 + 132;
pub const SYS_ustat: c_long = 5000 + 133;
pub const SYS_statfs: c_long = 5000 + 134;
pub const SYS_fstatfs: c_long = 5000 + 135;
pub const SYS_sysfs: c_long = 5000 + 136;
pub const SYS_getpriority: c_long = 5000 + 137;
pub const SYS_setpriority: c_long = 5000 + 138;
pub const SYS_sched_setparam: c_long = 5000 + 139;
pub const SYS_sched_getparam: c_long = 5000 + 140;
pub const SYS_sched_setscheduler: c_long = 5000 + 141;
pub const SYS_sched_getscheduler: c_long = 5000 + 142;
pub const SYS_sched_get_priority_max: c_long = 5000 + 143;
pub const SYS_sched_get_priority_min: c_long = 5000 + 144;
pub const SYS_sched_rr_get_interval: c_long = 5000 + 145;
pub const SYS_mlock: c_long = 5000 + 146;
pub const SYS_munlock: c_long = 5000 + 147;
pub const SYS_mlockall: c_long = 5000 + 148;
pub const SYS_munlockall: c_long = 5000 + 149;
pub const SYS_vhangup: c_long = 5000 + 150;
pub const SYS_pivot_root: c_long = 5000 + 151;
pub const SYS__sysctl: c_long = 5000 + 152;
pub const SYS_prctl: c_long = 5000 + 153;
pub const SYS_adjtimex: c_long = 5000 + 154;
pub const SYS_setrlimit: c_long = 5000 + 155;
pub const SYS_chroot: c_long = 5000 + 156;
pub const SYS_sync: c_long = 5000 + 157;
pub const SYS_acct: c_long = 5000 + 158;
pub const SYS_settimeofday: c_long = 5000 + 159;
pub const SYS_mount: c_long = 5000 + 160;
pub const SYS_umount2: c_long = 5000 + 161;
pub const SYS_swapon: c_long = 5000 + 162;
pub const SYS_swapoff: c_long = 5000 + 163;
pub const SYS_reboot: c_long = 5000 + 164;
pub const SYS_sethostname: c_long = 5000 + 165;
pub const SYS_setdomainname: c_long = 5000 + 166;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 5000 + 167;
pub const SYS_init_module: c_long = 5000 + 168;
pub const SYS_delete_module: c_long = 5000 + 169;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_get_kernel_syms: c_long = 5000 + 170;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_query_module: c_long = 5000 + 171;
pub const SYS_quotactl: c_long = 5000 + 172;
pub const SYS_nfsservctl: c_long = 5000 + 173;
pub const SYS_getpmsg: c_long = 5000 + 174;
pub const SYS_putpmsg: c_long = 5000 + 175;
pub const SYS_afs_syscall: c_long = 5000 + 176;
pub const SYS_gettid: c_long = 5000 + 178;
pub const SYS_readahead: c_long = 5000 + 179;
pub const SYS_setxattr: c_long = 5000 + 180;
pub const SYS_lsetxattr: c_long = 5000 + 181;
pub const SYS_fsetxattr: c_long = 5000 + 182;
pub const SYS_getxattr: c_long = 5000 + 183;
pub const SYS_lgetxattr: c_long = 5000 + 184;
pub const SYS_fgetxattr: c_long = 5000 + 185;
pub const SYS_listxattr: c_long = 5000 + 186;
pub const SYS_llistxattr: c_long = 5000 + 187;
pub const SYS_flistxattr: c_long = 5000 + 188;
pub const SYS_removexattr: c_long = 5000 + 189;
pub const SYS_lremovexattr: c_long = 5000 + 190;
pub const SYS_fremovexattr: c_long = 5000 + 191;
pub const SYS_tkill: c_long = 5000 + 192;
pub const SYS_futex: c_long = 5000 + 194;
pub const SYS_sched_setaffinity: c_long = 5000 + 195;
pub const SYS_sched_getaffinity: c_long = 5000 + 196;
pub const SYS_cacheflush: c_long = 5000 + 197;
pub const SYS_cachectl: c_long = 5000 + 198;
pub const SYS_sysmips: c_long = 5000 + 199;
pub const SYS_io_setup: c_long = 5000 + 200;
pub const SYS_io_destroy: c_long = 5000 + 201;
pub const SYS_io_getevents: c_long = 5000 + 202;
pub const SYS_io_submit: c_long = 5000 + 203;
pub const SYS_io_cancel: c_long = 5000 + 204;
pub const SYS_exit_group: c_long = 5000 + 205;
pub const SYS_lookup_dcookie: c_long = 5000 + 206;
pub const SYS_epoll_create: c_long = 5000 + 207;
pub const SYS_epoll_ctl: c_long = 5000 + 208;
pub const SYS_epoll_wait: c_long = 5000 + 209;
pub const SYS_remap_file_pages: c_long = 5000 + 210;
pub const SYS_rt_sigreturn: c_long = 5000 + 211;
pub const SYS_set_tid_address: c_long = 5000 + 212;
pub const SYS_restart_syscall: c_long = 5000 + 213;
pub const SYS_semtimedop: c_long = 5000 + 214;
pub const SYS_fadvise64: c_long = 5000 + 215;
pub const SYS_timer_create: c_long = 5000 + 216;
pub const SYS_timer_settime: c_long = 5000 + 217;
pub const SYS_timer_gettime: c_long = 5000 + 218;
pub const SYS_timer_getoverrun: c_long = 5000 + 219;
pub const SYS_timer_delete: c_long = 5000 + 220;
pub const SYS_clock_settime: c_long = 5000 + 221;
pub const SYS_clock_gettime: c_long = 5000 + 222;
pub const SYS_clock_getres: c_long = 5000 + 223;
pub const SYS_clock_nanosleep: c_long = 5000 + 224;
pub const SYS_tgkill: c_long = 5000 + 225;
pub const SYS_utimes: c_long = 5000 + 226;
pub const SYS_mbind: c_long = 5000 + 227;
pub const SYS_get_mempolicy: c_long = 5000 + 228;
pub const SYS_set_mempolicy: c_long = 5000 + 229;
pub const SYS_mq_open: c_long = 5000 + 230;
pub const SYS_mq_unlink: c_long = 5000 + 231;
pub const SYS_mq_timedsend: c_long = 5000 + 232;
pub const SYS_mq_timedreceive: c_long = 5000 + 233;
pub const SYS_mq_notify: c_long = 5000 + 234;
pub const SYS_mq_getsetattr: c_long = 5000 + 235;
pub const SYS_vserver: c_long = 5000 + 236;
pub const SYS_waitid: c_long = 5000 + 237;
/* pub const SYS_sys_setaltroot: c_long = 5000 + 238; */
pub const SYS_add_key: c_long = 5000 + 239;
pub const SYS_request_key: c_long = 5000 + 240;
pub const SYS_keyctl: c_long = 5000 + 241;
pub const SYS_set_thread_area: c_long = 5000 + 242;
pub const SYS_inotify_init: c_long = 5000 + 243;
pub const SYS_inotify_add_watch: c_long = 5000 + 244;
pub const SYS_inotify_rm_watch: c_long = 5000 + 245;
pub const SYS_migrate_pages: c_long = 5000 + 246;
pub const SYS_openat: c_long = 5000 + 247;
pub const SYS_mkdirat: c_long = 5000 + 248;
pub const SYS_mknodat: c_long = 5000 + 249;
pub const SYS_fchownat: c_long = 5000 + 250;
pub const SYS_futimesat: c_long = 5000 + 251;
pub const SYS_newfstatat: c_long = 5000 + 252;
pub const SYS_unlinkat: c_long = 5000 + 253;
pub const SYS_renameat: c_long = 5000 + 254;
pub const SYS_linkat: c_long = 5000 + 255;
pub const SYS_symlinkat: c_long = 5000 + 256;
pub const SYS_readlinkat: c_long = 5000 + 257;
pub const SYS_fchmodat: c_long = 5000 + 258;
pub const SYS_faccessat: c_long = 5000 + 259;
pub const SYS_pselect6: c_long = 5000 + 260;
pub const SYS_ppoll: c_long = 5000 + 261;
pub const SYS_unshare: c_long = 5000 + 262;
pub const SYS_splice: c_long = 5000 + 263;
pub const SYS_sync_file_range: c_long = 5000 + 264;
pub const SYS_tee: c_long = 5000 + 265;
pub const SYS_vmsplice: c_long = 5000 + 266;
pub const SYS_move_pages: c_long = 5000 + 267;
pub const SYS_set_robust_list: c_long = 5000 + 268;
pub const SYS_get_robust_list: c_long = 5000 + 269;
pub const SYS_kexec_load: c_long = 5000 + 270;
pub const SYS_getcpu: c_long = 5000 + 271;
pub const SYS_epoll_pwait: c_long = 5000 + 272;
pub const SYS_ioprio_set: c_long = 5000 + 273;
pub const SYS_ioprio_get: c_long = 5000 + 274;
pub const SYS_utimensat: c_long = 5000 + 275;
pub const SYS_signalfd: c_long = 5000 + 276;
pub const SYS_timerfd: c_long = 5000 + 277;
pub const SYS_eventfd: c_long = 5000 + 278;
pub const SYS_fallocate: c_long = 5000 + 279;
pub const SYS_timerfd_create: c_long = 5000 + 280;
pub const SYS_timerfd_gettime: c_long = 5000 + 281;
pub const SYS_timerfd_settime: c_long = 5000 + 282;
pub const SYS_signalfd4: c_long = 5000 + 283;
pub const SYS_eventfd2: c_long = 5000 + 284;
pub const SYS_epoll_create1: c_long = 5000 + 285;
pub const SYS_dup3: c_long = 5000 + 286;
pub const SYS_pipe2: c_long = 5000 + 287;
pub const SYS_inotify_init1: c_long = 5000 + 288;
pub const SYS_preadv: c_long = 5000 + 289;
pub const SYS_pwritev: c_long = 5000 + 290;
pub const SYS_rt_tgsigqueueinfo: c_long = 5000 + 291;
pub const SYS_perf_event_open: c_long = 5000 + 292;
pub const SYS_accept4: c_long = 5000 + 293;
pub const SYS_recvmmsg: c_long = 5000 + 294;
pub const SYS_fanotify_init: c_long = 5000 + 295;
pub const SYS_fanotify_mark: c_long = 5000 + 296;
pub const SYS_prlimit64: c_long = 5000 + 297;
pub const SYS_name_to_handle_at: c_long = 5000 + 298;
pub const SYS_open_by_handle_at: c_long = 5000 + 299;
pub const SYS_clock_adjtime: c_long = 5000 + 300;
pub const SYS_syncfs: c_long = 5000 + 301;
pub const SYS_sendmmsg: c_long = 5000 + 302;
pub const SYS_setns: c_long = 5000 + 303;
pub const SYS_process_vm_readv: c_long = 5000 + 304;
pub const SYS_process_vm_writev: c_long = 5000 + 305;
pub const SYS_kcmp: c_long = 5000 + 306;
pub const SYS_finit_module: c_long = 5000 + 307;
pub const SYS_getdents64: c_long = 5000 + 308;
pub const SYS_sched_setattr: c_long = 5000 + 309;
pub const SYS_sched_getattr: c_long = 5000 + 310;
pub const SYS_renameat2: c_long = 5000 + 311;
pub const SYS_seccomp: c_long = 5000 + 312;
pub const SYS_getrandom: c_long = 5000 + 313;
pub const SYS_memfd_create: c_long = 5000 + 314;
pub const SYS_bpf: c_long = 5000 + 315;
pub const SYS_execveat: c_long = 5000 + 316;
pub const SYS_userfaultfd: c_long = 5000 + 317;
pub const SYS_membarrier: c_long = 5000 + 318;
pub const SYS_mlock2: c_long = 5000 + 319;
pub const SYS_copy_file_range: c_long = 5000 + 320;
pub const SYS_preadv2: c_long = 5000 + 321;
pub const SYS_pwritev2: c_long = 5000 + 322;
pub const SYS_pkey_mprotect: c_long = 5000 + 323;
pub const SYS_pkey_alloc: c_long = 5000 + 324;
pub const SYS_pkey_free: c_long = 5000 + 325;
pub const SYS_statx: c_long = 5000 + 326;
pub const SYS_rseq: c_long = 5000 + 327;
pub const SYS_pidfd_send_signal: c_long = 5000 + 424;
pub const SYS_io_uring_setup: c_long = 5000 + 425;
pub const SYS_io_uring_enter: c_long = 5000 + 426;
pub const SYS_io_uring_register: c_long = 5000 + 427;
pub const SYS_open_tree: c_long = 5000 + 428;
pub const SYS_move_mount: c_long = 5000 + 429;
pub const SYS_fsopen: c_long = 5000 + 430;
pub const SYS_fsconfig: c_long = 5000 + 431;
pub const SYS_fsmount: c_long = 5000 + 432;
pub const SYS_fspick: c_long = 5000 + 433;
pub const SYS_pidfd_open: c_long = 5000 + 434;
pub const SYS_clone3: c_long = 5000 + 435;
pub const SYS_close_range: c_long = 5000 + 436;
pub const SYS_openat2: c_long = 5000 + 437;
pub const SYS_pidfd_getfd: c_long = 5000 + 438;
pub const SYS_faccessat2: c_long = 5000 + 439;
pub const SYS_process_madvise: c_long = 5000 + 440;
pub const SYS_epoll_pwait2: c_long = 5000 + 441;
pub const SYS_mount_setattr: c_long = 5000 + 442;
pub const SYS_quotactl_fd: c_long = 5000 + 443;
pub const SYS_landlock_create_ruleset: c_long = 5000 + 444;
pub const SYS_landlock_add_rule: c_long = 5000 + 445;
pub const SYS_landlock_restrict_self: c_long = 5000 + 446;
pub const SYS_memfd_secret: c_long = 5000 + 447;
pub const SYS_process_mrelease: c_long = 5000 + 448;
pub const SYS_futex_waitv: c_long = 5000 + 449;
pub const SYS_set_mempolicy_home_node: c_long = 5000 + 450;
pub const SFD_CLOEXEC: c_int = 0x080000;
pub const NCCS: usize = 32;
pub const O_TRUNC: c_int = 512;
pub const O_NOATIME: c_int = 0o1000000;
pub const O_CLOEXEC: c_int = 0x80000;
pub const O_PATH: c_int = 0o10000000;
pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY;
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 POSIX_FADV_DONTNEED: c_int = 4;
pub const POSIX_FADV_NOREUSE: c_int = 5;
pub const EPOLL_CLOEXEC: c_int = 0x80000;
pub const EFD_CLOEXEC: c_int = 0x80000;
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 MAP_HUGETLB: c_int = 0x080000;
pub const SOCK_STREAM: c_int = 2;
pub const SOCK_DGRAM: c_int = 1;
pub const SA_ONSTACK: c_int = 0x08000000;
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: crate::tcflag_t = 0x00000100;
pub const TOSTOP: crate::tcflag_t = 0x00008000;
pub const FLUSHO: crate::tcflag_t = 0x00002000;
pub const EXTPROC: crate::tcflag_t = 0o200000;
pub const TCSANOW: c_int = 0x540e;
pub const TCSADRAIN: c_int = 0x540f;
pub const TCSAFLUSH: c_int = 0x5410;
pub const PTRACE_GETFPREGS: c_uint = 14;
pub const PTRACE_SETFPREGS: c_uint = 15;
pub const PTRACE_DETACH: c_uint = 17;
pub const PTRACE_GETFPXREGS: c_uint = 18;
pub const PTRACE_SETFPXREGS: c_uint = 19;
pub const PTRACE_GETREGS: c_uint = 12;
pub const PTRACE_SETREGS: c_uint = 13;
pub const EFD_NONBLOCK: c_int = 0x80;
pub const F_RDLCK: c_int = 0;
pub const F_WRLCK: c_int = 1;
pub const F_UNLCK: c_int = 2;
pub const F_GETLK: c_int = 14;
pub const F_GETOWN: c_int = 23;
pub const F_SETOWN: c_int = 24;
pub const F_SETLK: c_int = 6;
pub const F_SETLKW: c_int = 7;
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 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: crate::tcflag_t = 0o0010017;
pub const TAB1: crate::tcflag_t = 0x00000800;
pub const TAB2: crate::tcflag_t = 0x00001000;
pub const TAB3: crate::tcflag_t = 0x00001800;
pub const CR1: crate::tcflag_t = 0x00000200;
pub const CR2: crate::tcflag_t = 0x00000400;
pub const CR3: crate::tcflag_t = 0x00000600;
pub const FF1: crate::tcflag_t = 0x00008000;
pub const BS1: crate::tcflag_t = 0x00002000;
pub const VT1: crate::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: crate::tcflag_t = 0x00000400;
pub const IXOFF: crate::tcflag_t = 0x00001000;
pub const ONLCR: crate::tcflag_t = 0x4;
pub const CSIZE: crate::tcflag_t = 0x00000030;
pub const CS6: crate::tcflag_t = 0x00000010;
pub const CS7: crate::tcflag_t = 0x00000020;
pub const CS8: crate::tcflag_t = 0x00000030;
pub const CSTOPB: crate::tcflag_t = 0x00000040;
pub const CREAD: crate::tcflag_t = 0x00000080;
pub const PARENB: crate::tcflag_t = 0x00000100;
pub const PARODD: crate::tcflag_t = 0x00000200;
pub const HUPCL: crate::tcflag_t = 0x00000400;
pub const CLOCAL: crate::tcflag_t = 0x00000800;
pub const ECHOKE: crate::tcflag_t = 0x00000800;
pub const ECHOE: crate::tcflag_t = 0x00000010;
pub const ECHOK: crate::tcflag_t = 0x00000020;
pub const ECHONL: crate::tcflag_t = 0x00000040;
pub const ECHOPRT: crate::tcflag_t = 0x00000400;
pub const ECHOCTL: crate::tcflag_t = 0x00000200;
pub const ISIG: crate::tcflag_t = 0x00000001;
pub const ICANON: crate::tcflag_t = 0x00000002;
pub const PENDIN: crate::tcflag_t = 0x00004000;
pub const NOFLSH: crate::tcflag_t = 0x00000080;
pub const CIBAUD: crate::tcflag_t = 0o02003600000;
pub const CBAUDEX: crate::tcflag_t = 0o010000;
pub const VSWTC: usize = 7;
pub const OLCUC: crate::tcflag_t = 0o000002;
pub const NLDLY: crate::tcflag_t = 0o000400;
pub const CRDLY: crate::tcflag_t = 0o003000;
pub const TABDLY: crate::tcflag_t = 0o014000;
pub const BSDLY: crate::tcflag_t = 0o020000;
pub const FFDLY: crate::tcflag_t = 0o100000;
pub const VTDLY: crate::tcflag_t = 0o040000;
pub const XTABS: crate::tcflag_t = 0o014000;
pub const B0: crate::speed_t = 0o000000;
pub const B50: crate::speed_t = 0o000001;
pub const B75: crate::speed_t = 0o000002;
pub const B110: crate::speed_t = 0o000003;
pub const B134: crate::speed_t = 0o000004;
pub const B150: crate::speed_t = 0o000005;
pub const B200: crate::speed_t = 0o000006;
pub const B300: crate::speed_t = 0o000007;
pub const B600: crate::speed_t = 0o000010;
pub const B1200: crate::speed_t = 0o000011;
pub const B1800: crate::speed_t = 0o000012;
pub const B2400: crate::speed_t = 0o000013;
pub const B4800: crate::speed_t = 0o000014;
pub const B9600: crate::speed_t = 0o000015;
pub const B19200: crate::speed_t = 0o000016;
pub const B38400: crate::speed_t = 0o000017;
pub const EXTA: crate::speed_t = B19200;
pub const EXTB: crate::speed_t = B38400;
pub const B57600: crate::speed_t = 0o010001;
pub const B115200: crate::speed_t = 0o010002;
pub const B230400: crate::speed_t = 0o010003;
pub const B460800: crate::speed_t = 0o010004;
pub const B500000: crate::speed_t = 0o010005;
pub const B576000: crate::speed_t = 0o010006;
pub const B921600: crate::speed_t = 0o010007;
pub const B1000000: crate::speed_t = 0o010010;
pub const B1152000: crate::speed_t = 0o010011;
pub const B1500000: crate::speed_t = 0o010012;
pub const B2000000: crate::speed_t = 0o010013;
pub const B2500000: crate::speed_t = 0o010014;
pub const B3000000: crate::speed_t = 0o010015;
pub const B3500000: crate::speed_t = 0o010016;
pub const B4000000: crate::speed_t = 0o010017;
pub const EHWPOISON: c_int = 168;
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;
}
+213
View File
@@ -0,0 +1,213 @@
//! 64-bit specific definitions for linux-like values
use crate::prelude::*;
pub type ino_t = u64;
pub type off_t = i64;
pub type blkcnt_t = i64;
pub type shmatt_t = u64;
pub type msgqnum_t = u64;
pub type msglen_t = u64;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type rlim_t = u64;
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub type __syscall_ulong_t = c_ulonglong;
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub type __syscall_ulong_t = c_ulong;
cfg_if! {
if #[cfg(all(target_arch = "aarch64", target_pointer_width = "32"))] {
pub type clock_t = i32;
pub type time_t = i32;
pub type __fsword_t = i32;
} else {
pub type __fsword_t = i64;
pub type clock_t = i64;
pub type time_t = i64;
}
}
s! {
pub struct sigset_t {
#[cfg(target_pointer_width = "32")]
__val: [u32; 32],
#[cfg(target_pointer_width = "64")]
__val: [u64; 16],
}
pub struct sysinfo {
pub uptime: i64,
pub loads: [u64; 3],
pub totalram: u64,
pub freeram: u64,
pub sharedram: u64,
pub bufferram: u64,
pub totalswap: u64,
pub freeswap: u64,
pub procs: c_ushort,
pub pad: c_ushort,
pub totalhigh: u64,
pub freehigh: u64,
pub mem_unit: c_uint,
pub _f: [c_char; 0],
}
pub struct msqid_ds {
pub msg_perm: crate::ipc_perm,
pub msg_stime: crate::time_t,
pub msg_rtime: crate::time_t,
pub msg_ctime: crate::time_t,
pub __msg_cbytes: u64,
pub msg_qnum: crate::msgqnum_t,
pub msg_qbytes: crate::msglen_t,
pub msg_lspid: crate::pid_t,
pub msg_lrpid: crate::pid_t,
__glibc_reserved4: u64,
__glibc_reserved5: u64,
}
pub struct semid_ds {
pub sem_perm: ipc_perm,
pub sem_otime: crate::time_t,
#[cfg(not(any(
target_arch = "aarch64",
target_arch = "loongarch64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "powerpc64",
target_arch = "riscv64",
target_arch = "sparc64",
target_arch = "s390x",
)))]
__reserved: crate::__syscall_ulong_t,
pub sem_ctime: crate::time_t,
#[cfg(not(any(
target_arch = "aarch64",
target_arch = "loongarch64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "powerpc64",
target_arch = "riscv64",
target_arch = "sparc64",
target_arch = "s390x",
)))]
__reserved2: crate::__syscall_ulong_t,
pub sem_nsems: crate::__syscall_ulong_t,
__glibc_reserved3: crate::__syscall_ulong_t,
__glibc_reserved4: crate::__syscall_ulong_t,
}
pub struct timex {
pub modes: c_uint,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub offset: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub offset: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub freq: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub freq: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub maxerror: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub maxerror: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub esterror: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub esterror: c_long,
pub status: c_int,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub constant: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub constant: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub precision: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub precision: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub tolerance: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub tolerance: c_long,
pub time: crate::timeval,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub tick: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub tick: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub ppsfreq: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub ppsfreq: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub jitter: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub jitter: c_long,
pub shift: c_int,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub stabil: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub stabil: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub jitcnt: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub jitcnt: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub calcnt: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub calcnt: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub errcnt: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub errcnt: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub stbcnt: i64,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub stbcnt: c_long,
pub tai: c_int,
pub __unused1: i32,
pub __unused2: i32,
pub __unused3: i32,
pub __unused4: i32,
pub __unused5: i32,
pub __unused6: i32,
pub __unused7: i32,
pub __unused8: i32,
pub __unused9: i32,
pub __unused10: i32,
pub __unused11: i32,
}
}
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
pub const O_LARGEFILE: c_int = 0;
cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else if #[cfg(any(target_arch = "powerpc64"))] {
mod powerpc64;
pub use self::powerpc64::*;
} else if #[cfg(any(target_arch = "sparc64"))] {
mod sparc64;
pub use self::sparc64::*;
} else if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))] {
mod mips64;
pub use self::mips64::*;
} else if #[cfg(any(target_arch = "s390x"))] {
mod s390x;
pub use self::s390x::*;
} else if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
} else if #[cfg(any(target_arch = "riscv64"))] {
mod riscv64;
pub use self::riscv64::*;
} else if #[cfg(any(target_arch = "loongarch64"))] {
mod loongarch64;
pub use self::loongarch64::*;
} else {
// Unknown target_arch
}
}
@@ -0,0 +1,974 @@
//! PowerPC64-specific definitions for 64-bit linux-like values
use crate::prelude::*;
use crate::{off64_t, off_t, pthread_mutex_t};
pub type wchar_t = i32;
pub type nlink_t = u64;
pub type blksize_t = i64;
pub type suseconds_t = i64;
pub type __u64 = c_ulong;
pub type __s64 = c_long;
s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
#[cfg(target_arch = "sparc64")]
__reserved0: c_int,
pub sa_flags: c_int,
pub sa_restorer: Option<extern "C" fn()>,
}
pub struct statfs {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__fsword_t,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
f_spare: [crate::__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: crate::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: crate::pid_t,
}
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_nlink: crate::nlink_t,
pub st_mode: crate::mode_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
__pad0: c_int,
pub st_rdev: crate::dev_t,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__unused: [c_long; 3],
}
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino64_t,
pub st_nlink: crate::nlink_t,
pub st_mode: crate::mode_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
__pad0: c_int,
pub st_rdev: crate::dev_t,
pub st_size: off64_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt64_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__reserved: [c_long; 3],
}
pub struct statfs64 {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__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: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
pub f_spare: [crate::__fsword_t; 4],
}
pub struct statvfs {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_favail: crate::fsfilcnt_t,
pub f_fsid: c_ulong,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
__f_spare: [c_int; 6],
}
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_attr_t {
__size: [u64; 7],
}
pub struct ipc_perm {
pub __key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::gid_t,
pub mode: crate::mode_t,
pub __seq: u32,
__pad1: u32,
__unused1: u64,
__unused2: c_ulong,
}
pub struct shmid_ds {
pub shm_perm: crate::ipc_perm,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
pub shm_segsz: size_t,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__unused4: c_ulong,
__unused5: 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,
}
}
s_no_extra_traits! {
#[repr(align(16))]
pub struct max_align_t {
priv_: [i64; 4],
}
}
pub const POSIX_FADV_DONTNEED: c_int = 4;
pub const POSIX_FADV_NOREUSE: c_int = 5;
pub const RTLD_DEEPBIND: c_int = 0x8;
pub const RTLD_GLOBAL: c_int = 0x100;
pub const RTLD_NOLOAD: c_int = 0x4;
pub const VEOF: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
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_NOATIME: c_int = 0o1000000;
pub const O_PATH: c_int = 0o10000000;
pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY;
pub const MADV_SOFT_OFFLINE: c_int = 101;
pub const MAP_GROWSDOWN: c_int = 0x0100;
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 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 SOCK_STREAM: c_int = 1;
pub const SOCK_DGRAM: c_int = 2;
pub const SA_ONSTACK: c_int = 0x08000000;
pub const SA_SIGINFO: c_int = 0x00000004;
pub const SA_NOCLDWAIT: c_int = 0x00000002;
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 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 POLLWRNORM: c_short = 0x100;
pub const POLLWRBAND: c_short = 0x200;
pub const O_ASYNC: c_int = 0x2000;
pub const O_NDELAY: c_int = 0x800;
pub const PTRACE_DETACH: c_uint = 17;
pub const EFD_NONBLOCK: c_int = 0x800;
pub const F_GETLK: c_int = 5;
pub const F_GETOWN: c_int = 9;
pub const F_SETOWN: c_int = 8;
pub const F_SETLK: c_int = 6;
pub const F_SETLKW: c_int = 7;
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 F_RDLCK: c_int = 0;
pub const F_WRLCK: c_int = 1;
pub const F_UNLCK: c_int = 2;
pub const SFD_NONBLOCK: c_int = 0x0800;
pub const TCSANOW: c_int = 0;
pub const TCSADRAIN: c_int = 1;
pub const TCSAFLUSH: 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;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
#[cfg(target_endian = "little")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
pub const O_DIRECTORY: c_int = 0x4000;
pub const O_NOFOLLOW: c_int = 0x8000;
pub const O_DIRECT: c_int = 0x20000;
pub const MAP_LOCKED: c_int = 0x00080;
pub const MAP_NORESERVE: c_int = 0x00040;
pub const MAP_SYNC: c_int = 0x080000;
pub const EDEADLOCK: c_int = 58;
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 MCL_CURRENT: c_int = 0x2000;
pub const MCL_FUTURE: c_int = 0x4000;
pub const MCL_ONFAULT: c_int = 0x8000;
pub const SIGSTKSZ: size_t = 0x4000;
pub const MINSIGSTKSZ: size_t = 4096;
pub const CBAUD: crate::tcflag_t = 0xff;
pub const TAB1: crate::tcflag_t = 0x400;
pub const TAB2: crate::tcflag_t = 0x800;
pub const TAB3: crate::tcflag_t = 0xc00;
pub const CR1: crate::tcflag_t = 0x1000;
pub const CR2: crate::tcflag_t = 0x2000;
pub const CR3: crate::tcflag_t = 0x3000;
pub const FF1: crate::tcflag_t = 0x4000;
pub const BS1: crate::tcflag_t = 0x8000;
pub const VT1: crate::tcflag_t = 0x10000;
pub const VWERASE: usize = 0xa;
pub const VREPRINT: usize = 0xb;
pub const VSUSP: usize = 0xc;
pub const VSTART: usize = 0xd;
pub const VSTOP: usize = 0xe;
pub const VDISCARD: usize = 0x10;
pub const VTIME: usize = 0x7;
pub const IXON: crate::tcflag_t = 0x200;
pub const IXOFF: crate::tcflag_t = 0x400;
pub const ONLCR: crate::tcflag_t = 0x2;
pub const CSIZE: crate::tcflag_t = 0x300;
pub const CS6: crate::tcflag_t = 0x100;
pub const CS7: crate::tcflag_t = 0x200;
pub const CS8: crate::tcflag_t = 0x300;
pub const CSTOPB: crate::tcflag_t = 0x400;
pub const CREAD: crate::tcflag_t = 0x800;
pub const PARENB: crate::tcflag_t = 0x1000;
pub const PARODD: crate::tcflag_t = 0x2000;
pub const HUPCL: crate::tcflag_t = 0x4000;
pub const CLOCAL: crate::tcflag_t = 0x8000;
pub const ECHOKE: crate::tcflag_t = 0x1;
pub const ECHOE: crate::tcflag_t = 0x2;
pub const ECHOK: crate::tcflag_t = 0x4;
pub const ECHONL: crate::tcflag_t = 0x10;
pub const ECHOPRT: crate::tcflag_t = 0x20;
pub const ECHOCTL: crate::tcflag_t = 0x40;
pub const ISIG: crate::tcflag_t = 0x80;
pub const ICANON: crate::tcflag_t = 0x100;
pub const PENDIN: crate::tcflag_t = 0x20000000;
pub const NOFLSH: crate::tcflag_t = 0x80000000;
pub const VSWTC: usize = 9;
pub const OLCUC: crate::tcflag_t = 0o000004;
pub const NLDLY: crate::tcflag_t = 0o001400;
pub const CRDLY: crate::tcflag_t = 0o030000;
pub const TABDLY: crate::tcflag_t = 0o006000;
pub const BSDLY: crate::tcflag_t = 0o100000;
pub const FFDLY: crate::tcflag_t = 0o040000;
pub const VTDLY: crate::tcflag_t = 0o200000;
pub const XTABS: crate::tcflag_t = 0o006000;
pub const B0: crate::speed_t = 0o000000;
pub const B50: crate::speed_t = 0o000001;
pub const B75: crate::speed_t = 0o000002;
pub const B110: crate::speed_t = 0o000003;
pub const B134: crate::speed_t = 0o000004;
pub const B150: crate::speed_t = 0o000005;
pub const B200: crate::speed_t = 0o000006;
pub const B300: crate::speed_t = 0o000007;
pub const B600: crate::speed_t = 0o000010;
pub const B1200: crate::speed_t = 0o000011;
pub const B1800: crate::speed_t = 0o000012;
pub const B2400: crate::speed_t = 0o000013;
pub const B4800: crate::speed_t = 0o000014;
pub const B9600: crate::speed_t = 0o000015;
pub const B19200: crate::speed_t = 0o000016;
pub const B38400: crate::speed_t = 0o000017;
pub const EXTA: crate::speed_t = B19200;
pub const EXTB: crate::speed_t = B38400;
pub const CBAUDEX: crate::speed_t = 0o000020;
pub const B57600: crate::speed_t = 0o0020;
pub const B115200: crate::speed_t = 0o0021;
pub const B230400: crate::speed_t = 0o0022;
pub const B460800: crate::speed_t = 0o0023;
pub const B500000: crate::speed_t = 0o0024;
pub const B576000: crate::speed_t = 0o0025;
pub const B921600: crate::speed_t = 0o0026;
pub const B1000000: crate::speed_t = 0o0027;
pub const B1152000: crate::speed_t = 0o0030;
pub const B1500000: crate::speed_t = 0o0031;
pub const B2000000: crate::speed_t = 0o0032;
pub const B2500000: crate::speed_t = 0o0033;
pub const B3000000: crate::speed_t = 0o0034;
pub const B3500000: crate::speed_t = 0o0035;
pub const B4000000: crate::speed_t = 0o0036;
pub const VEOL: usize = 6;
pub const VEOL2: usize = 8;
pub const VMIN: usize = 5;
pub const IEXTEN: crate::tcflag_t = 0x400;
pub const TOSTOP: crate::tcflag_t = 0x400000;
pub const FLUSHO: crate::tcflag_t = 0x800000;
pub const EXTPROC: crate::tcflag_t = 0x10000000;
// 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_vm86: 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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 127;
pub const SYS_init_module: c_long = 128;
pub const SYS_delete_module: c_long = 129;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
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; /* Syscall for Andrew File System */
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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_query_module: c_long = 166;
pub const SYS_poll: c_long = 167;
pub const SYS_nfsservctl: c_long = 168;
pub const SYS_setresgid: c_long = 169;
pub const SYS_getresgid: c_long = 170;
pub const SYS_prctl: c_long = 171;
pub const SYS_rt_sigreturn: c_long = 172;
pub const SYS_rt_sigaction: c_long = 173;
pub const SYS_rt_sigprocmask: c_long = 174;
pub const SYS_rt_sigpending: c_long = 175;
pub const SYS_rt_sigtimedwait: c_long = 176;
pub const SYS_rt_sigqueueinfo: c_long = 177;
pub const SYS_rt_sigsuspend: c_long = 178;
pub const SYS_pread64: c_long = 179;
pub const SYS_pwrite64: c_long = 180;
pub const SYS_chown: c_long = 181;
pub const SYS_getcwd: c_long = 182;
pub const SYS_capget: c_long = 183;
pub const SYS_capset: c_long = 184;
pub const SYS_sigaltstack: c_long = 185;
pub const SYS_sendfile: c_long = 186;
pub const SYS_getpmsg: c_long = 187; /* some people actually want streams */
pub const SYS_putpmsg: c_long = 188; /* some people actually want streams */
pub const SYS_vfork: c_long = 189;
pub const SYS_ugetrlimit: c_long = 190; /* SuS compliant getrlimit */
pub const SYS_readahead: c_long = 191;
pub const SYS_pciconfig_read: c_long = 198;
pub const SYS_pciconfig_write: c_long = 199;
pub const SYS_pciconfig_iobase: c_long = 200;
pub const SYS_multiplexer: c_long = 201;
pub const SYS_getdents64: c_long = 202;
pub const SYS_pivot_root: c_long = 203;
pub const SYS_madvise: c_long = 205;
pub const SYS_mincore: c_long = 206;
pub const SYS_gettid: c_long = 207;
pub const SYS_tkill: c_long = 208;
pub const SYS_setxattr: c_long = 209;
pub const SYS_lsetxattr: c_long = 210;
pub const SYS_fsetxattr: c_long = 211;
pub const SYS_getxattr: c_long = 212;
pub const SYS_lgetxattr: c_long = 213;
pub const SYS_fgetxattr: c_long = 214;
pub const SYS_listxattr: c_long = 215;
pub const SYS_llistxattr: c_long = 216;
pub const SYS_flistxattr: c_long = 217;
pub const SYS_removexattr: c_long = 218;
pub const SYS_lremovexattr: c_long = 219;
pub const SYS_fremovexattr: c_long = 220;
pub const SYS_futex: c_long = 221;
pub const SYS_sched_setaffinity: c_long = 222;
pub const SYS_sched_getaffinity: c_long = 223;
pub const SYS_tuxcall: c_long = 225;
pub const SYS_io_setup: c_long = 227;
pub const SYS_io_destroy: c_long = 228;
pub const SYS_io_getevents: c_long = 229;
pub const SYS_io_submit: c_long = 230;
pub const SYS_io_cancel: c_long = 231;
pub const SYS_set_tid_address: c_long = 232;
pub const SYS_exit_group: c_long = 234;
pub const SYS_lookup_dcookie: c_long = 235;
pub const SYS_epoll_create: c_long = 236;
pub const SYS_epoll_ctl: c_long = 237;
pub const SYS_epoll_wait: c_long = 238;
pub const SYS_remap_file_pages: c_long = 239;
pub const SYS_timer_create: c_long = 240;
pub const SYS_timer_settime: c_long = 241;
pub const SYS_timer_gettime: c_long = 242;
pub const SYS_timer_getoverrun: c_long = 243;
pub const SYS_timer_delete: c_long = 244;
pub const SYS_clock_settime: c_long = 245;
pub const SYS_clock_gettime: c_long = 246;
pub const SYS_clock_getres: c_long = 247;
pub const SYS_clock_nanosleep: c_long = 248;
pub const SYS_swapcontext: c_long = 249;
pub const SYS_tgkill: c_long = 250;
pub const SYS_utimes: c_long = 251;
pub const SYS_statfs64: c_long = 252;
pub const SYS_fstatfs64: c_long = 253;
pub const SYS_rtas: c_long = 255;
pub const SYS_sys_debug_setcontext: c_long = 256;
pub const SYS_migrate_pages: c_long = 258;
pub const SYS_mbind: c_long = 259;
pub const SYS_get_mempolicy: c_long = 260;
pub const SYS_set_mempolicy: c_long = 261;
pub const SYS_mq_open: c_long = 262;
pub const SYS_mq_unlink: c_long = 263;
pub const SYS_mq_timedsend: c_long = 264;
pub const SYS_mq_timedreceive: c_long = 265;
pub const SYS_mq_notify: c_long = 266;
pub const SYS_mq_getsetattr: c_long = 267;
pub const SYS_kexec_load: c_long = 268;
pub const SYS_add_key: c_long = 269;
pub const SYS_request_key: c_long = 270;
pub const SYS_keyctl: c_long = 271;
pub const SYS_waitid: c_long = 272;
pub const SYS_ioprio_set: c_long = 273;
pub const SYS_ioprio_get: c_long = 274;
pub const SYS_inotify_init: c_long = 275;
pub const SYS_inotify_add_watch: c_long = 276;
pub const SYS_inotify_rm_watch: c_long = 277;
pub const SYS_spu_run: c_long = 278;
pub const SYS_spu_create: c_long = 279;
pub const SYS_pselect6: c_long = 280;
pub const SYS_ppoll: c_long = 281;
pub const SYS_unshare: c_long = 282;
pub const SYS_splice: c_long = 283;
pub const SYS_tee: c_long = 284;
pub const SYS_vmsplice: c_long = 285;
pub const SYS_openat: c_long = 286;
pub const SYS_mkdirat: c_long = 287;
pub const SYS_mknodat: c_long = 288;
pub const SYS_fchownat: c_long = 289;
pub const SYS_futimesat: c_long = 290;
pub const SYS_newfstatat: c_long = 291;
pub const SYS_unlinkat: c_long = 292;
pub const SYS_renameat: c_long = 293;
pub const SYS_linkat: c_long = 294;
pub const SYS_symlinkat: c_long = 295;
pub const SYS_readlinkat: c_long = 296;
pub const SYS_fchmodat: c_long = 297;
pub const SYS_faccessat: c_long = 298;
pub const SYS_get_robust_list: c_long = 299;
pub const SYS_set_robust_list: c_long = 300;
pub const SYS_move_pages: c_long = 301;
pub const SYS_getcpu: c_long = 302;
pub const SYS_epoll_pwait: c_long = 303;
pub const SYS_utimensat: c_long = 304;
pub const SYS_signalfd: c_long = 305;
pub const SYS_timerfd_create: c_long = 306;
pub const SYS_eventfd: c_long = 307;
pub const SYS_sync_file_range2: c_long = 308;
pub const SYS_fallocate: c_long = 309;
pub const SYS_subpage_prot: c_long = 310;
pub const SYS_timerfd_settime: c_long = 311;
pub const SYS_timerfd_gettime: c_long = 312;
pub const SYS_signalfd4: c_long = 313;
pub const SYS_eventfd2: c_long = 314;
pub const SYS_epoll_create1: c_long = 315;
pub const SYS_dup3: c_long = 316;
pub const SYS_pipe2: c_long = 317;
pub const SYS_inotify_init1: c_long = 318;
pub const SYS_perf_event_open: c_long = 319;
pub const SYS_preadv: c_long = 320;
pub const SYS_pwritev: c_long = 321;
pub const SYS_rt_tgsigqueueinfo: c_long = 322;
pub const SYS_fanotify_init: c_long = 323;
pub const SYS_fanotify_mark: c_long = 324;
pub const SYS_prlimit64: c_long = 325;
pub const SYS_socket: c_long = 326;
pub const SYS_bind: c_long = 327;
pub const SYS_connect: c_long = 328;
pub const SYS_listen: c_long = 329;
pub const SYS_accept: c_long = 330;
pub const SYS_getsockname: c_long = 331;
pub const SYS_getpeername: c_long = 332;
pub const SYS_socketpair: c_long = 333;
pub const SYS_send: c_long = 334;
pub const SYS_sendto: c_long = 335;
pub const SYS_recv: c_long = 336;
pub const SYS_recvfrom: c_long = 337;
pub const SYS_shutdown: c_long = 338;
pub const SYS_setsockopt: c_long = 339;
pub const SYS_getsockopt: c_long = 340;
pub const SYS_sendmsg: c_long = 341;
pub const SYS_recvmsg: c_long = 342;
pub const SYS_recvmmsg: c_long = 343;
pub const SYS_accept4: c_long = 344;
pub const SYS_name_to_handle_at: c_long = 345;
pub const SYS_open_by_handle_at: c_long = 346;
pub const SYS_clock_adjtime: c_long = 347;
pub const SYS_syncfs: c_long = 348;
pub const SYS_sendmmsg: c_long = 349;
pub const SYS_setns: c_long = 350;
pub const SYS_process_vm_readv: c_long = 351;
pub const SYS_process_vm_writev: c_long = 352;
pub const SYS_finit_module: c_long = 353;
pub const SYS_kcmp: c_long = 354;
pub const SYS_sched_setattr: c_long = 355;
pub const SYS_sched_getattr: c_long = 356;
pub const SYS_renameat2: c_long = 357;
pub const SYS_seccomp: c_long = 358;
pub const SYS_getrandom: c_long = 359;
pub const SYS_memfd_create: c_long = 360;
pub const SYS_bpf: c_long = 361;
pub const SYS_execveat: c_long = 362;
pub const SYS_switch_endian: c_long = 363;
pub const SYS_userfaultfd: c_long = 364;
pub const SYS_membarrier: c_long = 365;
pub const SYS_mlock2: c_long = 378;
pub const SYS_copy_file_range: c_long = 379;
pub const SYS_preadv2: c_long = 380;
pub const SYS_pwritev2: c_long = 381;
pub const SYS_kexec_file_load: c_long = 382;
pub const SYS_statx: c_long = 383;
pub const SYS_rseq: c_long = 387;
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;
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;
}
@@ -0,0 +1,910 @@
//! RISC-V-specific definitions for 64-bit linux-like values
use crate::prelude::*;
use crate::{off64_t, off_t};
pub type wchar_t = c_int;
pub type nlink_t = c_uint;
pub type blksize_t = c_int;
pub type fsblkcnt64_t = c_ulong;
pub type fsfilcnt64_t = c_ulong;
pub type suseconds_t = i64;
pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;
s! {
pub struct pthread_attr_t {
__size: [c_ulong; 7],
}
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
pub __pad1: crate::dev_t,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
pub __pad2: c_int,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__unused: [c_int; 2usize],
}
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino64_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
pub __pad1: crate::dev_t,
pub st_size: off64_t,
pub st_blksize: crate::blksize_t,
pub __pad2: c_int,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__unused: [c_int; 2],
}
pub struct statfs {
pub f_type: c_long,
pub f_bsize: c_long,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_long,
pub f_frsize: c_long,
pub f_flags: c_long,
pub f_spare: [c_long; 4],
}
pub struct statfs64 {
pub f_type: c_long,
pub f_bsize: c_long,
pub f_blocks: crate::fsblkcnt64_t,
pub f_bfree: crate::fsblkcnt64_t,
pub f_bavail: crate::fsblkcnt64_t,
pub f_files: crate::fsfilcnt64_t,
pub f_ffree: crate::fsfilcnt64_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_long,
pub f_frsize: c_long,
pub f_flags: c_long,
pub f_spare: [c_long; 4],
}
pub struct statvfs {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_favail: crate::fsfilcnt_t,
pub f_fsid: c_ulong,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
pub __f_spare: [c_int; 6],
}
pub struct statvfs64 {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt64_t,
pub f_bfree: crate::fsblkcnt64_t,
pub f_bavail: crate::fsblkcnt64_t,
pub f_files: crate::fsfilcnt64_t,
pub f_ffree: crate::fsfilcnt64_t,
pub f_favail: crate::fsfilcnt64_t,
pub f_fsid: c_ulong,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
pub __f_spare: [c_int; 6],
}
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: [u64; 0],
}
pub struct stack_t {
pub ss_sp: *mut c_void,
pub ss_flags: c_int,
pub ss_size: size_t,
}
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
pub sa_flags: c_int,
pub sa_restorer: Option<unsafe extern "C" fn()>,
}
pub struct ipc_perm {
pub __key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::gid_t,
pub mode: c_ushort,
__pad1: c_ushort,
pub __seq: c_ushort,
__pad2: c_ushort,
__unused1: c_ulong,
__unused2: c_ulong,
}
pub struct shmid_ds {
pub shm_perm: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__unused5: c_ulong,
__unused6: 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_pid: crate::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: crate::pid_t,
}
pub struct user_regs_struct {
pub pc: c_ulong,
pub ra: c_ulong,
pub sp: c_ulong,
pub gp: c_ulong,
pub tp: c_ulong,
pub t0: c_ulong,
pub t1: c_ulong,
pub t2: c_ulong,
pub s0: c_ulong,
pub s1: c_ulong,
pub a0: c_ulong,
pub a1: c_ulong,
pub a2: c_ulong,
pub a3: c_ulong,
pub a4: c_ulong,
pub a5: c_ulong,
pub a6: c_ulong,
pub a7: c_ulong,
pub s2: c_ulong,
pub s3: c_ulong,
pub s4: c_ulong,
pub s5: c_ulong,
pub s6: c_ulong,
pub s7: c_ulong,
pub s8: c_ulong,
pub s9: c_ulong,
pub s10: c_ulong,
pub s11: c_ulong,
pub t3: c_ulong,
pub t4: c_ulong,
pub t5: c_ulong,
pub t6: c_ulong,
}
#[repr(align(8))]
pub struct clone_args {
pub flags: c_ulonglong,
pub pidfd: c_ulonglong,
pub child_tid: c_ulonglong,
pub parent_tid: c_ulonglong,
pub exit_signal: c_ulonglong,
pub stack: c_ulonglong,
pub stack_size: c_ulonglong,
pub tls: c_ulonglong,
pub set_tid: c_ulonglong,
pub set_tid_size: c_ulonglong,
pub cgroup: c_ulonglong,
}
}
s_no_extra_traits! {
pub struct ucontext_t {
pub __uc_flags: c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: crate::stack_t,
pub uc_sigmask: crate::sigset_t,
pub uc_mcontext: mcontext_t,
}
#[repr(align(16))]
pub struct mcontext_t {
pub __gregs: [c_ulong; 32],
pub __fpregs: __riscv_mc_fp_state,
}
pub union __riscv_mc_fp_state {
pub __f: __riscv_mc_f_ext_state,
pub __d: __riscv_mc_d_ext_state,
pub __q: __riscv_mc_q_ext_state,
}
pub struct __riscv_mc_f_ext_state {
pub __f: [c_uint; 32],
pub __fcsr: c_uint,
}
pub struct __riscv_mc_d_ext_state {
pub __f: [c_ulonglong; 32],
pub __fcsr: c_uint,
}
#[repr(align(16))]
pub struct __riscv_mc_q_ext_state {
pub __f: [c_ulonglong; 64],
pub __fcsr: c_uint,
pub __glibc_reserved: [c_uint; 3],
}
}
pub const POSIX_FADV_DONTNEED: c_int = 4;
pub const POSIX_FADV_NOREUSE: c_int = 5;
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_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 = 1052672;
pub const O_NOATIME: c_int = 262144;
pub const O_PATH: c_int = 2097152;
pub const O_TMPFILE: c_int = 4259840;
pub const MADV_SOFT_OFFLINE: c_int = 101;
pub const MAP_GROWSDOWN: c_int = 256;
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 SOCK_STREAM: c_int = 1;
pub const SOCK_DGRAM: c_int = 2;
pub const SA_ONSTACK: c_int = 134217728;
pub const SA_SIGINFO: c_int = 4;
pub const SA_NOCLDWAIT: c_int = 2;
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 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;
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 = 0;
pub const SIG_UNBLOCK: c_int = 1;
pub const POLLWRNORM: c_short = 256;
pub const POLLWRBAND: c_short = 512;
pub const O_ASYNC: c_int = 8192;
pub const O_NDELAY: c_int = 2048;
pub const PTRACE_DETACH: c_uint = 17;
pub const EFD_NONBLOCK: c_int = 2048;
pub const F_GETLK: c_int = 5;
pub const F_GETOWN: c_int = 9;
pub const F_SETOWN: c_int = 8;
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 F_OFD_GETLK: c_int = 36;
pub const F_OFD_SETLK: c_int = 37;
pub const F_OFD_SETLKW: c_int = 38;
pub const SFD_NONBLOCK: c_int = 2048;
pub const TCSANOW: c_int = 0;
pub const TCSADRAIN: c_int = 1;
pub const TCSAFLUSH: c_int = 2;
pub const SFD_CLOEXEC: c_int = 524288;
pub const NCCS: usize = 32;
pub const O_TRUNC: c_int = 512;
pub const O_CLOEXEC: c_int = 524288;
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 = 1073741824;
pub const SA_RESETHAND: c_int = -2147483648;
pub const SA_RESTART: c_int = 268435456;
pub const SA_NOCLDSTOP: c_int = 1;
pub const EPOLL_CLOEXEC: c_int = 524288;
pub const EFD_CLOEXEC: c_int = 524288;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const O_DIRECT: c_int = 16384;
pub const O_DIRECTORY: c_int = 65536;
pub const O_NOFOLLOW: c_int = 131072;
pub const MAP_HUGETLB: c_int = 262144;
pub const MAP_LOCKED: c_int = 8192;
pub const MAP_NORESERVE: c_int = 16384;
pub const MAP_ANON: c_int = 32;
pub const MAP_ANONYMOUS: c_int = 32;
pub const MAP_DENYWRITE: c_int = 2048;
pub const MAP_EXECUTABLE: c_int = 4096;
pub const MAP_POPULATE: c_int = 32768;
pub const MAP_NONBLOCK: c_int = 65536;
pub const MAP_STACK: c_int = 131072;
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 PTRACE_GETFPREGS: c_uint = 14;
pub const PTRACE_SETFPREGS: c_uint = 15;
pub const PTRACE_GETFPXREGS: c_uint = 18;
pub const PTRACE_SETFPXREGS: c_uint = 19;
pub const PTRACE_GETREGS: c_uint = 12;
pub const PTRACE_SETREGS: c_uint = 13;
pub const MCL_CURRENT: c_int = 1;
pub const MCL_FUTURE: c_int = 2;
pub const MCL_ONFAULT: c_int = 4;
pub const SIGSTKSZ: size_t = 8192;
pub const MINSIGSTKSZ: size_t = 2048;
pub const CBAUD: crate::tcflag_t = 4111;
pub const TAB1: crate::tcflag_t = 2048;
pub const TAB2: crate::tcflag_t = 4096;
pub const TAB3: crate::tcflag_t = 6144;
pub const CR1: crate::tcflag_t = 512;
pub const CR2: crate::tcflag_t = 1024;
pub const CR3: crate::tcflag_t = 1536;
pub const FF1: crate::tcflag_t = 32768;
pub const BS1: crate::tcflag_t = 8192;
pub const VT1: crate::tcflag_t = 16384;
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: crate::tcflag_t = 1024;
pub const IXOFF: crate::tcflag_t = 4096;
pub const ONLCR: crate::tcflag_t = 4;
pub const CSIZE: crate::tcflag_t = 48;
pub const CS6: crate::tcflag_t = 16;
pub const CS7: crate::tcflag_t = 32;
pub const CS8: crate::tcflag_t = 48;
pub const CSTOPB: crate::tcflag_t = 64;
pub const CREAD: crate::tcflag_t = 128;
pub const PARENB: crate::tcflag_t = 256;
pub const PARODD: crate::tcflag_t = 512;
pub const HUPCL: crate::tcflag_t = 1024;
pub const CLOCAL: crate::tcflag_t = 2048;
pub const ECHOKE: crate::tcflag_t = 2048;
pub const ECHOE: crate::tcflag_t = 16;
pub const ECHOK: crate::tcflag_t = 32;
pub const ECHONL: crate::tcflag_t = 64;
pub const ECHOPRT: crate::tcflag_t = 1024;
pub const ECHOCTL: crate::tcflag_t = 512;
pub const ISIG: crate::tcflag_t = 1;
pub const ICANON: crate::tcflag_t = 2;
pub const PENDIN: crate::tcflag_t = 16384;
pub const NOFLSH: crate::tcflag_t = 128;
pub const CIBAUD: crate::tcflag_t = 269418496;
pub const CBAUDEX: crate::tcflag_t = 4096;
pub const VSWTC: usize = 7;
pub const OLCUC: crate::tcflag_t = 2;
pub const NLDLY: crate::tcflag_t = 256;
pub const CRDLY: crate::tcflag_t = 1536;
pub const TABDLY: crate::tcflag_t = 6144;
pub const BSDLY: crate::tcflag_t = 8192;
pub const FFDLY: crate::tcflag_t = 32768;
pub const VTDLY: crate::tcflag_t = 16384;
pub const XTABS: crate::tcflag_t = 6144;
pub const B0: crate::speed_t = 0;
pub const B50: crate::speed_t = 1;
pub const B75: crate::speed_t = 2;
pub const B110: crate::speed_t = 3;
pub const B134: crate::speed_t = 4;
pub const B150: crate::speed_t = 5;
pub const B200: crate::speed_t = 6;
pub const B300: crate::speed_t = 7;
pub const B600: crate::speed_t = 8;
pub const B1200: crate::speed_t = 9;
pub const B1800: crate::speed_t = 10;
pub const B2400: crate::speed_t = 11;
pub const B4800: crate::speed_t = 12;
pub const B9600: crate::speed_t = 13;
pub const B19200: crate::speed_t = 14;
pub const B38400: crate::speed_t = 15;
pub const EXTA: crate::speed_t = 14;
pub const EXTB: crate::speed_t = 15;
pub const B57600: crate::speed_t = 4097;
pub const B115200: crate::speed_t = 4098;
pub const B230400: crate::speed_t = 4099;
pub const B460800: crate::speed_t = 4100;
pub const B500000: crate::speed_t = 4101;
pub const B576000: crate::speed_t = 4102;
pub const B921600: crate::speed_t = 4103;
pub const B1000000: crate::speed_t = 4104;
pub const B1152000: crate::speed_t = 4105;
pub const B1500000: crate::speed_t = 4106;
pub const B2000000: crate::speed_t = 4107;
pub const B2500000: crate::speed_t = 4108;
pub const B3000000: crate::speed_t = 4109;
pub const B3500000: crate::speed_t = 4110;
pub const B4000000: crate::speed_t = 4111;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
pub const IEXTEN: crate::tcflag_t = 32768;
pub const TOSTOP: crate::tcflag_t = 256;
pub const FLUSHO: crate::tcflag_t = 4096;
pub const EXTPROC: crate::tcflag_t = 65536;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
pub const NGREG: usize = 32;
pub const REG_PC: usize = 0;
pub const REG_RA: usize = 1;
pub const REG_SP: usize = 2;
pub const REG_TP: usize = 4;
pub const REG_S0: usize = 8;
pub const REG_S1: usize = 9;
pub const REG_A0: usize = 10;
pub const REG_S2: usize = 18;
pub const REG_NARGS: usize = 8;
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');
#[allow(clippy::eq_op)]
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 COMPAT_HWCAP_ISA_V: c_ulong = 1 << (b'V' - b'A');
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_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;
+955
View File
@@ -0,0 +1,955 @@
//! s390x
use crate::prelude::*;
use crate::{off64_t, off_t, pthread_mutex_t};
pub type blksize_t = i64;
pub type nlink_t = u64;
pub type suseconds_t = i64;
pub type wchar_t = i32;
pub type greg_t = u64;
pub type __u64 = u64;
pub type __s64 = i64;
s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
__glibc_reserved0: c_int,
pub sa_flags: c_int,
pub sa_restorer: Option<extern "C" fn()>,
pub sa_mask: crate::sigset_t,
}
pub struct statfs {
pub f_type: c_uint,
pub f_bsize: c_uint,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_uint,
pub f_frsize: c_uint,
pub f_flags: c_uint,
f_spare: [c_uint; 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: crate::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: crate::pid_t,
}
pub struct siginfo_t {
pub si_signo: c_int,
pub si_errno: c_int,
pub si_code: c_int,
_pad: c_int,
_pad2: [c_long; 14],
}
pub struct stack_t {
pub ss_sp: *mut c_void,
pub ss_flags: c_int,
pub ss_size: size_t,
}
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_nlink: crate::nlink_t,
pub st_mode: crate::mode_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
st_pad0: c_int,
pub st_rdev: crate::dev_t,
pub st_size: off_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt_t,
__glibc_reserved: [c_long; 3],
}
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino64_t,
pub st_nlink: crate::nlink_t,
pub st_mode: crate::mode_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
st_pad0: c_int,
pub st_rdev: crate::dev_t,
pub st_size: off_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt64_t,
__glibc_reserved: [c_long; 3],
}
pub struct pthread_attr_t {
__size: [c_ulong; 7],
}
pub struct ipc_perm {
pub __key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::gid_t,
pub mode: crate::mode_t,
pub __seq: c_ushort,
__pad1: c_ushort,
__unused1: c_ulong,
__unused2: c_ulong,
}
pub struct shmid_ds {
pub shm_perm: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__unused4: c_ulong,
__unused5: c_ulong,
}
pub struct statvfs {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_favail: crate::fsfilcnt_t,
pub f_fsid: c_ulong,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
__f_spare: [c_int; 6],
}
pub struct __psw_t {
pub mask: u64,
pub addr: u64,
}
pub struct fpregset_t {
pub fpc: u32,
__pad: u32,
pub fprs: [fpreg_t; 16],
}
pub struct mcontext_t {
pub psw: __psw_t,
pub gregs: [u64; 16],
pub aregs: [u32; 16],
pub fpregs: fpregset_t,
}
pub struct ucontext_t {
pub uc_flags: c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: crate::stack_t,
pub uc_mcontext: mcontext_t,
pub uc_sigmask: crate::sigset_t,
}
pub struct statfs64 {
pub f_type: c_uint,
pub f_bsize: c_uint,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_fsid: crate::fsid_t,
pub f_namelen: c_uint,
pub f_frsize: c_uint,
pub f_flags: c_uint,
pub f_spare: [c_uint; 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],
}
}
s_no_extra_traits! {
// FIXME(union): This is actually a union.
pub struct fpreg_t {
pub d: c_double,
// f: c_float,
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for fpreg_t {
fn eq(&self, other: &fpreg_t) -> bool {
self.d == other.d
}
}
impl Eq for fpreg_t {}
impl hash::Hash for fpreg_t {
fn hash<H: hash::Hasher>(&self, state: &mut H) {
let d: u64 = self.d.to_bits();
d.hash(state);
}
}
}
}
pub const POSIX_FADV_DONTNEED: c_int = 6;
pub const POSIX_FADV_NOREUSE: c_int = 7;
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 SFD_CLOEXEC: c_int = 0x080000;
pub const NCCS: usize = 32;
pub const O_TRUNC: c_int = 512;
pub const O_NOATIME: c_int = 0o1000000;
pub const O_CLOEXEC: c_int = 0x80000;
pub const O_PATH: c_int = 0o10000000;
pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY;
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;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
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 EADDRINUSE: c_int = 98;
pub const EADDRNOTAVAIL: c_int = 99;
pub const ECONNABORTED: c_int = 103;
pub const ECONNREFUSED: c_int = 111;
pub const ECONNRESET: c_int = 104;
pub const EDEADLK: c_int = 35;
pub const ENOSYS: c_int = 38;
pub const ENOTCONN: c_int = 107;
pub const ETIMEDOUT: c_int = 110;
pub const O_APPEND: c_int = 1024;
pub const O_CREAT: c_int = 64;
pub const O_EXCL: c_int = 128;
pub const O_NONBLOCK: c_int = 2048;
pub const SA_NOCLDWAIT: c_int = 2;
pub const SA_ONSTACK: c_int = 0x08000000;
pub const SA_SIGINFO: c_int = 4;
pub const SIGBUS: c_int = 7;
pub const SIGSTKSZ: size_t = 0x2000;
pub const MINSIGSTKSZ: size_t = 2048;
pub const SIG_SETMASK: c_int = 2;
pub const SOCK_STREAM: c_int = 1;
pub const SOCK_DGRAM: c_int = 2;
pub const O_NOCTTY: c_int = 256;
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_DIRECT: c_int = 0x4000;
pub const O_DIRECTORY: c_int = 0x10000;
pub const O_NOFOLLOW: c_int = 0x20000;
pub const MADV_SOFT_OFFLINE: c_int = 101;
pub const MAP_GROWSDOWN: c_int = 0x0100;
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_SYNC: c_int = 0x080000;
pub const EDEADLOCK: c_int = 35;
pub const ENAMETOOLONG: c_int = 36;
pub const ENOLCK: c_int = 37;
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 ENETDOWN: c_int = 100;
pub const ENETUNREACH: c_int = 101;
pub const ENETRESET: c_int = 102;
pub const ENOBUFS: c_int = 105;
pub const EISCONN: c_int = 106;
pub const ESHUTDOWN: c_int = 108;
pub const ETOOMANYREFS: c_int = 109;
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 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 SIGCHLD: c_int = 17;
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_BLOCK: c_int = 0x000000;
pub const SIG_UNBLOCK: c_int = 0x01;
pub const O_ASYNC: c_int = 0x2000;
pub const O_NDELAY: c_int = 0x800;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
pub const IEXTEN: crate::tcflag_t = 0x00008000;
pub const TOSTOP: crate::tcflag_t = 0x00000100;
pub const FLUSHO: crate::tcflag_t = 0x00001000;
pub const EXTPROC: crate::tcflag_t = 0x00010000;
pub const PTRACE_DETACH: c_uint = 17;
pub const MCL_CURRENT: c_int = 0x0001;
pub const MCL_FUTURE: c_int = 0x0002;
pub const MCL_ONFAULT: c_int = 0x0004;
pub const EFD_NONBLOCK: c_int = 0x800;
pub const F_RDLCK: c_int = 0;
pub const F_WRLCK: c_int = 1;
pub const F_UNLCK: 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 F_SETLK: c_int = 6;
pub const F_SETLKW: c_int = 7;
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 SFD_NONBLOCK: c_int = 0x0800;
pub const TCSANOW: c_int = 0;
pub const TCSADRAIN: c_int = 1;
pub const TCSAFLUSH: c_int = 2;
pub const VTIME: usize = 5;
pub const VSWTC: usize = 7;
pub const VSTART: usize = 8;
pub const VSTOP: usize = 9;
pub const VSUSP: usize = 10;
pub const VREPRINT: usize = 12;
pub const VDISCARD: usize = 13;
pub const VWERASE: usize = 14;
pub const OLCUC: crate::tcflag_t = 0o000002;
pub const ONLCR: crate::tcflag_t = 0o000004;
pub const NLDLY: crate::tcflag_t = 0o000400;
pub const CRDLY: crate::tcflag_t = 0o003000;
pub const CR1: crate::tcflag_t = 0x00000200;
pub const CR2: crate::tcflag_t = 0x00000400;
pub const CR3: crate::tcflag_t = 0x00000600;
pub const TABDLY: crate::tcflag_t = 0o014000;
pub const TAB1: crate::tcflag_t = 0x00000800;
pub const TAB2: crate::tcflag_t = 0x00001000;
pub const TAB3: crate::tcflag_t = 0x00001800;
pub const BSDLY: crate::tcflag_t = 0o020000;
pub const BS1: crate::tcflag_t = 0x00002000;
pub const FFDLY: crate::tcflag_t = 0o100000;
pub const FF1: crate::tcflag_t = 0x00008000;
pub const VTDLY: crate::tcflag_t = 0o040000;
pub const VT1: crate::tcflag_t = 0x00004000;
pub const XTABS: crate::tcflag_t = 0o014000;
pub const CBAUD: crate::speed_t = 0o010017;
pub const B0: crate::speed_t = 0o000000;
pub const B50: crate::speed_t = 0o000001;
pub const B75: crate::speed_t = 0o000002;
pub const B110: crate::speed_t = 0o000003;
pub const B134: crate::speed_t = 0o000004;
pub const B150: crate::speed_t = 0o000005;
pub const B200: crate::speed_t = 0o000006;
pub const B300: crate::speed_t = 0o000007;
pub const B600: crate::speed_t = 0o000010;
pub const B1200: crate::speed_t = 0o000011;
pub const B1800: crate::speed_t = 0o000012;
pub const B2400: crate::speed_t = 0o000013;
pub const B4800: crate::speed_t = 0o000014;
pub const B9600: crate::speed_t = 0o000015;
pub const B19200: crate::speed_t = 0o000016;
pub const B38400: crate::speed_t = 0o000017;
pub const EXTA: crate::speed_t = B19200;
pub const EXTB: crate::speed_t = B38400;
pub const CSIZE: crate::tcflag_t = 0o000060;
pub const CS6: crate::tcflag_t = 0o000020;
pub const CS7: crate::tcflag_t = 0o000040;
pub const CS8: crate::tcflag_t = 0o000060;
pub const CSTOPB: crate::tcflag_t = 0o000100;
pub const CREAD: crate::tcflag_t = 0o000200;
pub const PARENB: crate::tcflag_t = 0o000400;
pub const PARODD: crate::tcflag_t = 0o001000;
pub const HUPCL: crate::tcflag_t = 0o002000;
pub const CLOCAL: crate::tcflag_t = 0o004000;
pub const CBAUDEX: crate::tcflag_t = 0o010000;
pub const B57600: crate::speed_t = 0o010001;
pub const B115200: crate::speed_t = 0o010002;
pub const B230400: crate::speed_t = 0o010003;
pub const B460800: crate::speed_t = 0o010004;
pub const B500000: crate::speed_t = 0o010005;
pub const B576000: crate::speed_t = 0o010006;
pub const B921600: crate::speed_t = 0o010007;
pub const B1000000: crate::speed_t = 0o010010;
pub const B1152000: crate::speed_t = 0o010011;
pub const B1500000: crate::speed_t = 0o010012;
pub const B2000000: crate::speed_t = 0o010013;
pub const B2500000: crate::speed_t = 0o010014;
pub const B3000000: crate::speed_t = 0o010015;
pub const B3500000: crate::speed_t = 0o010016;
pub const B4000000: crate::speed_t = 0o010017;
pub const CIBAUD: crate::tcflag_t = 0o02003600000;
pub const ISIG: crate::tcflag_t = 0o000001;
pub const ICANON: crate::tcflag_t = 0o000002;
pub const XCASE: crate::tcflag_t = 0o000004;
pub const ECHOE: crate::tcflag_t = 0o000020;
pub const ECHOK: crate::tcflag_t = 0o000040;
pub const ECHONL: crate::tcflag_t = 0o000100;
pub const NOFLSH: crate::tcflag_t = 0o000200;
pub const ECHOCTL: crate::tcflag_t = 0o001000;
pub const ECHOPRT: crate::tcflag_t = 0o002000;
pub const ECHOKE: crate::tcflag_t = 0o004000;
pub const PENDIN: crate::tcflag_t = 0o040000;
pub const POLLWRNORM: c_short = 0x100;
pub const POLLWRBAND: c_short = 0x200;
pub const IXON: crate::tcflag_t = 0o002000;
pub const IXOFF: crate::tcflag_t = 0o010000;
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_restart_syscall: 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_mknod: c_long = 14;
pub const SYS_chmod: c_long = 15;
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_ptrace: c_long = 26;
pub const SYS_alarm: c_long = 27;
pub const SYS_pause: c_long = 29;
pub const SYS_utime: 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_signal: c_long = 48;
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_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_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_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_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_stat: c_long = 106;
pub const SYS_lstat: c_long = 107;
pub const SYS_fstat: c_long = 108;
pub const SYS_lookup_dcookie: c_long = 110;
pub const SYS_vhangup: c_long = 111;
pub const SYS_idle: c_long = 112;
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_adjtimex: c_long = 124;
pub const SYS_mprotect: c_long = 125;
pub const SYS_sigprocmask: c_long = 126;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 127;
pub const SYS_init_module: c_long = 128;
pub const SYS_delete_module: c_long = 129;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
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; /* Syscall for Andrew File System */
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__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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
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_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_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_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_readahead: c_long = 222;
pub const SYS_setxattr: c_long = 224;
pub const SYS_lsetxattr: c_long = 225;
pub const SYS_fsetxattr: c_long = 226;
pub const SYS_getxattr: c_long = 227;
pub const SYS_lgetxattr: c_long = 228;
pub const SYS_fgetxattr: c_long = 229;
pub const SYS_listxattr: c_long = 230;
pub const SYS_llistxattr: c_long = 231;
pub const SYS_flistxattr: c_long = 232;
pub const SYS_removexattr: c_long = 233;
pub const SYS_lremovexattr: c_long = 234;
pub const SYS_fremovexattr: c_long = 235;
pub const SYS_gettid: c_long = 236;
pub const SYS_tkill: c_long = 237;
pub const SYS_futex: c_long = 238;
pub const SYS_sched_setaffinity: c_long = 239;
pub const SYS_sched_getaffinity: c_long = 240;
pub const SYS_tgkill: c_long = 241;
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_epoll_create: c_long = 249;
pub const SYS_epoll_ctl: c_long = 250;
pub const SYS_epoll_wait: c_long = 251;
pub const SYS_set_tid_address: c_long = 252;
pub const SYS_fadvise64: c_long = 253;
pub const SYS_timer_create: c_long = 254;
pub const SYS_timer_settime: c_long = 255;
pub const SYS_timer_gettime: c_long = 256;
pub const SYS_timer_getoverrun: c_long = 257;
pub const SYS_timer_delete: c_long = 258;
pub const SYS_clock_settime: c_long = 259;
pub const SYS_clock_gettime: c_long = 260;
pub const SYS_clock_getres: c_long = 261;
pub const SYS_clock_nanosleep: c_long = 262;
pub const SYS_statfs64: c_long = 265;
pub const SYS_fstatfs64: c_long = 266;
pub const SYS_remap_file_pages: 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: c_long = 273;
pub const SYS_mq_timedreceive: c_long = 274;
pub const SYS_mq_notify: c_long = 275;
pub const SYS_mq_getsetattr: c_long = 276;
pub const SYS_kexec_load: c_long = 277;
pub const SYS_add_key: c_long = 278;
pub const SYS_request_key: c_long = 279;
pub const SYS_keyctl: c_long = 280;
pub const SYS_waitid: 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: c_long = 292;
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: c_long = 301;
pub const SYS_ppoll: 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_getcpu: c_long = 311;
pub const SYS_epoll_pwait: c_long = 312;
pub const SYS_utimes: c_long = 313;
pub const SYS_fallocate: c_long = 314;
pub const SYS_utimensat: c_long = 315;
pub const SYS_signalfd: c_long = 316;
pub const SYS_timerfd: c_long = 317;
pub const SYS_eventfd: c_long = 318;
pub const SYS_timerfd_create: c_long = 319;
pub const SYS_timerfd_settime: c_long = 320;
pub const SYS_timerfd_gettime: c_long = 321;
pub const SYS_signalfd4: c_long = 322;
pub const SYS_eventfd2: c_long = 323;
pub const SYS_inotify_init1: c_long = 324;
pub const SYS_pipe2: c_long = 325;
pub const SYS_dup3: c_long = 326;
pub const SYS_epoll_create1: c_long = 327;
pub const SYS_preadv: c_long = 328;
pub const SYS_pwritev: c_long = 329;
pub const SYS_rt_tgsigqueueinfo: c_long = 330;
pub const SYS_perf_event_open: c_long = 331;
pub const SYS_fanotify_init: c_long = 332;
pub const SYS_fanotify_mark: c_long = 333;
pub const SYS_prlimit64: c_long = 334;
pub const SYS_name_to_handle_at: c_long = 335;
pub const SYS_open_by_handle_at: c_long = 336;
pub const SYS_clock_adjtime: c_long = 337;
pub const SYS_syncfs: c_long = 338;
pub const SYS_setns: c_long = 339;
pub const SYS_process_vm_readv: c_long = 340;
pub const SYS_process_vm_writev: c_long = 341;
pub const SYS_s390_runtime_instr: c_long = 342;
pub const SYS_kcmp: c_long = 343;
pub const SYS_finit_module: c_long = 344;
pub const SYS_sched_setattr: c_long = 345;
pub const SYS_sched_getattr: c_long = 346;
pub const SYS_renameat2: c_long = 347;
pub const SYS_seccomp: c_long = 348;
pub const SYS_getrandom: c_long = 349;
pub const SYS_memfd_create: c_long = 350;
pub const SYS_bpf: c_long = 351;
pub const SYS_s390_pci_mmio_write: c_long = 352;
pub const SYS_s390_pci_mmio_read: c_long = 353;
pub const SYS_execveat: c_long = 354;
pub const SYS_userfaultfd: c_long = 355;
pub const SYS_membarrier: c_long = 356;
pub const SYS_recvmmsg: c_long = 357;
pub const SYS_sendmmsg: 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_mlock2: c_long = 374;
pub const SYS_copy_file_range: c_long = 375;
pub const SYS_preadv2: c_long = 376;
pub const SYS_pwritev2: c_long = 377;
pub const SYS_lchown: c_long = 198;
pub const SYS_setuid: c_long = 213;
pub const SYS_getuid: c_long = 199;
pub const SYS_setgid: c_long = 214;
pub const SYS_getgid: c_long = 200;
pub const SYS_geteuid: c_long = 201;
pub const SYS_setreuid: c_long = 203;
pub const SYS_setregid: c_long = 204;
pub const SYS_getrlimit: c_long = 191;
pub const SYS_getgroups: c_long = 205;
pub const SYS_fchown: c_long = 207;
pub const SYS_setresuid: c_long = 208;
pub const SYS_setresgid: c_long = 210;
pub const SYS_getresgid: c_long = 211;
pub const SYS_select: c_long = 142;
pub const SYS_getegid: c_long = 202;
pub const SYS_setgroups: c_long = 206;
pub const SYS_getresuid: c_long = 209;
pub const SYS_chown: c_long = 212;
pub const SYS_setfsuid: c_long = 215;
pub const SYS_setfsgid: c_long = 216;
pub const SYS_newfstatat: c_long = 293;
pub const SYS_statx: c_long = 379;
pub const SYS_rseq: 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;
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;
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;
pub fn getcontext(ucp: *mut crate::ucontext_t) -> c_int;
pub fn setcontext(ucp: *const crate::ucontext_t) -> c_int;
pub fn makecontext(ucp: *mut crate::ucontext_t, func: extern "C" fn(), argc: c_int, ...);
pub fn swapcontext(uocp: *mut crate::ucontext_t, ucp: *const crate::ucontext_t) -> c_int;
}
@@ -0,0 +1,929 @@
//! SPARC64-specific definitions for 64-bit linux-like values
use crate::prelude::*;
use crate::{off64_t, off_t, pthread_mutex_t};
pub type wchar_t = i32;
pub type nlink_t = u32;
pub type blksize_t = i64;
pub type suseconds_t = i32;
pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;
s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
#[cfg(target_arch = "sparc64")]
__reserved0: c_int,
pub sa_flags: c_int,
pub sa_restorer: Option<extern "C" fn()>,
}
pub struct statfs {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__fsword_t,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
f_spare: [crate::__fsword_t; 5],
}
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 flock {
pub l_type: c_short,
pub l_whence: c_short,
pub l_start: off_t,
pub l_len: off_t,
pub l_pid: crate::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: crate::pid_t,
__reserved: c_short,
}
pub struct stack_t {
pub ss_sp: *mut c_void,
pub ss_flags: c_int,
pub ss_size: size_t,
}
pub struct stat {
pub st_dev: crate::dev_t,
__pad0: u64,
pub st_ino: crate::ino_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad1: u64,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__unused: [c_long; 2],
}
pub struct stat64 {
pub st_dev: crate::dev_t,
__pad0: u64,
pub st_ino: crate::ino64_t,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad2: c_int,
pub st_size: off64_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt64_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
__reserved: [c_long; 2],
}
pub struct statfs64 {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__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: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
pub f_spare: [crate::__fsword_t; 4],
}
pub struct statvfs {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_favail: crate::fsfilcnt_t,
pub f_fsid: c_ulong,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
__f_spare: [c_int; 6],
}
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_attr_t {
__size: [u64; 7],
}
pub struct ipc_perm {
pub __key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::gid_t,
pub mode: crate::mode_t,
__pad0: u16,
pub __seq: c_ushort,
__unused1: c_ulonglong,
__unused2: c_ulonglong,
}
pub struct shmid_ds {
pub shm_perm: crate::ipc_perm,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
pub shm_segsz: size_t,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__reserved1: c_ulong,
__reserved2: c_ulong,
}
}
s_no_extra_traits! {
#[repr(align(16))]
pub struct max_align_t {
priv_: [i64; 4],
}
}
pub const POSIX_FADV_DONTNEED: c_int = 4;
pub const POSIX_FADV_NOREUSE: c_int = 5;
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 __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
pub const O_APPEND: c_int = 0x8;
pub const O_CREAT: c_int = 0x200;
pub const O_EXCL: c_int = 0x800;
pub const O_NOCTTY: c_int = 0x8000;
pub const O_NONBLOCK: c_int = 0x4000;
pub const O_SYNC: c_int = 0x802000;
pub const O_RSYNC: c_int = 0x802000;
pub const O_DSYNC: c_int = 0x2000;
pub const O_FSYNC: c_int = 0x802000;
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 MADV_SOFT_OFFLINE: c_int = 101;
pub const MAP_GROWSDOWN: c_int = 0x0200;
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_SYNC: c_int = 0x080000;
pub const EDEADLK: c_int = 78;
pub const ENAMETOOLONG: c_int = 63;
pub const ENOLCK: c_int = 79;
pub const ENOSYS: c_int = 90;
pub const ENOTEMPTY: c_int = 66;
pub const ELOOP: c_int = 62;
pub const ENOMSG: c_int = 75;
pub const EIDRM: c_int = 77;
pub const ECHRNG: c_int = 94;
pub const EL2NSYNC: c_int = 95;
pub const EL3HLT: c_int = 96;
pub const EL3RST: c_int = 97;
pub const ELNRNG: c_int = 98;
pub const EUNATCH: c_int = 99;
pub const ENOCSI: c_int = 100;
pub const EL2HLT: c_int = 101;
pub const EBADE: c_int = 102;
pub const EBADR: c_int = 103;
pub const EXFULL: c_int = 104;
pub const ENOANO: c_int = 105;
pub const EBADRQC: c_int = 106;
pub const EBADSLT: c_int = 107;
pub const EMULTIHOP: c_int = 87;
pub const EOVERFLOW: c_int = 92;
pub const ENOTUNIQ: c_int = 115;
pub const EBADFD: c_int = 93;
pub const EBADMSG: c_int = 76;
pub const EREMCHG: c_int = 89;
pub const ELIBACC: c_int = 114;
pub const ELIBBAD: c_int = 112;
pub const ELIBSCN: c_int = 124;
pub const ELIBMAX: c_int = 123;
pub const ELIBEXEC: c_int = 110;
pub const EILSEQ: c_int = 122;
pub const ERESTART: c_int = 116;
pub const ESTRPIPE: c_int = 91;
pub const EUSERS: c_int = 68;
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 EHOSTDOWN: c_int = 64;
pub const EHOSTUNREACH: c_int = 65;
pub const EALREADY: c_int = 37;
pub const EINPROGRESS: c_int = 36;
pub const ESTALE: c_int = 70;
pub const EDQUOT: c_int = 69;
pub const ENOMEDIUM: c_int = 125;
pub const EMEDIUMTYPE: c_int = 126;
pub const ECANCELED: c_int = 127;
pub const ENOKEY: c_int = 128;
pub const EKEYEXPIRED: c_int = 129;
pub const EKEYREVOKED: c_int = 130;
pub const EKEYREJECTED: c_int = 131;
pub const EOWNERDEAD: c_int = 132;
pub const ENOTRECOVERABLE: c_int = 133;
pub const EHWPOISON: c_int = 135;
pub const ERFKILL: c_int = 134;
pub const SOCK_STREAM: c_int = 1;
pub const SOCK_DGRAM: c_int = 2;
pub const SA_ONSTACK: c_int = 1;
pub const SA_SIGINFO: c_int = 0x200;
pub const SA_NOCLDWAIT: c_int = 0x100;
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 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 SIGPOLL: c_int = 23;
pub const SIGPWR: c_int = 29;
pub const SIG_SETMASK: c_int = 4;
pub const SIG_BLOCK: c_int = 1;
pub const SIG_UNBLOCK: c_int = 2;
pub const POLLWRNORM: c_short = 4;
pub const POLLWRBAND: c_short = 0x100;
pub const O_ASYNC: c_int = 0x40;
pub const O_NDELAY: c_int = 0x4004;
pub const PTRACE_DETACH: c_uint = 17;
pub const EFD_NONBLOCK: c_int = 0x4000;
pub const F_GETLK: c_int = 7;
pub const F_GETOWN: c_int = 5;
pub const F_SETOWN: c_int = 6;
pub const F_SETLK: c_int = 8;
pub const F_SETLKW: c_int = 9;
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 F_RDLCK: c_int = 1;
pub const F_WRLCK: c_int = 2;
pub const F_UNLCK: c_int = 3;
pub const SFD_NONBLOCK: c_int = 0x4000;
pub const TCSANOW: c_int = 0;
pub const TCSADRAIN: c_int = 1;
pub const TCSAFLUSH: c_int = 2;
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;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
pub const O_DIRECTORY: c_int = 0o200000;
pub const O_NOFOLLOW: c_int = 0o400000;
pub const O_DIRECT: c_int = 0x100000;
pub const MAP_LOCKED: c_int = 0x0100;
pub const MAP_NORESERVE: c_int = 0x00040;
pub const EDEADLOCK: c_int = 108;
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 MCL_CURRENT: c_int = 0x2000;
pub const MCL_FUTURE: c_int = 0x4000;
pub const MCL_ONFAULT: c_int = 0x8000;
pub const SIGSTKSZ: size_t = 16384;
pub const MINSIGSTKSZ: size_t = 4096;
pub const CBAUD: crate::tcflag_t = 0x0000100f;
pub const TAB1: crate::tcflag_t = 0x800;
pub const TAB2: crate::tcflag_t = 0x1000;
pub const TAB3: crate::tcflag_t = 0x1800;
pub const CR1: crate::tcflag_t = 0x200;
pub const CR2: crate::tcflag_t = 0x400;
pub const CR3: crate::tcflag_t = 0x600;
pub const FF1: crate::tcflag_t = 0x8000;
pub const BS1: crate::tcflag_t = 0x2000;
pub const VT1: crate::tcflag_t = 0x4000;
pub const VWERASE: usize = 0xe;
pub const VREPRINT: usize = 0xc;
pub const VSUSP: usize = 0xa;
pub const VSTART: usize = 0x8;
pub const VSTOP: usize = 0x9;
pub const VDISCARD: usize = 0xd;
pub const VTIME: usize = 0x5;
pub const IXON: crate::tcflag_t = 0x400;
pub const IXOFF: crate::tcflag_t = 0x1000;
pub const ONLCR: crate::tcflag_t = 0x4;
pub const CSIZE: crate::tcflag_t = 0x30;
pub const CS6: crate::tcflag_t = 0x10;
pub const CS7: crate::tcflag_t = 0x20;
pub const CS8: crate::tcflag_t = 0x30;
pub const CSTOPB: crate::tcflag_t = 0x40;
pub const CREAD: crate::tcflag_t = 0x80;
pub const PARENB: crate::tcflag_t = 0x100;
pub const PARODD: crate::tcflag_t = 0x200;
pub const HUPCL: crate::tcflag_t = 0x400;
pub const CLOCAL: crate::tcflag_t = 0x800;
pub const ECHOKE: crate::tcflag_t = 0x800;
pub const ECHOE: crate::tcflag_t = 0x10;
pub const ECHOK: crate::tcflag_t = 0x20;
pub const ECHONL: crate::tcflag_t = 0x40;
pub const ECHOPRT: crate::tcflag_t = 0x400;
pub const ECHOCTL: crate::tcflag_t = 0x200;
pub const ISIG: crate::tcflag_t = 0x1;
pub const ICANON: crate::tcflag_t = 0x2;
pub const PENDIN: crate::tcflag_t = 0x4000;
pub const NOFLSH: crate::tcflag_t = 0x80;
pub const CIBAUD: crate::tcflag_t = 0o02003600000;
pub const CBAUDEX: crate::tcflag_t = 0x00001000;
pub const VSWTC: usize = 7;
pub const OLCUC: crate::tcflag_t = 0o000002;
pub const NLDLY: crate::tcflag_t = 0o000400;
pub const CRDLY: crate::tcflag_t = 0o003000;
pub const TABDLY: crate::tcflag_t = 0o014000;
pub const BSDLY: crate::tcflag_t = 0o020000;
pub const FFDLY: crate::tcflag_t = 0o100000;
pub const VTDLY: crate::tcflag_t = 0o040000;
pub const XTABS: crate::tcflag_t = 0o014000;
pub const B0: crate::speed_t = 0o000000;
pub const B50: crate::speed_t = 0o000001;
pub const B75: crate::speed_t = 0o000002;
pub const B110: crate::speed_t = 0o000003;
pub const B134: crate::speed_t = 0o000004;
pub const B150: crate::speed_t = 0o000005;
pub const B200: crate::speed_t = 0o000006;
pub const B300: crate::speed_t = 0o000007;
pub const B600: crate::speed_t = 0o000010;
pub const B1200: crate::speed_t = 0o000011;
pub const B1800: crate::speed_t = 0o000012;
pub const B2400: crate::speed_t = 0o000013;
pub const B4800: crate::speed_t = 0o000014;
pub const B9600: crate::speed_t = 0o000015;
pub const B19200: crate::speed_t = 0o000016;
pub const B38400: crate::speed_t = 0o000017;
pub const EXTA: crate::speed_t = B19200;
pub const EXTB: crate::speed_t = B38400;
pub const B57600: crate::speed_t = 0x1001;
pub const B115200: crate::speed_t = 0x1002;
pub const B230400: crate::speed_t = 0x1003;
pub const B460800: crate::speed_t = 0x1004;
pub const B76800: crate::speed_t = 0x1005;
pub const B153600: crate::speed_t = 0x1006;
pub const B307200: crate::speed_t = 0x1007;
pub const B614400: crate::speed_t = 0x1008;
pub const B921600: crate::speed_t = 0x1009;
pub const B500000: crate::speed_t = 0x100a;
pub const B576000: crate::speed_t = 0x100b;
pub const B1000000: crate::speed_t = 0x100c;
pub const B1152000: crate::speed_t = 0x100d;
pub const B1500000: crate::speed_t = 0x100e;
pub const B2000000: crate::speed_t = 0x100f;
pub const VEOL: usize = 5;
pub const VEOL2: usize = 6;
pub const VMIN: usize = 4;
pub const IEXTEN: crate::tcflag_t = 0x8000;
pub const TOSTOP: crate::tcflag_t = 0x100;
pub const FLUSHO: crate::tcflag_t = 0x1000;
pub const EXTPROC: crate::tcflag_t = 0x10000;
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_wait4: 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_execv: c_long = 11;
pub const SYS_chdir: c_long = 12;
pub const SYS_chown: 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_brk: c_long = 17;
pub const SYS_perfctr: c_long = 18;
pub const SYS_lseek: c_long = 19;
pub const SYS_getpid: c_long = 20;
pub const SYS_capget: c_long = 21;
pub const SYS_capset: c_long = 22;
pub const SYS_setuid: c_long = 23;
pub const SYS_getuid: c_long = 24;
pub const SYS_vmsplice: c_long = 25;
pub const SYS_ptrace: c_long = 26;
pub const SYS_alarm: c_long = 27;
pub const SYS_sigaltstack: c_long = 28;
pub const SYS_pause: c_long = 29;
pub const SYS_utime: 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_stat: c_long = 38;
pub const SYS_sendfile: c_long = 39;
pub const SYS_lstat: 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_umount2: 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_memory_ordering: c_long = 52;
pub const SYS_ioctl: c_long = 54;
pub const SYS_reboot: c_long = 55;
pub const SYS_symlink: c_long = 57;
pub const SYS_readlink: c_long = 58;
pub const SYS_execve: c_long = 59;
pub const SYS_umask: c_long = 60;
pub const SYS_chroot: c_long = 61;
pub const SYS_fstat: c_long = 62;
pub const SYS_fstat64: c_long = 63;
pub const SYS_getpagesize: c_long = 64;
pub const SYS_msync: c_long = 65;
pub const SYS_vfork: c_long = 66;
pub const SYS_pread64: c_long = 67;
pub const SYS_pwrite64: c_long = 68;
pub const SYS_mmap: c_long = 71;
pub const SYS_munmap: c_long = 73;
pub const SYS_mprotect: c_long = 74;
pub const SYS_madvise: c_long = 75;
pub const SYS_vhangup: c_long = 76;
pub const SYS_mincore: c_long = 78;
pub const SYS_getgroups: c_long = 79;
pub const SYS_setgroups: c_long = 80;
pub const SYS_getpgrp: c_long = 81;
pub const SYS_setitimer: c_long = 83;
pub const SYS_swapon: c_long = 85;
pub const SYS_getitimer: c_long = 86;
pub const SYS_sethostname: c_long = 88;
pub const SYS_dup2: c_long = 90;
pub const SYS_fcntl: c_long = 92;
pub const SYS_select: c_long = 93;
pub const SYS_fsync: c_long = 95;
pub const SYS_setpriority: c_long = 96;
pub const SYS_socket: c_long = 97;
pub const SYS_connect: c_long = 98;
pub const SYS_accept: c_long = 99;
pub const SYS_getpriority: c_long = 100;
pub const SYS_rt_sigreturn: c_long = 101;
pub const SYS_rt_sigaction: c_long = 102;
pub const SYS_rt_sigprocmask: c_long = 103;
pub const SYS_rt_sigpending: c_long = 104;
pub const SYS_rt_sigtimedwait: c_long = 105;
pub const SYS_rt_sigqueueinfo: c_long = 106;
pub const SYS_rt_sigsuspend: c_long = 107;
pub const SYS_setresuid: c_long = 108;
pub const SYS_getresuid: c_long = 109;
pub const SYS_setresgid: c_long = 110;
pub const SYS_getresgid: c_long = 111;
pub const SYS_recvmsg: c_long = 113;
pub const SYS_sendmsg: c_long = 114;
pub const SYS_gettimeofday: c_long = 116;
pub const SYS_getrusage: c_long = 117;
pub const SYS_getsockopt: c_long = 118;
pub const SYS_getcwd: c_long = 119;
pub const SYS_readv: c_long = 120;
pub const SYS_writev: c_long = 121;
pub const SYS_settimeofday: c_long = 122;
pub const SYS_fchown: c_long = 123;
pub const SYS_fchmod: c_long = 124;
pub const SYS_recvfrom: c_long = 125;
pub const SYS_setreuid: c_long = 126;
pub const SYS_setregid: c_long = 127;
pub const SYS_rename: c_long = 128;
pub const SYS_truncate: c_long = 129;
pub const SYS_ftruncate: c_long = 130;
pub const SYS_flock: c_long = 131;
pub const SYS_lstat64: c_long = 132;
pub const SYS_sendto: c_long = 133;
pub const SYS_shutdown: c_long = 134;
pub const SYS_socketpair: c_long = 135;
pub const SYS_mkdir: c_long = 136;
pub const SYS_rmdir: c_long = 137;
pub const SYS_utimes: c_long = 138;
pub const SYS_stat64: c_long = 139;
pub const SYS_sendfile64: c_long = 140;
pub const SYS_getpeername: c_long = 141;
pub const SYS_futex: c_long = 142;
pub const SYS_gettid: c_long = 143;
pub const SYS_getrlimit: c_long = 144;
pub const SYS_setrlimit: c_long = 145;
pub const SYS_pivot_root: c_long = 146;
pub const SYS_prctl: c_long = 147;
pub const SYS_pciconfig_read: c_long = 148;
pub const SYS_pciconfig_write: c_long = 149;
pub const SYS_getsockname: c_long = 150;
pub const SYS_inotify_init: c_long = 151;
pub const SYS_inotify_add_watch: c_long = 152;
pub const SYS_poll: c_long = 153;
pub const SYS_getdents64: c_long = 154;
pub const SYS_inotify_rm_watch: c_long = 156;
pub const SYS_statfs: c_long = 157;
pub const SYS_fstatfs: c_long = 158;
pub const SYS_umount: c_long = 159;
pub const SYS_sched_set_affinity: c_long = 160;
pub const SYS_sched_get_affinity: c_long = 161;
pub const SYS_getdomainname: c_long = 162;
pub const SYS_setdomainname: c_long = 163;
pub const SYS_utrap_install: c_long = 164;
pub const SYS_quotactl: c_long = 165;
pub const SYS_set_tid_address: c_long = 166;
pub const SYS_mount: c_long = 167;
pub const SYS_ustat: c_long = 168;
pub const SYS_setxattr: c_long = 169;
pub const SYS_lsetxattr: c_long = 170;
pub const SYS_fsetxattr: c_long = 171;
pub const SYS_getxattr: c_long = 172;
pub const SYS_lgetxattr: c_long = 173;
pub const SYS_getdents: c_long = 174;
pub const SYS_setsid: c_long = 175;
pub const SYS_fchdir: c_long = 176;
pub const SYS_fgetxattr: c_long = 177;
pub const SYS_listxattr: c_long = 178;
pub const SYS_llistxattr: c_long = 179;
pub const SYS_flistxattr: c_long = 180;
pub const SYS_removexattr: c_long = 181;
pub const SYS_lremovexattr: c_long = 182;
pub const SYS_sigpending: c_long = 183;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_query_module: c_long = 184;
pub const SYS_setpgid: c_long = 185;
pub const SYS_fremovexattr: c_long = 186;
pub const SYS_tkill: c_long = 187;
pub const SYS_exit_group: c_long = 188;
pub const SYS_uname: c_long = 189;
pub const SYS_init_module: c_long = 190;
pub const SYS_personality: c_long = 191;
pub const SYS_remap_file_pages: c_long = 192;
pub const SYS_epoll_create: c_long = 193;
pub const SYS_epoll_ctl: c_long = 194;
pub const SYS_epoll_wait: c_long = 195;
pub const SYS_ioprio_set: c_long = 196;
pub const SYS_getppid: c_long = 197;
pub const SYS_sigaction: c_long = 198;
pub const SYS_sgetmask: c_long = 199;
pub const SYS_ssetmask: c_long = 200;
pub const SYS_sigsuspend: c_long = 201;
pub const SYS_oldlstat: c_long = 202;
pub const SYS_uselib: c_long = 203;
pub const SYS_readdir: c_long = 204;
pub const SYS_readahead: c_long = 205;
pub const SYS_socketcall: c_long = 206;
pub const SYS_syslog: c_long = 207;
pub const SYS_lookup_dcookie: c_long = 208;
pub const SYS_fadvise64: c_long = 209;
pub const SYS_fadvise64_64: c_long = 210;
pub const SYS_tgkill: c_long = 211;
pub const SYS_waitpid: c_long = 212;
pub const SYS_swapoff: c_long = 213;
pub const SYS_sysinfo: c_long = 214;
pub const SYS_ipc: c_long = 215;
pub const SYS_sigreturn: c_long = 216;
pub const SYS_clone: c_long = 217;
pub const SYS_ioprio_get: c_long = 218;
pub const SYS_adjtimex: c_long = 219;
pub const SYS_sigprocmask: c_long = 220;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 221;
pub const SYS_delete_module: c_long = 222;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_get_kernel_syms: c_long = 223;
pub const SYS_getpgid: c_long = 224;
pub const SYS_bdflush: c_long = 225;
pub const SYS_sysfs: c_long = 226;
pub const SYS_afs_syscall: c_long = 227;
pub const SYS_setfsuid: c_long = 228;
pub const SYS_setfsgid: c_long = 229;
pub const SYS__newselect: c_long = 230;
pub const SYS_splice: c_long = 232;
pub const SYS_stime: c_long = 233;
pub const SYS_statfs64: c_long = 234;
pub const SYS_fstatfs64: c_long = 235;
pub const SYS__llseek: c_long = 236;
pub const SYS_mlock: c_long = 237;
pub const SYS_munlock: c_long = 238;
pub const SYS_mlockall: c_long = 239;
pub const SYS_munlockall: c_long = 240;
pub const SYS_sched_setparam: c_long = 241;
pub const SYS_sched_getparam: c_long = 242;
pub const SYS_sched_setscheduler: c_long = 243;
pub const SYS_sched_getscheduler: c_long = 244;
pub const SYS_sched_yield: c_long = 245;
pub const SYS_sched_get_priority_max: c_long = 246;
pub const SYS_sched_get_priority_min: c_long = 247;
pub const SYS_sched_rr_get_interval: c_long = 248;
pub const SYS_nanosleep: c_long = 249;
pub const SYS_mremap: c_long = 250;
pub const SYS__sysctl: c_long = 251;
pub const SYS_getsid: c_long = 252;
pub const SYS_fdatasync: c_long = 253;
pub const SYS_nfsservctl: c_long = 254;
pub const SYS_sync_file_range: c_long = 255;
pub const SYS_clock_settime: c_long = 256;
pub const SYS_clock_gettime: c_long = 257;
pub const SYS_clock_getres: c_long = 258;
pub const SYS_clock_nanosleep: c_long = 259;
pub const SYS_sched_getaffinity: c_long = 260;
pub const SYS_sched_setaffinity: c_long = 261;
pub const SYS_timer_settime: c_long = 262;
pub const SYS_timer_gettime: c_long = 263;
pub const SYS_timer_getoverrun: c_long = 264;
pub const SYS_timer_delete: c_long = 265;
pub const SYS_timer_create: c_long = 266;
pub const SYS_io_setup: c_long = 268;
pub const SYS_io_destroy: c_long = 269;
pub const SYS_io_submit: c_long = 270;
pub const SYS_io_cancel: c_long = 271;
pub const SYS_io_getevents: c_long = 272;
pub const SYS_mq_open: c_long = 273;
pub const SYS_mq_unlink: c_long = 274;
pub const SYS_mq_timedsend: c_long = 275;
pub const SYS_mq_timedreceive: c_long = 276;
pub const SYS_mq_notify: c_long = 277;
pub const SYS_mq_getsetattr: c_long = 278;
pub const SYS_waitid: c_long = 279;
pub const SYS_tee: c_long = 280;
pub const SYS_add_key: c_long = 281;
pub const SYS_request_key: c_long = 282;
pub const SYS_keyctl: c_long = 283;
pub const SYS_openat: c_long = 284;
pub const SYS_mkdirat: c_long = 285;
pub const SYS_mknodat: c_long = 286;
pub const SYS_fchownat: c_long = 287;
pub const SYS_futimesat: c_long = 288;
pub const SYS_fstatat64: c_long = 289;
pub const SYS_unlinkat: c_long = 290;
pub const SYS_renameat: c_long = 291;
pub const SYS_linkat: c_long = 292;
pub const SYS_symlinkat: c_long = 293;
pub const SYS_readlinkat: c_long = 294;
pub const SYS_fchmodat: c_long = 295;
pub const SYS_faccessat: c_long = 296;
pub const SYS_pselect6: c_long = 297;
pub const SYS_ppoll: c_long = 298;
pub const SYS_unshare: c_long = 299;
pub const SYS_set_robust_list: c_long = 300;
pub const SYS_get_robust_list: c_long = 301;
pub const SYS_migrate_pages: c_long = 302;
pub const SYS_mbind: c_long = 303;
pub const SYS_get_mempolicy: c_long = 304;
pub const SYS_set_mempolicy: c_long = 305;
pub const SYS_kexec_load: c_long = 306;
pub const SYS_move_pages: c_long = 307;
pub const SYS_getcpu: c_long = 308;
pub const SYS_epoll_pwait: c_long = 309;
pub const SYS_utimensat: c_long = 310;
pub const SYS_signalfd: c_long = 311;
pub const SYS_timerfd_create: c_long = 312;
pub const SYS_eventfd: c_long = 313;
pub const SYS_fallocate: c_long = 314;
pub const SYS_timerfd_settime: c_long = 315;
pub const SYS_timerfd_gettime: c_long = 316;
pub const SYS_signalfd4: c_long = 317;
pub const SYS_eventfd2: c_long = 318;
pub const SYS_epoll_create1: c_long = 319;
pub const SYS_dup3: c_long = 320;
pub const SYS_pipe2: c_long = 321;
pub const SYS_inotify_init1: c_long = 322;
pub const SYS_accept4: c_long = 323;
pub const SYS_preadv: c_long = 324;
pub const SYS_pwritev: c_long = 325;
pub const SYS_rt_tgsigqueueinfo: c_long = 326;
pub const SYS_perf_event_open: c_long = 327;
pub const SYS_recvmmsg: c_long = 328;
pub const SYS_fanotify_init: c_long = 329;
pub const SYS_fanotify_mark: c_long = 330;
pub const SYS_prlimit64: c_long = 331;
pub const SYS_name_to_handle_at: c_long = 332;
pub const SYS_open_by_handle_at: c_long = 333;
pub const SYS_clock_adjtime: c_long = 334;
pub const SYS_syncfs: c_long = 335;
pub const SYS_sendmmsg: c_long = 336;
pub const SYS_setns: c_long = 337;
pub const SYS_process_vm_readv: c_long = 338;
pub const SYS_process_vm_writev: c_long = 339;
pub const SYS_kern_features: c_long = 340;
pub const SYS_kcmp: c_long = 341;
pub const SYS_finit_module: c_long = 342;
pub const SYS_sched_setattr: c_long = 343;
pub const SYS_sched_getattr: c_long = 344;
pub const SYS_renameat2: c_long = 345;
pub const SYS_seccomp: c_long = 346;
pub const SYS_getrandom: c_long = 347;
pub const SYS_memfd_create: c_long = 348;
pub const SYS_bpf: c_long = 349;
pub const SYS_execveat: c_long = 350;
pub const SYS_membarrier: c_long = 351;
pub const SYS_userfaultfd: c_long = 352;
pub const SYS_bind: c_long = 353;
pub const SYS_listen: c_long = 354;
pub const SYS_setsockopt: c_long = 355;
pub const SYS_mlock2: c_long = 356;
pub const SYS_copy_file_range: c_long = 357;
pub const SYS_preadv2: c_long = 358;
pub const SYS_pwritev2: c_long = 359;
pub const SYS_statx: c_long = 360;
pub const SYS_rseq: c_long = 365;
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;
// Reserved in the kernel, but not actually implemented yet
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;
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;
}
@@ -0,0 +1,809 @@
//! x86_64-specific definitions for 64-bit linux-like values
use crate::prelude::*;
use crate::{off64_t, off_t};
pub type wchar_t = i32;
pub type nlink_t = u64;
pub type blksize_t = i64;
pub type greg_t = i64;
pub type suseconds_t = i64;
pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;
s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
#[cfg(target_arch = "sparc64")]
__reserved0: c_int,
pub sa_flags: c_int,
pub sa_restorer: Option<extern "C" fn()>,
}
pub struct statfs {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__fsword_t,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_fsid: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
f_spare: [crate::__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: crate::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: crate::pid_t,
}
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: [u64; 0],
}
pub struct stack_t {
pub ss_sp: *mut c_void,
pub ss_flags: c_int,
pub ss_size: size_t,
}
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_nlink: crate::nlink_t,
pub st_mode: crate::mode_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
__pad0: c_int,
pub st_rdev: crate::dev_t,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: i64,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: i64,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: i64,
__unused: [i64; 3],
}
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino64_t,
pub st_nlink: crate::nlink_t,
pub st_mode: crate::mode_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
__pad0: c_int,
pub st_rdev: crate::dev_t,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt64_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: i64,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: i64,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: i64,
__reserved: [i64; 3],
}
pub struct statfs64 {
pub f_type: crate::__fsword_t,
pub f_bsize: crate::__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: crate::fsid_t,
pub f_namelen: crate::__fsword_t,
pub f_frsize: crate::__fsword_t,
pub f_flags: crate::__fsword_t,
pub f_spare: [crate::__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,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
__f_spare: [c_int; 6],
}
pub struct pthread_attr_t {
#[cfg(target_pointer_width = "32")]
__size: [u32; 8],
#[cfg(target_pointer_width = "64")]
__size: [u64; 7],
}
pub struct _libc_fpxreg {
pub significand: [u16; 4],
pub exponent: u16,
__private: [u16; 3],
}
pub struct _libc_xmmreg {
pub element: [u32; 4],
}
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: [u64; 12],
}
pub struct user_regs_struct {
pub r15: c_ulonglong,
pub r14: c_ulonglong,
pub r13: c_ulonglong,
pub r12: c_ulonglong,
pub rbp: c_ulonglong,
pub rbx: c_ulonglong,
pub r11: c_ulonglong,
pub r10: c_ulonglong,
pub r9: c_ulonglong,
pub r8: c_ulonglong,
pub rax: c_ulonglong,
pub rcx: c_ulonglong,
pub rdx: c_ulonglong,
pub rsi: c_ulonglong,
pub rdi: c_ulonglong,
pub orig_rax: c_ulonglong,
pub rip: c_ulonglong,
pub cs: c_ulonglong,
pub eflags: c_ulonglong,
pub rsp: c_ulonglong,
pub ss: c_ulonglong,
pub fs_base: c_ulonglong,
pub gs_base: c_ulonglong,
pub ds: c_ulonglong,
pub es: c_ulonglong,
pub fs: c_ulonglong,
pub gs: c_ulonglong,
}
pub struct user {
pub regs: user_regs_struct,
pub u_fpvalid: c_int,
pub i387: user_fpregs_struct,
pub u_tsize: c_ulonglong,
pub u_dsize: c_ulonglong,
pub u_ssize: c_ulonglong,
pub start_code: c_ulonglong,
pub start_stack: c_ulonglong,
pub signal: c_longlong,
__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_ulonglong,
pub u_comm: [c_char; 32],
pub u_debugreg: [c_ulonglong; 8],
}
pub struct mcontext_t {
pub gregs: [greg_t; 23],
pub fpregs: *mut _libc_fpstate,
__private: [u64; 8],
}
pub struct ipc_perm {
pub __key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::gid_t,
pub mode: c_ushort,
__pad1: c_ushort,
pub __seq: c_ushort,
__pad2: c_ushort,
__unused1: u64,
__unused2: u64,
}
pub struct shmid_ds {
pub shm_perm: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_atime: crate::time_t,
pub shm_dtime: crate::time_t,
pub shm_ctime: crate::time_t,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: crate::shmatt_t,
__unused4: u64,
__unused5: u64,
}
pub struct ptrace_rseq_configuration {
pub rseq_abi_pointer: crate::__u64,
pub rseq_abi_size: crate::__u32,
pub signature: crate::__u32,
pub flags: crate::__u32,
pub pad: crate::__u32,
}
#[repr(align(8))]
pub struct clone_args {
pub flags: c_ulonglong,
pub pidfd: c_ulonglong,
pub child_tid: c_ulonglong,
pub parent_tid: c_ulonglong,
pub exit_signal: c_ulonglong,
pub stack: c_ulonglong,
pub stack_size: c_ulonglong,
pub tls: c_ulonglong,
pub set_tid: c_ulonglong,
pub set_tid_size: c_ulonglong,
pub cgroup: c_ulonglong,
}
}
s_no_extra_traits! {
pub struct user_fpregs_struct {
pub cwd: c_ushort,
pub swd: c_ushort,
pub ftw: c_ushort,
pub fop: c_ushort,
pub rip: c_ulonglong,
pub rdp: c_ulonglong,
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],
}
pub struct ucontext_t {
pub uc_flags: c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: crate::stack_t,
pub uc_mcontext: mcontext_t,
pub uc_sigmask: crate::sigset_t,
__private: [u8; 512],
// FIXME(glibc): the shadow stack field requires glibc >= 2.28.
// Re-add once we drop compatibility with glibc versions older than
// 2.28.
//
// __ssp: [c_ulonglong; 4],
}
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 4],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
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 hash::Hash for user_fpregs_struct {
fn hash<H: hash::Hasher>(&self, state: &mut H) {
self.cwd.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
}
}
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
// Ignore __private field
}
}
impl Eq for ucontext_t {}
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);
// Ignore __private field
}
}
}
}
pub const POSIX_FADV_DONTNEED: c_int = 4;
pub const POSIX_FADV_NOREUSE: c_int = 5;
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_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_NOATIME: c_int = 0o1000000;
pub const O_PATH: c_int = 0o10000000;
pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY;
pub const MADV_SOFT_OFFLINE: c_int = 101;
pub const MAP_GROWSDOWN: c_int = 0x0100;
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 SOCK_STREAM: c_int = 1;
pub const SOCK_DGRAM: c_int = 2;
pub const SA_ONSTACK: c_int = 0x08000000;
pub const SA_SIGINFO: c_int = 0x00000004;
pub const SA_NOCLDWAIT: c_int = 0x00000002;
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 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 POLLWRNORM: c_short = 0x100;
pub const POLLWRBAND: c_short = 0x200;
pub const O_ASYNC: c_int = 0x2000;
pub const O_NDELAY: c_int = 0x800;
pub const PTRACE_DETACH: c_uint = 17;
pub const PTRACE_GET_RSEQ_CONFIGURATION: c_uint = 0x420f;
pub const EFD_NONBLOCK: c_int = 0x800;
pub const F_GETLK: c_int = 5;
pub const F_GETOWN: c_int = 9;
pub const F_SETOWN: c_int = 8;
pub const F_SETLK: c_int = 6;
pub const F_SETLKW: c_int = 7;
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 F_RDLCK: c_int = 0;
pub const F_WRLCK: c_int = 1;
pub const F_UNLCK: c_int = 2;
pub const SFD_NONBLOCK: c_int = 0x0800;
pub const TCSANOW: c_int = 0;
pub const TCSADRAIN: c_int = 1;
pub const TCSAFLUSH: 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;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const O_DIRECT: c_int = 0x4000;
pub const O_DIRECTORY: c_int = 0x10000;
pub const O_NOFOLLOW: c_int = 0x20000;
pub const MAP_HUGETLB: c_int = 0x040000;
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_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 PTRACE_GETFPREGS: c_uint = 14;
pub const PTRACE_SETFPREGS: c_uint = 15;
pub const PTRACE_GETFPXREGS: c_uint = 18;
pub const PTRACE_SETFPXREGS: c_uint = 19;
pub const PTRACE_GETREGS: c_uint = 12;
pub const PTRACE_SETREGS: c_uint = 13;
pub const PTRACE_PEEKSIGINFO_SHARED: c_uint = 1;
pub const PTRACE_SYSEMU: c_uint = 31;
pub const PTRACE_SYSEMU_SINGLESTEP: c_uint = 32;
pub const PR_GET_SPECULATION_CTRL: c_int = 52;
pub const PR_SET_SPECULATION_CTRL: c_int = 53;
pub const PR_SPEC_NOT_AFFECTED: c_uint = 0;
pub const PR_SPEC_PRCTL: c_uint = 1 << 0;
pub const PR_SPEC_ENABLE: c_uint = 1 << 1;
pub const PR_SPEC_DISABLE: c_uint = 1 << 2;
pub const PR_SPEC_FORCE_DISABLE: c_uint = 1 << 3;
pub const PR_SPEC_DISABLE_NOEXEC: c_uint = 1 << 4;
pub const PR_SPEC_STORE_BYPASS: c_int = 0;
pub const PR_SPEC_INDIRECT_BRANCH: c_int = 1;
// FIXME(linux): perharps for later
//pub const PR_SPEC_L1D_FLUSH: 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 SIGSTKSZ: size_t = 8192;
pub const MINSIGSTKSZ: size_t = 2048;
pub const CBAUD: crate::tcflag_t = 0o0010017;
pub const TAB1: crate::tcflag_t = 0x00000800;
pub const TAB2: crate::tcflag_t = 0x00001000;
pub const TAB3: crate::tcflag_t = 0x00001800;
pub const CR1: crate::tcflag_t = 0x00000200;
pub const CR2: crate::tcflag_t = 0x00000400;
pub const CR3: crate::tcflag_t = 0x00000600;
pub const FF1: crate::tcflag_t = 0x00008000;
pub const BS1: crate::tcflag_t = 0x00002000;
pub const VT1: crate::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: crate::tcflag_t = 0x00000400;
pub const IXOFF: crate::tcflag_t = 0x00001000;
pub const ONLCR: crate::tcflag_t = 0x4;
pub const CSIZE: crate::tcflag_t = 0x00000030;
pub const CS6: crate::tcflag_t = 0x00000010;
pub const CS7: crate::tcflag_t = 0x00000020;
pub const CS8: crate::tcflag_t = 0x00000030;
pub const CSTOPB: crate::tcflag_t = 0x00000040;
pub const CREAD: crate::tcflag_t = 0x00000080;
pub const PARENB: crate::tcflag_t = 0x00000100;
pub const PARODD: crate::tcflag_t = 0x00000200;
pub const HUPCL: crate::tcflag_t = 0x00000400;
pub const CLOCAL: crate::tcflag_t = 0x00000800;
pub const ECHOKE: crate::tcflag_t = 0x00000800;
pub const ECHOE: crate::tcflag_t = 0x00000010;
pub const ECHOK: crate::tcflag_t = 0x00000020;
pub const ECHONL: crate::tcflag_t = 0x00000040;
pub const ECHOPRT: crate::tcflag_t = 0x00000400;
pub const ECHOCTL: crate::tcflag_t = 0x00000200;
pub const ISIG: crate::tcflag_t = 0x00000001;
pub const ICANON: crate::tcflag_t = 0x00000002;
pub const PENDIN: crate::tcflag_t = 0x00004000;
pub const NOFLSH: crate::tcflag_t = 0x00000080;
pub const CIBAUD: crate::tcflag_t = 0o02003600000;
pub const CBAUDEX: crate::tcflag_t = 0o010000;
pub const VSWTC: usize = 7;
pub const OLCUC: crate::tcflag_t = 0o000002;
pub const NLDLY: crate::tcflag_t = 0o000400;
pub const CRDLY: crate::tcflag_t = 0o003000;
pub const TABDLY: crate::tcflag_t = 0o014000;
pub const BSDLY: crate::tcflag_t = 0o020000;
pub const FFDLY: crate::tcflag_t = 0o100000;
pub const VTDLY: crate::tcflag_t = 0o040000;
pub const XTABS: crate::tcflag_t = 0o014000;
pub const B0: crate::speed_t = 0o000000;
pub const B50: crate::speed_t = 0o000001;
pub const B75: crate::speed_t = 0o000002;
pub const B110: crate::speed_t = 0o000003;
pub const B134: crate::speed_t = 0o000004;
pub const B150: crate::speed_t = 0o000005;
pub const B200: crate::speed_t = 0o000006;
pub const B300: crate::speed_t = 0o000007;
pub const B600: crate::speed_t = 0o000010;
pub const B1200: crate::speed_t = 0o000011;
pub const B1800: crate::speed_t = 0o000012;
pub const B2400: crate::speed_t = 0o000013;
pub const B4800: crate::speed_t = 0o000014;
pub const B9600: crate::speed_t = 0o000015;
pub const B19200: crate::speed_t = 0o000016;
pub const B38400: crate::speed_t = 0o000017;
pub const EXTA: crate::speed_t = B19200;
pub const EXTB: crate::speed_t = B38400;
pub const B57600: crate::speed_t = 0o010001;
pub const B115200: crate::speed_t = 0o010002;
pub const B230400: crate::speed_t = 0o010003;
pub const B460800: crate::speed_t = 0o010004;
pub const B500000: crate::speed_t = 0o010005;
pub const B576000: crate::speed_t = 0o010006;
pub const B921600: crate::speed_t = 0o010007;
pub const B1000000: crate::speed_t = 0o010010;
pub const B1152000: crate::speed_t = 0o010011;
pub const B1500000: crate::speed_t = 0o010012;
pub const B2000000: crate::speed_t = 0o010013;
pub const B2500000: crate::speed_t = 0o010014;
pub const B3000000: crate::speed_t = 0o010015;
pub const B3500000: crate::speed_t = 0o010016;
pub const B4000000: crate::speed_t = 0o010017;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
pub const IEXTEN: crate::tcflag_t = 0x00008000;
pub const TOSTOP: crate::tcflag_t = 0x00000100;
pub const FLUSHO: crate::tcflag_t = 0x00001000;
pub const EXTPROC: crate::tcflag_t = 0x00010000;
// 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;
extern "C" {
pub fn getcontext(ucp: *mut ucontext_t) -> c_int;
pub fn setcontext(ucp: *const ucontext_t) -> c_int;
pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: c_int, ...);
pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> c_int;
}
cfg_if! {
if #[cfg(target_pointer_width = "32")] {
mod x32;
pub use self::x32::*;
} else {
mod not_x32;
pub use self::not_x32::*;
}
}
@@ -0,0 +1,446 @@
use crate::prelude::*;
use crate::pthread_mutex_t;
s! {
pub struct statvfs {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_favail: crate::fsfilcnt_t,
pub f_fsid: c_ulong,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
__f_spare: [c_int; 6],
}
}
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
#[cfg(target_endian = "little")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "little")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
#[cfg(target_endian = "big")]
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
};
// 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;
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;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_create_module: c_long = 174;
pub const SYS_init_module: c_long = 175;
pub const SYS_delete_module: c_long = 176;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
pub const SYS_get_kernel_syms: c_long = 177;
#[deprecated(since = "0.2.70", note = "Functional up to 2.6 kernel")]
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_rseq: c_long = 334;
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_fchmodat2: c_long = 452;
pub const SYS_mseal: c_long = 462;
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;
}
@@ -0,0 +1,398 @@
use crate::prelude::*;
use crate::pthread_mutex_t;
s! {
pub struct statvfs {
pub f_bsize: c_ulong,
pub f_frsize: c_ulong,
pub f_blocks: crate::fsblkcnt_t,
pub f_bfree: crate::fsblkcnt_t,
pub f_bavail: crate::fsblkcnt_t,
pub f_files: crate::fsfilcnt_t,
pub f_ffree: crate::fsfilcnt_t,
pub f_favail: crate::fsfilcnt_t,
pub f_fsid: c_ulong,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
__f_spare: [c_int; 6],
}
}
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 44;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20;
pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0,
],
};
pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0,
],
};
pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t {
size: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0,
],
};
// Syscall table
pub const __X32_SYSCALL_BIT: c_long = 0x40000000;
pub const SYS_read: c_long = __X32_SYSCALL_BIT + 0;
pub const SYS_write: c_long = __X32_SYSCALL_BIT + 1;
pub const SYS_open: c_long = __X32_SYSCALL_BIT + 2;
pub const SYS_close: c_long = __X32_SYSCALL_BIT + 3;
pub const SYS_stat: c_long = __X32_SYSCALL_BIT + 4;
pub const SYS_fstat: c_long = __X32_SYSCALL_BIT + 5;
pub const SYS_lstat: c_long = __X32_SYSCALL_BIT + 6;
pub const SYS_poll: c_long = __X32_SYSCALL_BIT + 7;
pub const SYS_lseek: c_long = __X32_SYSCALL_BIT + 8;
pub const SYS_mmap: c_long = __X32_SYSCALL_BIT + 9;
pub const SYS_mprotect: c_long = __X32_SYSCALL_BIT + 10;
pub const SYS_munmap: c_long = __X32_SYSCALL_BIT + 11;
pub const SYS_brk: c_long = __X32_SYSCALL_BIT + 12;
pub const SYS_rt_sigprocmask: c_long = __X32_SYSCALL_BIT + 14;
pub const SYS_pread64: c_long = __X32_SYSCALL_BIT + 17;
pub const SYS_pwrite64: c_long = __X32_SYSCALL_BIT + 18;
pub const SYS_access: c_long = __X32_SYSCALL_BIT + 21;
pub const SYS_pipe: c_long = __X32_SYSCALL_BIT + 22;
pub const SYS_select: c_long = __X32_SYSCALL_BIT + 23;
pub const SYS_sched_yield: c_long = __X32_SYSCALL_BIT + 24;
pub const SYS_mremap: c_long = __X32_SYSCALL_BIT + 25;
pub const SYS_msync: c_long = __X32_SYSCALL_BIT + 26;
pub const SYS_mincore: c_long = __X32_SYSCALL_BIT + 27;
pub const SYS_madvise: c_long = __X32_SYSCALL_BIT + 28;
pub const SYS_shmget: c_long = __X32_SYSCALL_BIT + 29;
pub const SYS_shmat: c_long = __X32_SYSCALL_BIT + 30;
pub const SYS_shmctl: c_long = __X32_SYSCALL_BIT + 31;
pub const SYS_dup: c_long = __X32_SYSCALL_BIT + 32;
pub const SYS_dup2: c_long = __X32_SYSCALL_BIT + 33;
pub const SYS_pause: c_long = __X32_SYSCALL_BIT + 34;
pub const SYS_nanosleep: c_long = __X32_SYSCALL_BIT + 35;
pub const SYS_getitimer: c_long = __X32_SYSCALL_BIT + 36;
pub const SYS_alarm: c_long = __X32_SYSCALL_BIT + 37;
pub const SYS_setitimer: c_long = __X32_SYSCALL_BIT + 38;
pub const SYS_getpid: c_long = __X32_SYSCALL_BIT + 39;
pub const SYS_sendfile: c_long = __X32_SYSCALL_BIT + 40;
pub const SYS_socket: c_long = __X32_SYSCALL_BIT + 41;
pub const SYS_connect: c_long = __X32_SYSCALL_BIT + 42;
pub const SYS_accept: c_long = __X32_SYSCALL_BIT + 43;
pub const SYS_sendto: c_long = __X32_SYSCALL_BIT + 44;
pub const SYS_shutdown: c_long = __X32_SYSCALL_BIT + 48;
pub const SYS_bind: c_long = __X32_SYSCALL_BIT + 49;
pub const SYS_listen: c_long = __X32_SYSCALL_BIT + 50;
pub const SYS_getsockname: c_long = __X32_SYSCALL_BIT + 51;
pub const SYS_getpeername: c_long = __X32_SYSCALL_BIT + 52;
pub const SYS_socketpair: c_long = __X32_SYSCALL_BIT + 53;
pub const SYS_clone: c_long = __X32_SYSCALL_BIT + 56;
pub const SYS_fork: c_long = __X32_SYSCALL_BIT + 57;
pub const SYS_vfork: c_long = __X32_SYSCALL_BIT + 58;
pub const SYS_exit: c_long = __X32_SYSCALL_BIT + 60;
pub const SYS_wait4: c_long = __X32_SYSCALL_BIT + 61;
pub const SYS_kill: c_long = __X32_SYSCALL_BIT + 62;
pub const SYS_uname: c_long = __X32_SYSCALL_BIT + 63;
pub const SYS_semget: c_long = __X32_SYSCALL_BIT + 64;
pub const SYS_semop: c_long = __X32_SYSCALL_BIT + 65;
pub const SYS_semctl: c_long = __X32_SYSCALL_BIT + 66;
pub const SYS_shmdt: c_long = __X32_SYSCALL_BIT + 67;
pub const SYS_msgget: c_long = __X32_SYSCALL_BIT + 68;
pub const SYS_msgsnd: c_long = __X32_SYSCALL_BIT + 69;
pub const SYS_msgrcv: c_long = __X32_SYSCALL_BIT + 70;
pub const SYS_msgctl: c_long = __X32_SYSCALL_BIT + 71;
pub const SYS_fcntl: c_long = __X32_SYSCALL_BIT + 72;
pub const SYS_flock: c_long = __X32_SYSCALL_BIT + 73;
pub const SYS_fsync: c_long = __X32_SYSCALL_BIT + 74;
pub const SYS_fdatasync: c_long = __X32_SYSCALL_BIT + 75;
pub const SYS_truncate: c_long = __X32_SYSCALL_BIT + 76;
pub const SYS_ftruncate: c_long = __X32_SYSCALL_BIT + 77;
pub const SYS_getdents: c_long = __X32_SYSCALL_BIT + 78;
pub const SYS_getcwd: c_long = __X32_SYSCALL_BIT + 79;
pub const SYS_chdir: c_long = __X32_SYSCALL_BIT + 80;
pub const SYS_fchdir: c_long = __X32_SYSCALL_BIT + 81;
pub const SYS_rename: c_long = __X32_SYSCALL_BIT + 82;
pub const SYS_mkdir: c_long = __X32_SYSCALL_BIT + 83;
pub const SYS_rmdir: c_long = __X32_SYSCALL_BIT + 84;
pub const SYS_creat: c_long = __X32_SYSCALL_BIT + 85;
pub const SYS_link: c_long = __X32_SYSCALL_BIT + 86;
pub const SYS_unlink: c_long = __X32_SYSCALL_BIT + 87;
pub const SYS_symlink: c_long = __X32_SYSCALL_BIT + 88;
pub const SYS_readlink: c_long = __X32_SYSCALL_BIT + 89;
pub const SYS_chmod: c_long = __X32_SYSCALL_BIT + 90;
pub const SYS_fchmod: c_long = __X32_SYSCALL_BIT + 91;
pub const SYS_chown: c_long = __X32_SYSCALL_BIT + 92;
pub const SYS_fchown: c_long = __X32_SYSCALL_BIT + 93;
pub const SYS_lchown: c_long = __X32_SYSCALL_BIT + 94;
pub const SYS_umask: c_long = __X32_SYSCALL_BIT + 95;
pub const SYS_gettimeofday: c_long = __X32_SYSCALL_BIT + 96;
pub const SYS_getrlimit: c_long = __X32_SYSCALL_BIT + 97;
pub const SYS_getrusage: c_long = __X32_SYSCALL_BIT + 98;
pub const SYS_sysinfo: c_long = __X32_SYSCALL_BIT + 99;
pub const SYS_times: c_long = __X32_SYSCALL_BIT + 100;
pub const SYS_getuid: c_long = __X32_SYSCALL_BIT + 102;
pub const SYS_syslog: c_long = __X32_SYSCALL_BIT + 103;
pub const SYS_getgid: c_long = __X32_SYSCALL_BIT + 104;
pub const SYS_setuid: c_long = __X32_SYSCALL_BIT + 105;
pub const SYS_setgid: c_long = __X32_SYSCALL_BIT + 106;
pub const SYS_geteuid: c_long = __X32_SYSCALL_BIT + 107;
pub const SYS_getegid: c_long = __X32_SYSCALL_BIT + 108;
pub const SYS_setpgid: c_long = __X32_SYSCALL_BIT + 109;
pub const SYS_getppid: c_long = __X32_SYSCALL_BIT + 110;
pub const SYS_getpgrp: c_long = __X32_SYSCALL_BIT + 111;
pub const SYS_setsid: c_long = __X32_SYSCALL_BIT + 112;
pub const SYS_setreuid: c_long = __X32_SYSCALL_BIT + 113;
pub const SYS_setregid: c_long = __X32_SYSCALL_BIT + 114;
pub const SYS_getgroups: c_long = __X32_SYSCALL_BIT + 115;
pub const SYS_setgroups: c_long = __X32_SYSCALL_BIT + 116;
pub const SYS_setresuid: c_long = __X32_SYSCALL_BIT + 117;
pub const SYS_getresuid: c_long = __X32_SYSCALL_BIT + 118;
pub const SYS_setresgid: c_long = __X32_SYSCALL_BIT + 119;
pub const SYS_getresgid: c_long = __X32_SYSCALL_BIT + 120;
pub const SYS_getpgid: c_long = __X32_SYSCALL_BIT + 121;
pub const SYS_setfsuid: c_long = __X32_SYSCALL_BIT + 122;
pub const SYS_setfsgid: c_long = __X32_SYSCALL_BIT + 123;
pub const SYS_getsid: c_long = __X32_SYSCALL_BIT + 124;
pub const SYS_capget: c_long = __X32_SYSCALL_BIT + 125;
pub const SYS_capset: c_long = __X32_SYSCALL_BIT + 126;
pub const SYS_rt_sigsuspend: c_long = __X32_SYSCALL_BIT + 130;
pub const SYS_utime: c_long = __X32_SYSCALL_BIT + 132;
pub const SYS_mknod: c_long = __X32_SYSCALL_BIT + 133;
pub const SYS_personality: c_long = __X32_SYSCALL_BIT + 135;
pub const SYS_ustat: c_long = __X32_SYSCALL_BIT + 136;
pub const SYS_statfs: c_long = __X32_SYSCALL_BIT + 137;
pub const SYS_fstatfs: c_long = __X32_SYSCALL_BIT + 138;
pub const SYS_sysfs: c_long = __X32_SYSCALL_BIT + 139;
pub const SYS_getpriority: c_long = __X32_SYSCALL_BIT + 140;
pub const SYS_setpriority: c_long = __X32_SYSCALL_BIT + 141;
pub const SYS_sched_setparam: c_long = __X32_SYSCALL_BIT + 142;
pub const SYS_sched_getparam: c_long = __X32_SYSCALL_BIT + 143;
pub const SYS_sched_setscheduler: c_long = __X32_SYSCALL_BIT + 144;
pub const SYS_sched_getscheduler: c_long = __X32_SYSCALL_BIT + 145;
pub const SYS_sched_get_priority_max: c_long = __X32_SYSCALL_BIT + 146;
pub const SYS_sched_get_priority_min: c_long = __X32_SYSCALL_BIT + 147;
pub const SYS_sched_rr_get_interval: c_long = __X32_SYSCALL_BIT + 148;
pub const SYS_mlock: c_long = __X32_SYSCALL_BIT + 149;
pub const SYS_munlock: c_long = __X32_SYSCALL_BIT + 150;
pub const SYS_mlockall: c_long = __X32_SYSCALL_BIT + 151;
pub const SYS_munlockall: c_long = __X32_SYSCALL_BIT + 152;
pub const SYS_vhangup: c_long = __X32_SYSCALL_BIT + 153;
pub const SYS_modify_ldt: c_long = __X32_SYSCALL_BIT + 154;
pub const SYS_pivot_root: c_long = __X32_SYSCALL_BIT + 155;
pub const SYS_prctl: c_long = __X32_SYSCALL_BIT + 157;
pub const SYS_arch_prctl: c_long = __X32_SYSCALL_BIT + 158;
pub const SYS_adjtimex: c_long = __X32_SYSCALL_BIT + 159;
pub const SYS_setrlimit: c_long = __X32_SYSCALL_BIT + 160;
pub const SYS_chroot: c_long = __X32_SYSCALL_BIT + 161;
pub const SYS_sync: c_long = __X32_SYSCALL_BIT + 162;
pub const SYS_acct: c_long = __X32_SYSCALL_BIT + 163;
pub const SYS_settimeofday: c_long = __X32_SYSCALL_BIT + 164;
pub const SYS_mount: c_long = __X32_SYSCALL_BIT + 165;
pub const SYS_umount2: c_long = __X32_SYSCALL_BIT + 166;
pub const SYS_swapon: c_long = __X32_SYSCALL_BIT + 167;
pub const SYS_swapoff: c_long = __X32_SYSCALL_BIT + 168;
pub const SYS_reboot: c_long = __X32_SYSCALL_BIT + 169;
pub const SYS_sethostname: c_long = __X32_SYSCALL_BIT + 170;
pub const SYS_setdomainname: c_long = __X32_SYSCALL_BIT + 171;
pub const SYS_iopl: c_long = __X32_SYSCALL_BIT + 172;
pub const SYS_ioperm: c_long = __X32_SYSCALL_BIT + 173;
pub const SYS_init_module: c_long = __X32_SYSCALL_BIT + 175;
pub const SYS_delete_module: c_long = __X32_SYSCALL_BIT + 176;
pub const SYS_quotactl: c_long = __X32_SYSCALL_BIT + 179;
pub const SYS_getpmsg: c_long = __X32_SYSCALL_BIT + 181;
pub const SYS_putpmsg: c_long = __X32_SYSCALL_BIT + 182;
pub const SYS_afs_syscall: c_long = __X32_SYSCALL_BIT + 183;
pub const SYS_tuxcall: c_long = __X32_SYSCALL_BIT + 184;
pub const SYS_security: c_long = __X32_SYSCALL_BIT + 185;
pub const SYS_gettid: c_long = __X32_SYSCALL_BIT + 186;
pub const SYS_readahead: c_long = __X32_SYSCALL_BIT + 187;
pub const SYS_setxattr: c_long = __X32_SYSCALL_BIT + 188;
pub const SYS_lsetxattr: c_long = __X32_SYSCALL_BIT + 189;
pub const SYS_fsetxattr: c_long = __X32_SYSCALL_BIT + 190;
pub const SYS_getxattr: c_long = __X32_SYSCALL_BIT + 191;
pub const SYS_lgetxattr: c_long = __X32_SYSCALL_BIT + 192;
pub const SYS_fgetxattr: c_long = __X32_SYSCALL_BIT + 193;
pub const SYS_listxattr: c_long = __X32_SYSCALL_BIT + 194;
pub const SYS_llistxattr: c_long = __X32_SYSCALL_BIT + 195;
pub const SYS_flistxattr: c_long = __X32_SYSCALL_BIT + 196;
pub const SYS_removexattr: c_long = __X32_SYSCALL_BIT + 197;
pub const SYS_lremovexattr: c_long = __X32_SYSCALL_BIT + 198;
pub const SYS_fremovexattr: c_long = __X32_SYSCALL_BIT + 199;
pub const SYS_tkill: c_long = __X32_SYSCALL_BIT + 200;
pub const SYS_time: c_long = __X32_SYSCALL_BIT + 201;
pub const SYS_futex: c_long = __X32_SYSCALL_BIT + 202;
pub const SYS_sched_setaffinity: c_long = __X32_SYSCALL_BIT + 203;
pub const SYS_sched_getaffinity: c_long = __X32_SYSCALL_BIT + 204;
pub const SYS_io_destroy: c_long = __X32_SYSCALL_BIT + 207;
pub const SYS_io_getevents: c_long = __X32_SYSCALL_BIT + 208;
pub const SYS_io_cancel: c_long = __X32_SYSCALL_BIT + 210;
pub const SYS_lookup_dcookie: c_long = __X32_SYSCALL_BIT + 212;
pub const SYS_epoll_create: c_long = __X32_SYSCALL_BIT + 213;
pub const SYS_remap_file_pages: c_long = __X32_SYSCALL_BIT + 216;
pub const SYS_getdents64: c_long = __X32_SYSCALL_BIT + 217;
pub const SYS_set_tid_address: c_long = __X32_SYSCALL_BIT + 218;
pub const SYS_restart_syscall: c_long = __X32_SYSCALL_BIT + 219;
pub const SYS_semtimedop: c_long = __X32_SYSCALL_BIT + 220;
pub const SYS_fadvise64: c_long = __X32_SYSCALL_BIT + 221;
pub const SYS_timer_settime: c_long = __X32_SYSCALL_BIT + 223;
pub const SYS_timer_gettime: c_long = __X32_SYSCALL_BIT + 224;
pub const SYS_timer_getoverrun: c_long = __X32_SYSCALL_BIT + 225;
pub const SYS_timer_delete: c_long = __X32_SYSCALL_BIT + 226;
pub const SYS_clock_settime: c_long = __X32_SYSCALL_BIT + 227;
pub const SYS_clock_gettime: c_long = __X32_SYSCALL_BIT + 228;
pub const SYS_clock_getres: c_long = __X32_SYSCALL_BIT + 229;
pub const SYS_clock_nanosleep: c_long = __X32_SYSCALL_BIT + 230;
pub const SYS_exit_group: c_long = __X32_SYSCALL_BIT + 231;
pub const SYS_epoll_wait: c_long = __X32_SYSCALL_BIT + 232;
pub const SYS_epoll_ctl: c_long = __X32_SYSCALL_BIT + 233;
pub const SYS_tgkill: c_long = __X32_SYSCALL_BIT + 234;
pub const SYS_utimes: c_long = __X32_SYSCALL_BIT + 235;
pub const SYS_mbind: c_long = __X32_SYSCALL_BIT + 237;
pub const SYS_set_mempolicy: c_long = __X32_SYSCALL_BIT + 238;
pub const SYS_get_mempolicy: c_long = __X32_SYSCALL_BIT + 239;
pub const SYS_mq_open: c_long = __X32_SYSCALL_BIT + 240;
pub const SYS_mq_unlink: c_long = __X32_SYSCALL_BIT + 241;
pub const SYS_mq_timedsend: c_long = __X32_SYSCALL_BIT + 242;
pub const SYS_mq_timedreceive: c_long = __X32_SYSCALL_BIT + 243;
pub const SYS_mq_getsetattr: c_long = __X32_SYSCALL_BIT + 245;
pub const SYS_add_key: c_long = __X32_SYSCALL_BIT + 248;
pub const SYS_request_key: c_long = __X32_SYSCALL_BIT + 249;
pub const SYS_keyctl: c_long = __X32_SYSCALL_BIT + 250;
pub const SYS_ioprio_set: c_long = __X32_SYSCALL_BIT + 251;
pub const SYS_ioprio_get: c_long = __X32_SYSCALL_BIT + 252;
pub const SYS_inotify_init: c_long = __X32_SYSCALL_BIT + 253;
pub const SYS_inotify_add_watch: c_long = __X32_SYSCALL_BIT + 254;
pub const SYS_inotify_rm_watch: c_long = __X32_SYSCALL_BIT + 255;
pub const SYS_migrate_pages: c_long = __X32_SYSCALL_BIT + 256;
pub const SYS_openat: c_long = __X32_SYSCALL_BIT + 257;
pub const SYS_mkdirat: c_long = __X32_SYSCALL_BIT + 258;
pub const SYS_mknodat: c_long = __X32_SYSCALL_BIT + 259;
pub const SYS_fchownat: c_long = __X32_SYSCALL_BIT + 260;
pub const SYS_futimesat: c_long = __X32_SYSCALL_BIT + 261;
pub const SYS_newfstatat: c_long = __X32_SYSCALL_BIT + 262;
pub const SYS_unlinkat: c_long = __X32_SYSCALL_BIT + 263;
pub const SYS_renameat: c_long = __X32_SYSCALL_BIT + 264;
pub const SYS_linkat: c_long = __X32_SYSCALL_BIT + 265;
pub const SYS_symlinkat: c_long = __X32_SYSCALL_BIT + 266;
pub const SYS_readlinkat: c_long = __X32_SYSCALL_BIT + 267;
pub const SYS_fchmodat: c_long = __X32_SYSCALL_BIT + 268;
pub const SYS_faccessat: c_long = __X32_SYSCALL_BIT + 269;
pub const SYS_pselect6: c_long = __X32_SYSCALL_BIT + 270;
pub const SYS_ppoll: c_long = __X32_SYSCALL_BIT + 271;
pub const SYS_unshare: c_long = __X32_SYSCALL_BIT + 272;
pub const SYS_splice: c_long = __X32_SYSCALL_BIT + 275;
pub const SYS_tee: c_long = __X32_SYSCALL_BIT + 276;
pub const SYS_sync_file_range: c_long = __X32_SYSCALL_BIT + 277;
pub const SYS_utimensat: c_long = __X32_SYSCALL_BIT + 280;
pub const SYS_epoll_pwait: c_long = __X32_SYSCALL_BIT + 281;
pub const SYS_signalfd: c_long = __X32_SYSCALL_BIT + 282;
pub const SYS_timerfd_create: c_long = __X32_SYSCALL_BIT + 283;
pub const SYS_eventfd: c_long = __X32_SYSCALL_BIT + 284;
pub const SYS_fallocate: c_long = __X32_SYSCALL_BIT + 285;
pub const SYS_timerfd_settime: c_long = __X32_SYSCALL_BIT + 286;
pub const SYS_timerfd_gettime: c_long = __X32_SYSCALL_BIT + 287;
pub const SYS_accept4: c_long = __X32_SYSCALL_BIT + 288;
pub const SYS_signalfd4: c_long = __X32_SYSCALL_BIT + 289;
pub const SYS_eventfd2: c_long = __X32_SYSCALL_BIT + 290;
pub const SYS_epoll_create1: c_long = __X32_SYSCALL_BIT + 291;
pub const SYS_dup3: c_long = __X32_SYSCALL_BIT + 292;
pub const SYS_pipe2: c_long = __X32_SYSCALL_BIT + 293;
pub const SYS_inotify_init1: c_long = __X32_SYSCALL_BIT + 294;
pub const SYS_perf_event_open: c_long = __X32_SYSCALL_BIT + 298;
pub const SYS_fanotify_init: c_long = __X32_SYSCALL_BIT + 300;
pub const SYS_fanotify_mark: c_long = __X32_SYSCALL_BIT + 301;
pub const SYS_prlimit64: c_long = __X32_SYSCALL_BIT + 302;
pub const SYS_name_to_handle_at: c_long = __X32_SYSCALL_BIT + 303;
pub const SYS_open_by_handle_at: c_long = __X32_SYSCALL_BIT + 304;
pub const SYS_clock_adjtime: c_long = __X32_SYSCALL_BIT + 305;
pub const SYS_syncfs: c_long = __X32_SYSCALL_BIT + 306;
pub const SYS_setns: c_long = __X32_SYSCALL_BIT + 308;
pub const SYS_getcpu: c_long = __X32_SYSCALL_BIT + 309;
pub const SYS_kcmp: c_long = __X32_SYSCALL_BIT + 312;
pub const SYS_finit_module: c_long = __X32_SYSCALL_BIT + 313;
pub const SYS_sched_setattr: c_long = __X32_SYSCALL_BIT + 314;
pub const SYS_sched_getattr: c_long = __X32_SYSCALL_BIT + 315;
pub const SYS_renameat2: c_long = __X32_SYSCALL_BIT + 316;
pub const SYS_seccomp: c_long = __X32_SYSCALL_BIT + 317;
pub const SYS_getrandom: c_long = __X32_SYSCALL_BIT + 318;
pub const SYS_memfd_create: c_long = __X32_SYSCALL_BIT + 319;
pub const SYS_kexec_file_load: c_long = __X32_SYSCALL_BIT + 320;
pub const SYS_bpf: c_long = __X32_SYSCALL_BIT + 321;
pub const SYS_userfaultfd: c_long = __X32_SYSCALL_BIT + 323;
pub const SYS_membarrier: c_long = __X32_SYSCALL_BIT + 324;
pub const SYS_mlock2: c_long = __X32_SYSCALL_BIT + 325;
pub const SYS_copy_file_range: c_long = __X32_SYSCALL_BIT + 326;
pub const SYS_pkey_mprotect: c_long = __X32_SYSCALL_BIT + 329;
pub const SYS_pkey_alloc: c_long = __X32_SYSCALL_BIT + 330;
pub const SYS_pkey_free: c_long = __X32_SYSCALL_BIT + 331;
pub const SYS_statx: c_long = __X32_SYSCALL_BIT + 332;
pub const SYS_rseq: c_long = __X32_SYSCALL_BIT + 334;
pub const SYS_pidfd_send_signal: c_long = __X32_SYSCALL_BIT + 424;
pub const SYS_io_uring_setup: c_long = __X32_SYSCALL_BIT + 425;
pub const SYS_io_uring_enter: c_long = __X32_SYSCALL_BIT + 426;
pub const SYS_io_uring_register: c_long = __X32_SYSCALL_BIT + 427;
pub const SYS_open_tree: c_long = __X32_SYSCALL_BIT + 428;
pub const SYS_move_mount: c_long = __X32_SYSCALL_BIT + 429;
pub const SYS_fsopen: c_long = __X32_SYSCALL_BIT + 430;
pub const SYS_fsconfig: c_long = __X32_SYSCALL_BIT + 431;
pub const SYS_fsmount: c_long = __X32_SYSCALL_BIT + 432;
pub const SYS_fspick: c_long = __X32_SYSCALL_BIT + 433;
pub const SYS_pidfd_open: c_long = __X32_SYSCALL_BIT + 434;
pub const SYS_clone3: c_long = __X32_SYSCALL_BIT + 435;
pub const SYS_close_range: c_long = __X32_SYSCALL_BIT + 436;
pub const SYS_openat2: c_long = __X32_SYSCALL_BIT + 437;
pub const SYS_pidfd_getfd: c_long = __X32_SYSCALL_BIT + 438;
pub const SYS_faccessat2: c_long = __X32_SYSCALL_BIT + 439;
pub const SYS_process_madvise: c_long = __X32_SYSCALL_BIT + 440;
pub const SYS_epoll_pwait2: c_long = __X32_SYSCALL_BIT + 441;
pub const SYS_mount_setattr: c_long = __X32_SYSCALL_BIT + 442;
pub const SYS_quotactl_fd: c_long = __X32_SYSCALL_BIT + 443;
pub const SYS_landlock_create_ruleset: c_long = __X32_SYSCALL_BIT + 444;
pub const SYS_landlock_add_rule: c_long = __X32_SYSCALL_BIT + 445;
pub const SYS_landlock_restrict_self: c_long = __X32_SYSCALL_BIT + 446;
pub const SYS_memfd_secret: c_long = __X32_SYSCALL_BIT + 447;
pub const SYS_process_mrelease: c_long = __X32_SYSCALL_BIT + 448;
pub const SYS_futex_waitv: c_long = __X32_SYSCALL_BIT + 449;
pub const SYS_set_mempolicy_home_node: c_long = __X32_SYSCALL_BIT + 450;
pub const SYS_fchmodat2: c_long = __X32_SYSCALL_BIT + 452;
pub const SYS_rt_sigaction: c_long = __X32_SYSCALL_BIT + 512;
pub const SYS_rt_sigreturn: c_long = __X32_SYSCALL_BIT + 513;
pub const SYS_ioctl: c_long = __X32_SYSCALL_BIT + 514;
pub const SYS_readv: c_long = __X32_SYSCALL_BIT + 515;
pub const SYS_writev: c_long = __X32_SYSCALL_BIT + 516;
pub const SYS_recvfrom: c_long = __X32_SYSCALL_BIT + 517;
pub const SYS_sendmsg: c_long = __X32_SYSCALL_BIT + 518;
pub const SYS_recvmsg: c_long = __X32_SYSCALL_BIT + 519;
pub const SYS_execve: c_long = __X32_SYSCALL_BIT + 520;
pub const SYS_ptrace: c_long = __X32_SYSCALL_BIT + 521;
pub const SYS_rt_sigpending: c_long = __X32_SYSCALL_BIT + 522;
pub const SYS_rt_sigtimedwait: c_long = __X32_SYSCALL_BIT + 523;
pub const SYS_rt_sigqueueinfo: c_long = __X32_SYSCALL_BIT + 524;
pub const SYS_sigaltstack: c_long = __X32_SYSCALL_BIT + 525;
pub const SYS_timer_create: c_long = __X32_SYSCALL_BIT + 526;
pub const SYS_mq_notify: c_long = __X32_SYSCALL_BIT + 527;
pub const SYS_kexec_load: c_long = __X32_SYSCALL_BIT + 528;
pub const SYS_waitid: c_long = __X32_SYSCALL_BIT + 529;
pub const SYS_set_robust_list: c_long = __X32_SYSCALL_BIT + 530;
pub const SYS_get_robust_list: c_long = __X32_SYSCALL_BIT + 531;
pub const SYS_vmsplice: c_long = __X32_SYSCALL_BIT + 532;
pub const SYS_move_pages: c_long = __X32_SYSCALL_BIT + 533;
pub const SYS_preadv: c_long = __X32_SYSCALL_BIT + 534;
pub const SYS_pwritev: c_long = __X32_SYSCALL_BIT + 535;
pub const SYS_rt_tgsigqueueinfo: c_long = __X32_SYSCALL_BIT + 536;
pub const SYS_recvmmsg: c_long = __X32_SYSCALL_BIT + 537;
pub const SYS_sendmmsg: c_long = __X32_SYSCALL_BIT + 538;
pub const SYS_process_vm_readv: c_long = __X32_SYSCALL_BIT + 539;
pub const SYS_process_vm_writev: c_long = __X32_SYSCALL_BIT + 540;
pub const SYS_setsockopt: c_long = __X32_SYSCALL_BIT + 541;
pub const SYS_getsockopt: c_long = __X32_SYSCALL_BIT + 542;
pub const SYS_io_setup: c_long = __X32_SYSCALL_BIT + 543;
pub const SYS_io_submit: c_long = __X32_SYSCALL_BIT + 544;
pub const SYS_execveat: c_long = __X32_SYSCALL_BIT + 545;
pub const SYS_preadv2: c_long = __X32_SYSCALL_BIT + 546;
pub const SYS_pwritev2: c_long = __X32_SYSCALL_BIT + 547;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,792 @@
use crate::off_t;
use crate::prelude::*;
pub type wchar_t = u32;
s! {
pub struct stat {
pub st_dev: crate::dev_t,
__st_dev_padding: c_int,
__st_ino_truncated: c_long,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__st_rdev_padding: c_int,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
pub st_ino: crate::ino_t,
}
pub struct stat64 {
pub st_dev: crate::dev_t,
__st_dev_padding: c_int,
__st_ino_truncated: c_long,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__st_rdev_padding: c_int,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
pub st_mtime: crate::time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: crate::time_t,
pub st_ctime_nsec: c_long,
pub st_ino: crate::ino_t,
}
pub struct stack_t {
pub ss_sp: *mut c_void,
pub ss_flags: c_int,
pub ss_size: size_t,
}
pub struct ipc_perm {
#[cfg(musl_v1_2_3)]
pub __key: crate::key_t,
#[cfg(not(musl_v1_2_3))]
#[deprecated(
since = "0.2.173",
note = "This field is incorrectly named and will be changed
to __key in a future release."
)]
pub __ipc_perm_key: crate::key_t,
pub uid: crate::uid_t,
pub gid: crate::gid_t,
pub cuid: crate::uid_t,
pub cgid: crate::gid_t,
pub mode: crate::mode_t,
pub __seq: c_int,
__unused1: c_long,
__unused2: c_long,
}
pub struct shmid_ds {
pub shm_perm: crate::ipc_perm,
pub shm_segsz: size_t,
pub shm_atime: crate::time_t,
__unused1: c_int,
pub shm_dtime: crate::time_t,
__unused2: c_int,
pub shm_ctime: crate::time_t,
__unused3: c_int,
pub shm_cpid: crate::pid_t,
pub shm_lpid: crate::pid_t,
pub shm_nattch: c_ulong,
__pad1: c_ulong,
__pad2: c_ulong,
}
pub struct msqid_ds {
pub msg_perm: crate::ipc_perm,
pub msg_stime: crate::time_t,
__unused1: c_int,
pub msg_rtime: crate::time_t,
__unused2: c_int,
pub msg_ctime: crate::time_t,
__unused3: c_int,
pub __msg_cbytes: c_ulong,
pub msg_qnum: crate::msgqnum_t,
pub msg_qbytes: crate::msglen_t,
pub msg_lspid: crate::pid_t,
pub msg_lrpid: crate::pid_t,
__pad1: c_ulong,
__pad2: c_ulong,
}
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,
}
}
s_no_extra_traits! {
pub struct ucontext_t {
pub uc_flags: c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: crate::stack_t,
pub uc_mcontext: mcontext_t,
pub uc_sigmask: crate::sigset_t,
pub uc_regspace: [c_ulonglong; 64],
}
#[repr(align(8))]
pub struct max_align_t {
priv_: (i64, i64),
}
}
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 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);
}
}
}
}
pub const SIGSTKSZ: size_t = 8192;
pub const MINSIGSTKSZ: size_t = 2048;
pub const O_DIRECT: c_int = 0x10000;
pub const O_DIRECTORY: c_int = 0x4000;
pub const O_NOFOLLOW: c_int = 0x8000;
pub const O_ASYNC: c_int = 0x2000;
pub const O_LARGEFILE: c_int = 0o400000;
pub const MADV_SOFT_OFFLINE: c_int = 101;
pub const MCL_CURRENT: c_int = 0x0001;
pub const MCL_FUTURE: c_int = 0x0002;
pub const MCL_ONFAULT: c_int = 0x0004;
pub const CBAUD: crate::tcflag_t = 0o0010017;
pub const TAB1: c_int = 0x00000800;
pub const TAB2: c_int = 0x00001000;
pub const TAB3: c_int = 0x00001800;
pub const CR1: c_int = 0x00000200;
pub const CR2: c_int = 0x00000400;
pub const CR3: c_int = 0x00000600;
pub const FF1: c_int = 0x00008000;
pub const BS1: c_int = 0x00002000;
pub const VT1: c_int = 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: crate::tcflag_t = 0x00000400;
pub const IXOFF: crate::tcflag_t = 0x00001000;
pub const ONLCR: crate::tcflag_t = 0x4;
pub const CSIZE: crate::tcflag_t = 0x00000030;
pub const CS6: crate::tcflag_t = 0x00000010;
pub const CS7: crate::tcflag_t = 0x00000020;
pub const CS8: crate::tcflag_t = 0x00000030;
pub const CSTOPB: crate::tcflag_t = 0x00000040;
pub const CREAD: crate::tcflag_t = 0x00000080;
pub const PARENB: crate::tcflag_t = 0x00000100;
pub const PARODD: crate::tcflag_t = 0x00000200;
pub const HUPCL: crate::tcflag_t = 0x00000400;
pub const CLOCAL: crate::tcflag_t = 0x00000800;
pub const ECHOKE: crate::tcflag_t = 0x00000800;
pub const ECHOE: crate::tcflag_t = 0x00000010;
pub const ECHOK: crate::tcflag_t = 0x00000020;
pub const ECHONL: crate::tcflag_t = 0x00000040;
pub const ECHOPRT: crate::tcflag_t = 0x00000400;
pub const ECHOCTL: crate::tcflag_t = 0x00000200;
pub const ISIG: crate::tcflag_t = 0x00000001;
pub const ICANON: crate::tcflag_t = 0x00000002;
pub const PENDIN: crate::tcflag_t = 0x00004000;
pub const NOFLSH: crate::tcflag_t = 0x00000080;
pub const CIBAUD: crate::tcflag_t = 0o02003600000;
pub const CBAUDEX: crate::tcflag_t = 0o010000;
pub const VSWTC: usize = 7;
pub const OLCUC: crate::tcflag_t = 0o000002;
pub const NLDLY: crate::tcflag_t = 0o000400;
pub const CRDLY: crate::tcflag_t = 0o003000;
pub const TABDLY: crate::tcflag_t = 0o014000;
pub const BSDLY: crate::tcflag_t = 0o020000;
pub const FFDLY: crate::tcflag_t = 0o100000;
pub const VTDLY: crate::tcflag_t = 0o040000;
pub const XTABS: crate::tcflag_t = 0o014000;
pub const B57600: crate::speed_t = 0o010001;
pub const B115200: crate::speed_t = 0o010002;
pub const B230400: crate::speed_t = 0o010003;
pub const B460800: crate::speed_t = 0o010004;
pub const B500000: crate::speed_t = 0o010005;
pub const B576000: crate::speed_t = 0o010006;
pub const B921600: crate::speed_t = 0o010007;
pub const B1000000: crate::speed_t = 0o010010;
pub const B1152000: crate::speed_t = 0o010011;
pub const B1500000: crate::speed_t = 0o010012;
pub const B2000000: crate::speed_t = 0o010013;
pub const B2500000: crate::speed_t = 0o010014;
pub const B3000000: crate::speed_t = 0o010015;
pub const B3500000: crate::speed_t = 0o010016;
pub const B4000000: crate::speed_t = 0o010017;
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 MAP_ANON: c_int = 0x0020;
pub const MAP_GROWSDOWN: c_int = 0x0100;
pub const MAP_DENYWRITE: c_int = 0x0800;
pub const MAP_EXECUTABLE: c_int = 0x01000;
pub const MAP_LOCKED: c_int = 0x02000;
pub const MAP_NORESERVE: c_int = 0x04000;
pub const MAP_POPULATE: c_int = 0x08000;
pub const MAP_NONBLOCK: c_int = 0x010000;
pub const MAP_STACK: c_int = 0x020000;
pub const MAP_SYNC: c_int = 0x080000;
pub const SOCK_STREAM: c_int = 1;
pub const SOCK_DGRAM: c_int = 2;
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 EDEADLOCK: c_int = EDEADLK;
pub const EMULTIHOP: c_int = 72;
pub const EBADMSG: c_int = 74;
pub const EOVERFLOW: c_int = 75;
pub const ENOTUNIQ: c_int = 76;
pub const EBADFD: c_int = 77;
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 ENOTSUP: c_int = EOPNOTSUPP;
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 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 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 ERFKILL: c_int = 132;
pub const EHWPOISON: c_int = 133;
pub const SA_ONSTACK: c_int = 0x08000000;
pub const SA_SIGINFO: c_int = 0x00000004;
pub const SA_NOCLDWAIT: c_int = 0x00000002;
pub const SIGCHLD: c_int = 17;
pub const SIGBUS: c_int = 7;
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 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;
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 EXTPROC: crate::tcflag_t = 0x00010000;
pub const MAP_HUGETLB: c_int = 0x040000;
pub const F_GETLK: c_int = 12;
pub const F_GETOWN: c_int = 9;
pub const F_SETLK: c_int = 13;
pub const F_SETLKW: c_int = 14;
pub const F_SETOWN: c_int = 8;
pub const VEOF: usize = 4;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
pub const IEXTEN: crate::tcflag_t = 0x00008000;
pub const TOSTOP: crate::tcflag_t = 0x00000100;
pub const FLUSHO: crate::tcflag_t = 0x00001000;
pub const POLLWRNORM: c_short = 0x100;
pub const POLLWRBAND: c_short = 0x200;
// 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_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_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;
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;

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