use crate::off64_t;
use crate::prelude::*;
pub type blkcnt_t = i64;
pub type blksize_t = i64;
pub type clock_t = i64;
pub type fsblkcnt_t = c_ulong;
pub type fsfilcnt_t = c_ulong;
pub type fsword_t = c_long;
pub type ino_t = c_ulong;
pub type nlink_t = c_uint;
pub type off_t = c_long;
pub type stat64 = stat;
pub type suseconds_t = c_long;
pub type time_t = c_int;
pub type wchar_t = c_int;
pub type pthread_t = c_ulong;
pub type fsblkcnt64_t = u64;
pub type fsfilcnt64_t = u64;
pub type __u64 = c_ulong;
pub type __s64 = c_long;
s! {
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: Padding<c_ushort>,
pub __seq: c_ushort,
__pad2: Padding<c_ushort>,
__unused1: Padding<c_ulong>,
__unused2: Padding<c_ulong>,
}
pub struct pthread_attr_t {
__detachstate: c_int,
__schedpolicy: c_int,
__schedparam: __sched_param,
__inheritsched: c_int,
__scope: c_int,
__guardsize: size_t,
__stackaddr_set: c_int,
__stackaddr: *mut c_void, __stacksize: size_t,
}
pub struct __sched_param {
__sched_priority: c_int,
}
pub struct siginfo_t {
si_signo: c_int, si_errno: c_int, si_code: c_int, pub _pad: [c_int; 28], _align: [usize; 0],
}
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,
__unused1: Padding<c_ulong>,
__unused2: Padding<c_ulong>,
}
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,
__ignored1: c_ulong,
__ignored2: c_ulong,
}
pub struct sockaddr {
pub sa_family: crate::sa_family_t,
pub sa_data: [c_char; 14],
}
pub struct sockaddr_in {
pub sin_family: crate::sa_family_t,
pub sin_port: crate::in_port_t,
pub sin_addr: crate::in_addr,
pub sin_zero: [u8; 8],
}
pub struct sockaddr_in6 {
pub sin6_family: crate::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 stat {
pub st_dev: c_ulong,
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,
pub st_rdev: c_ulong, 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_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,
st_pad4: Padding<[c_long; 3]>,
}
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_handler: crate::sighandler_t,
pub sa_flags: c_ulong,
pub sa_restorer: Option<extern "C" fn()>,
pub sa_mask: crate::sigset_t,
}
pub struct stack_t {
pub ss_sp: *mut c_void,
pub ss_flags: c_int,
pub ss_size: size_t,
}
pub struct statfs {
pub f_type: fsword_t,
pub f_bsize: 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: fsword_t,
pub f_frsize: fsword_t,
f_spare: [fsword_t; 5],
}
pub struct statfs64 {
pub f_type: c_int,
pub f_bsize: c_int,
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_int,
pub f_frsize: c_int,
pub f_flags: c_int,
pub f_spare: [c_int; 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: Padding<c_int>,
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
__f_spare: [c_int; 6],
}
pub struct msghdr {
pub msg_name: *mut c_void,
pub msg_namelen: crate::socklen_t,
pub msg_iov: *mut crate::iovec,
pub msg_iovlen: size_t,
pub msg_control: *mut c_void,
pub msg_controllen: size_t,
pub msg_flags: c_int,
}
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_line: crate::cc_t,
pub c_cc: [crate::cc_t; crate::NCCS],
}
pub struct sigset_t {
__val: [c_ulong; 16],
}
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 glob_t {
pub gl_pathc: size_t,
pub gl_pathv: *mut *mut c_char,
pub gl_offs: size_t,
pub gl_flags: c_int,
__unused1: Padding<*mut c_void>,
__unused2: Padding<*mut c_void>,
__unused3: Padding<*mut c_void>,
__unused4: Padding<*mut c_void>,
__unused5: Padding<*mut c_void>,
}
pub struct cpu_set_t {
#[cfg(target_pointer_width = "32")]
bits: [u32; 32],
#[cfg(target_pointer_width = "64")]
bits: [u64; 16],
}
pub struct fsid_t {
__val: [c_int; 2],
}
pub struct sem_t {
#[cfg(target_pointer_width = "32")]
__size: [c_char; 16],
#[cfg(target_pointer_width = "64")]
__size: [c_char; 32],
__align: [c_long; 0],
}
pub struct cmsghdr {
pub cmsg_len: size_t,
pub cmsg_level: c_int,
pub cmsg_type: c_int,
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_ino: crate::ino64_t,
pub d_off: off64_t,
pub d_reclen: u16,
pub d_type: u8,
pub d_name: [c_char; 256],
}
}
pub const ENAMETOOLONG: c_int = 36; pub const ENOTEMPTY: c_int = 39; pub const ELOOP: c_int = 40; 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 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 ESTALE: c_int = 116; pub const EHOSTUNREACH: c_int = 113; pub const EDQUOT: c_int = 122; pub const EOPNOTSUPP: c_int = 0x5f;
pub const ENODATA: c_int = 0x3d;
pub const O_APPEND: c_int = 0o2000;
pub const O_ACCMODE: c_int = 0o003;
pub const O_CLOEXEC: c_int = 0x80000;
pub const O_CREAT: c_int = 0100;
pub const O_DIRECTORY: c_int = 0o200000;
pub const O_EXCL: c_int = 0o200;
pub const O_NOFOLLOW: c_int = 0x20000;
pub const O_NONBLOCK: c_int = 0o4000;
pub const O_TRUNC: c_int = 0o1000;
pub const NCCS: usize = 32;
pub const SIG_SETMASK: c_int = 2; pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const SOCK_DGRAM: c_int = 2; pub const SOCK_STREAM: c_int = 1; pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32;
pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4;
pub const PTHREAD_STACK_MIN: usize = 16384;