2015-09-15 23:27:15 +02:00
|
|
|
//! Linux-specific definitions for linux-like values
|
|
|
|
|
2017-02-27 21:25:55 +01:00
|
|
|
use dox::{mem, Option};
|
2016-02-06 00:06:39 +01:00
|
|
|
|
2015-09-16 01:39:51 +02:00
|
|
|
pub type useconds_t = u32;
|
2015-09-16 01:49:37 +02:00
|
|
|
pub type dev_t = u64;
|
|
|
|
pub type socklen_t = u32;
|
|
|
|
pub type pthread_t = c_ulong;
|
2015-09-19 00:00:49 +02:00
|
|
|
pub type mode_t = u32;
|
2015-10-30 01:36:55 +01:00
|
|
|
pub type ino64_t = u64;
|
|
|
|
pub type off64_t = i64;
|
|
|
|
pub type blkcnt64_t = i64;
|
|
|
|
pub type rlim64_t = u64;
|
2015-12-01 18:04:13 +01:00
|
|
|
pub type mqd_t = ::c_int;
|
2015-12-25 22:06:44 +01:00
|
|
|
pub type nfds_t = ::c_ulong;
|
2016-04-01 03:08:03 +02:00
|
|
|
pub type nl_item = ::c_int;
|
2017-01-10 17:09:51 +01:00
|
|
|
pub type idtype_t = ::c_uint;
|
2017-08-27 05:39:46 +02:00
|
|
|
pub type loff_t = ::c_longlong;
|
2015-10-30 01:36:55 +01:00
|
|
|
|
2017-06-13 17:26:14 +02:00
|
|
|
pub type __u8 = ::c_uchar;
|
|
|
|
pub type __u16 = ::c_ushort;
|
|
|
|
pub type __s16 = ::c_short;
|
|
|
|
pub type __u32 = ::c_uint;
|
|
|
|
pub type __s32 = ::c_int;
|
|
|
|
|
2015-10-30 01:36:55 +01:00
|
|
|
pub enum fpos64_t {} // TODO: fill this out with a struct
|
2015-09-16 01:39:51 +02:00
|
|
|
|
2015-09-15 23:27:15 +02:00
|
|
|
s! {
|
2015-10-30 06:59:44 +01:00
|
|
|
pub struct dirent {
|
|
|
|
pub d_ino: ::ino_t,
|
|
|
|
pub d_off: ::off_t,
|
|
|
|
pub d_reclen: ::c_ushort,
|
|
|
|
pub d_type: ::c_uchar,
|
|
|
|
pub d_name: [::c_char; 256],
|
|
|
|
}
|
|
|
|
|
2015-10-30 01:36:55 +01:00
|
|
|
pub struct dirent64 {
|
|
|
|
pub d_ino: ::ino64_t,
|
|
|
|
pub d_off: ::off64_t,
|
|
|
|
pub d_reclen: ::c_ushort,
|
|
|
|
pub d_type: ::c_uchar,
|
|
|
|
pub d_name: [::c_char; 256],
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct rlimit64 {
|
|
|
|
pub rlim_cur: rlim64_t,
|
|
|
|
pub rlim_max: rlim64_t,
|
|
|
|
}
|
|
|
|
|
2015-09-15 23:27:15 +02:00
|
|
|
pub struct glob_t {
|
2015-09-23 04:11:04 +02:00
|
|
|
pub gl_pathc: ::size_t,
|
2015-09-15 23:27:15 +02:00
|
|
|
pub gl_pathv: *mut *mut c_char,
|
2015-09-23 04:11:04 +02:00
|
|
|
pub gl_offs: ::size_t,
|
2015-09-16 01:49:37 +02:00
|
|
|
pub gl_flags: ::c_int,
|
2015-09-15 23:27:15 +02:00
|
|
|
|
|
|
|
__unused1: *mut ::c_void,
|
|
|
|
__unused2: *mut ::c_void,
|
|
|
|
__unused3: *mut ::c_void,
|
|
|
|
__unused4: *mut ::c_void,
|
|
|
|
__unused5: *mut ::c_void,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct ifaddrs {
|
|
|
|
pub ifa_next: *mut ifaddrs,
|
|
|
|
pub ifa_name: *mut c_char,
|
2015-09-16 01:49:37 +02:00
|
|
|
pub ifa_flags: ::c_uint,
|
2015-09-15 23:27:15 +02:00
|
|
|
pub ifa_addr: *mut ::sockaddr,
|
|
|
|
pub ifa_netmask: *mut ::sockaddr,
|
|
|
|
pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
|
|
|
|
pub ifa_data: *mut ::c_void
|
|
|
|
}
|
2015-09-17 23:47:40 +02:00
|
|
|
|
|
|
|
pub struct pthread_mutex_t {
|
2017-10-27 11:16:08 +02:00
|
|
|
#[cfg(any(target_arch = "mips",
|
|
|
|
target_arch = "arm",
|
|
|
|
target_arch = "powerpc",
|
|
|
|
all(target_arch = "x86_64",
|
|
|
|
target_pointer_width = "32")))]
|
2015-09-17 23:47:40 +02:00
|
|
|
__align: [::c_long; 0],
|
2017-10-27 11:16:08 +02:00
|
|
|
#[cfg(not(any(target_arch = "mips",
|
|
|
|
target_arch = "arm",
|
|
|
|
target_arch = "powerpc",
|
|
|
|
all(target_arch = "x86_64",
|
|
|
|
target_pointer_width = "32"))))]
|
2015-09-17 23:47:40 +02:00
|
|
|
__align: [::c_longlong; 0],
|
|
|
|
size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct pthread_rwlock_t {
|
2017-10-27 11:16:08 +02:00
|
|
|
#[cfg(any(target_arch = "mips",
|
|
|
|
target_arch = "arm",
|
|
|
|
target_arch = "powerpc",
|
|
|
|
all(target_arch = "x86_64",
|
|
|
|
target_pointer_width = "32")))]
|
2015-09-17 23:47:40 +02:00
|
|
|
__align: [::c_long; 0],
|
2017-10-27 11:16:08 +02:00
|
|
|
#[cfg(not(any(target_arch = "mips",
|
|
|
|
target_arch = "arm",
|
|
|
|
target_arch = "powerpc",
|
|
|
|
all(target_arch = "x86_64",
|
|
|
|
target_pointer_width = "32"))))]
|
2015-09-17 23:47:40 +02:00
|
|
|
__align: [::c_longlong; 0],
|
|
|
|
size: [u8; __SIZEOF_PTHREAD_RWLOCK_T],
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct pthread_mutexattr_t {
|
2016-08-27 05:30:42 +02:00
|
|
|
#[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
|
2016-12-30 07:33:51 +01:00
|
|
|
target_arch = "mips64", target_arch = "s390x",
|
|
|
|
target_arch = "sparc64"))]
|
2015-09-18 00:48:30 +02:00
|
|
|
__align: [::c_int; 0],
|
2016-08-27 05:30:42 +02:00
|
|
|
#[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
|
2016-12-30 07:33:51 +01:00
|
|
|
target_arch = "mips64", target_arch = "s390x",
|
2017-09-25 19:22:04 +02:00
|
|
|
target_arch = "sparc64", target_arch = "aarch64")))]
|
2015-09-18 00:18:18 +02:00
|
|
|
__align: [::c_long; 0],
|
2017-09-25 19:22:04 +02:00
|
|
|
#[cfg(all(target_arch = "aarch64", target_env = "gnu"))]
|
|
|
|
__align: [::c_long; 0],
|
|
|
|
#[cfg(all(target_arch = "aarch64", target_env = "musl"))]
|
|
|
|
__align: [::c_int; 0],
|
2015-09-17 23:47:40 +02:00
|
|
|
size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
|
|
|
|
}
|
|
|
|
|
2017-06-28 16:05:15 +02:00
|
|
|
pub struct pthread_rwlockattr_t {
|
|
|
|
#[cfg(any(target_env = "musl"))]
|
|
|
|
__align: [::c_int; 0],
|
|
|
|
#[cfg(not(any(target_env = "musl")))]
|
|
|
|
__align: [::c_long; 0],
|
|
|
|
size: [u8; __SIZEOF_PTHREAD_RWLOCKATTR_T],
|
|
|
|
}
|
|
|
|
|
2015-09-17 23:47:40 +02:00
|
|
|
pub struct pthread_cond_t {
|
2016-07-26 23:13:03 +02:00
|
|
|
#[cfg(any(target_env = "musl"))]
|
2016-01-30 07:28:50 +01:00
|
|
|
__align: [*const ::c_void; 0],
|
2016-07-26 23:13:03 +02:00
|
|
|
#[cfg(not(any(target_env = "musl")))]
|
2015-09-17 23:47:40 +02:00
|
|
|
__align: [::c_longlong; 0],
|
|
|
|
size: [u8; __SIZEOF_PTHREAD_COND_T],
|
|
|
|
}
|
|
|
|
|
2016-07-20 07:31:48 +02:00
|
|
|
pub struct pthread_condattr_t {
|
|
|
|
__align: [::c_int; 0],
|
|
|
|
size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
|
|
|
|
}
|
|
|
|
|
2015-09-17 23:47:40 +02:00
|
|
|
pub struct passwd {
|
|
|
|
pub pw_name: *mut ::c_char,
|
|
|
|
pub pw_passwd: *mut ::c_char,
|
|
|
|
pub pw_uid: ::uid_t,
|
|
|
|
pub pw_gid: ::gid_t,
|
|
|
|
pub pw_gecos: *mut ::c_char,
|
|
|
|
pub pw_dir: *mut ::c_char,
|
|
|
|
pub pw_shell: *mut ::c_char,
|
|
|
|
}
|
2015-11-05 05:26:27 +01:00
|
|
|
|
2016-09-26 22:00:29 +02:00
|
|
|
pub struct spwd {
|
|
|
|
pub sp_namp: *mut ::c_char,
|
|
|
|
pub sp_pwdp: *mut ::c_char,
|
|
|
|
pub sp_lstchg: ::c_long,
|
|
|
|
pub sp_min: ::c_long,
|
|
|
|
pub sp_max: ::c_long,
|
|
|
|
pub sp_warn: ::c_long,
|
|
|
|
pub sp_inact: ::c_long,
|
|
|
|
pub sp_expire: ::c_long,
|
|
|
|
pub sp_flag: ::c_ulong,
|
|
|
|
}
|
|
|
|
|
2015-11-05 05:26:27 +01:00
|
|
|
pub struct statvfs {
|
|
|
|
pub f_bsize: ::c_ulong,
|
|
|
|
pub f_frsize: ::c_ulong,
|
|
|
|
pub f_blocks: ::fsblkcnt_t,
|
|
|
|
pub f_bfree: ::fsblkcnt_t,
|
|
|
|
pub f_bavail: ::fsblkcnt_t,
|
|
|
|
pub f_files: ::fsfilcnt_t,
|
|
|
|
pub f_ffree: ::fsfilcnt_t,
|
|
|
|
pub f_favail: ::fsfilcnt_t,
|
2016-09-12 06:57:37 +02:00
|
|
|
#[cfg(target_endian = "little")]
|
2015-11-05 05:26:27 +01:00
|
|
|
pub f_fsid: ::c_ulong,
|
2017-10-27 11:16:08 +02:00
|
|
|
#[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))]
|
2016-09-13 06:41:17 +02:00
|
|
|
__f_unused: ::c_int,
|
2016-09-12 06:57:37 +02:00
|
|
|
#[cfg(target_endian = "big")]
|
|
|
|
pub f_fsid: ::c_ulong,
|
2015-11-05 05:26:27 +01:00
|
|
|
pub f_flag: ::c_ulong,
|
|
|
|
pub f_namemax: ::c_ulong,
|
|
|
|
__f_spare: [::c_int; 6],
|
|
|
|
}
|
2015-11-07 13:42:38 +01:00
|
|
|
|
2015-12-03 20:44:14 +01:00
|
|
|
pub struct dqblk {
|
|
|
|
pub dqb_bhardlimit: ::uint64_t,
|
|
|
|
pub dqb_bsoftlimit: ::uint64_t,
|
|
|
|
pub dqb_curspace: ::uint64_t,
|
|
|
|
pub dqb_ihardlimit: ::uint64_t,
|
|
|
|
pub dqb_isoftlimit: ::uint64_t,
|
|
|
|
pub dqb_curinodes: ::uint64_t,
|
|
|
|
pub dqb_btime: ::uint64_t,
|
|
|
|
pub dqb_itime: ::uint64_t,
|
|
|
|
pub dqb_valid: ::uint32_t,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct signalfd_siginfo {
|
|
|
|
pub ssi_signo: ::uint32_t,
|
|
|
|
pub ssi_errno: ::int32_t,
|
|
|
|
pub ssi_code: ::int32_t,
|
|
|
|
pub ssi_pid: ::uint32_t,
|
|
|
|
pub ssi_uid: ::uint32_t,
|
|
|
|
pub ssi_fd: ::int32_t,
|
|
|
|
pub ssi_tid: ::uint32_t,
|
|
|
|
pub ssi_band: ::uint32_t,
|
|
|
|
pub ssi_overrun: ::uint32_t,
|
|
|
|
pub ssi_trapno: ::uint32_t,
|
|
|
|
pub ssi_status: ::int32_t,
|
|
|
|
pub ssi_int: ::int32_t,
|
|
|
|
pub ssi_ptr: ::uint64_t,
|
|
|
|
pub ssi_utime: ::uint64_t,
|
|
|
|
pub ssi_stime: ::uint64_t,
|
|
|
|
pub ssi_addr: ::uint64_t,
|
|
|
|
_pad: [::uint8_t; 48],
|
|
|
|
}
|
|
|
|
|
2017-09-09 13:02:29 +02:00
|
|
|
pub struct itimerspec {
|
|
|
|
pub it_interval: ::timespec,
|
|
|
|
pub it_value: ::timespec,
|
|
|
|
}
|
|
|
|
|
2015-12-03 20:44:14 +01:00
|
|
|
pub struct fsid_t {
|
|
|
|
__val: [::c_int; 2],
|
|
|
|
}
|
|
|
|
|
2017-10-18 14:33:20 +02:00
|
|
|
// x32 compatibility
|
|
|
|
// See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
|
2015-12-03 20:44:14 +01:00
|
|
|
pub struct mq_attr {
|
2017-10-18 14:33:59 +02:00
|
|
|
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
|
2017-10-18 14:33:20 +02:00
|
|
|
pub mq_flags: i64,
|
2017-10-18 14:33:59 +02:00
|
|
|
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
|
2017-10-18 14:33:20 +02:00
|
|
|
pub mq_maxmsg: i64,
|
2017-10-18 14:33:59 +02:00
|
|
|
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
|
2017-10-18 14:33:20 +02:00
|
|
|
pub mq_msgsize: i64,
|
2017-10-18 14:33:59 +02:00
|
|
|
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
|
2017-10-18 14:33:20 +02:00
|
|
|
pub mq_curmsgs: i64,
|
2017-10-18 14:33:59 +02:00
|
|
|
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
|
2017-10-18 14:33:20 +02:00
|
|
|
pad: [i64; 4],
|
|
|
|
|
2017-10-18 14:33:59 +02:00
|
|
|
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
|
2015-12-03 20:44:14 +01:00
|
|
|
pub mq_flags: ::c_long,
|
2017-10-18 14:33:59 +02:00
|
|
|
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
|
2015-12-03 20:44:14 +01:00
|
|
|
pub mq_maxmsg: ::c_long,
|
2017-10-18 14:33:59 +02:00
|
|
|
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
|
2015-12-03 20:44:14 +01:00
|
|
|
pub mq_msgsize: ::c_long,
|
2017-10-18 14:33:59 +02:00
|
|
|
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
|
2015-12-03 20:44:14 +01:00
|
|
|
pub mq_curmsgs: ::c_long,
|
2017-10-18 14:33:59 +02:00
|
|
|
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
|
2017-10-18 14:33:20 +02:00
|
|
|
pad: [::c_long; 4],
|
2015-12-03 20:44:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
pub struct cpu_set_t {
|
2017-10-27 11:16:08 +02:00
|
|
|
#[cfg(all(target_pointer_width = "32",
|
|
|
|
not(target_arch = "x86_64")))]
|
2015-12-03 20:44:14 +01:00
|
|
|
bits: [u32; 32],
|
2017-10-27 11:16:08 +02:00
|
|
|
#[cfg(not(all(target_pointer_width = "32",
|
|
|
|
not(target_arch = "x86_64"))))]
|
2015-12-03 20:44:14 +01:00
|
|
|
bits: [u64; 16],
|
|
|
|
}
|
2016-07-12 09:32:42 +02:00
|
|
|
|
|
|
|
pub struct if_nameindex {
|
|
|
|
pub if_index: ::c_uint,
|
|
|
|
pub if_name: *mut ::c_char,
|
|
|
|
}
|
|
|
|
|
2016-09-17 22:17:17 +02:00
|
|
|
// System V IPC
|
|
|
|
pub struct msginfo {
|
|
|
|
pub msgpool: ::c_int,
|
|
|
|
pub msgmap: ::c_int,
|
|
|
|
pub msgmax: ::c_int,
|
|
|
|
pub msgmnb: ::c_int,
|
|
|
|
pub msgmni: ::c_int,
|
|
|
|
pub msgssz: ::c_int,
|
|
|
|
pub msgtql: ::c_int,
|
|
|
|
pub msgseg: ::c_ushort,
|
|
|
|
}
|
2016-04-10 16:21:55 +02:00
|
|
|
|
|
|
|
pub struct mmsghdr {
|
|
|
|
pub msg_hdr: ::msghdr,
|
|
|
|
pub msg_len: ::c_uint,
|
|
|
|
}
|
2017-05-26 13:35:40 +02:00
|
|
|
|
|
|
|
pub struct sembuf {
|
2017-05-26 21:47:53 +02:00
|
|
|
pub sem_num: ::c_ushort,
|
|
|
|
pub sem_op: ::c_short,
|
2017-05-26 21:54:03 +02:00
|
|
|
pub sem_flg: ::c_short,
|
2017-05-26 13:35:40 +02:00
|
|
|
}
|
2017-06-13 17:26:14 +02:00
|
|
|
|
|
|
|
pub struct input_event {
|
|
|
|
pub time: ::timeval,
|
|
|
|
pub type_: ::__u16,
|
|
|
|
pub code: ::__u16,
|
|
|
|
pub value: ::__s32,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct input_id {
|
|
|
|
pub bustype: ::__u16,
|
|
|
|
pub vendor: ::__u16,
|
|
|
|
pub product: ::__u16,
|
|
|
|
pub version: ::__u16,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct input_absinfo {
|
|
|
|
pub value: ::__s32,
|
|
|
|
pub minimum: ::__s32,
|
|
|
|
pub maximum: ::__s32,
|
|
|
|
pub fuzz: ::__s32,
|
|
|
|
pub flat: ::__s32,
|
|
|
|
pub resolution: ::__s32,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct input_keymap_entry {
|
|
|
|
pub flags: ::__u8,
|
|
|
|
pub len: ::__u8,
|
|
|
|
pub index: ::__u16,
|
|
|
|
pub keycode: ::__u32,
|
|
|
|
pub scancode: [::__u8; 32],
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct input_mask {
|
|
|
|
pub type_: ::__u32,
|
|
|
|
pub codes_size: ::__u32,
|
|
|
|
pub codes_ptr: ::__u64,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct ff_replay {
|
|
|
|
pub length: ::__u16,
|
|
|
|
pub delay: ::__u16,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct ff_trigger {
|
|
|
|
pub button: ::__u16,
|
|
|
|
pub interval: ::__u16,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct ff_envelope {
|
|
|
|
pub attack_length: ::__u16,
|
|
|
|
pub attack_level: ::__u16,
|
|
|
|
pub fade_length: ::__u16,
|
|
|
|
pub fade_level: ::__u16,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct ff_constant_effect {
|
|
|
|
pub level: ::__s16,
|
|
|
|
pub envelope: ff_envelope,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct ff_ramp_effect {
|
|
|
|
pub start_level: ::__s16,
|
|
|
|
pub end_level: ::__s16,
|
|
|
|
pub envelope: ff_envelope,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct ff_condition_effect {
|
|
|
|
pub right_saturation: ::__u16,
|
|
|
|
pub left_saturation: ::__u16,
|
|
|
|
|
|
|
|
pub right_coeff: ::__s16,
|
|
|
|
pub left_coeff: ::__s16,
|
|
|
|
|
|
|
|
pub deadband: ::__u16,
|
|
|
|
pub center: ::__s16,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct ff_periodic_effect {
|
|
|
|
pub waveform: ::__u16,
|
|
|
|
pub period: ::__u16,
|
|
|
|
pub magnitude: ::__s16,
|
|
|
|
pub offset: ::__s16,
|
|
|
|
pub phase: ::__u16,
|
|
|
|
|
|
|
|
pub envelope: ff_envelope,
|
|
|
|
|
|
|
|
pub custom_len: ::__u32,
|
|
|
|
pub custom_data: *mut ::__s16,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct ff_rumble_effect {
|
|
|
|
pub strong_magnitude: ::__u16,
|
|
|
|
pub weak_magnitude: ::__u16,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct ff_effect {
|
|
|
|
pub type_: ::__u16,
|
|
|
|
pub id: ::__s16,
|
|
|
|
pub direction: ::__u16,
|
|
|
|
pub trigger: ff_trigger,
|
|
|
|
pub replay: ff_replay,
|
|
|
|
// FIXME this is actually a union
|
|
|
|
#[cfg(target_pointer_width = "64")]
|
|
|
|
pub u: [u64; 4],
|
|
|
|
#[cfg(target_pointer_width = "32")]
|
|
|
|
pub u: [u32; 7],
|
|
|
|
}
|
2015-09-15 23:27:15 +02:00
|
|
|
}
|
|
|
|
|
2016-04-01 03:08:03 +02:00
|
|
|
pub const ABDAY_1: ::nl_item = 0x20000;
|
|
|
|
pub const ABDAY_2: ::nl_item = 0x20001;
|
|
|
|
pub const ABDAY_3: ::nl_item = 0x20002;
|
|
|
|
pub const ABDAY_4: ::nl_item = 0x20003;
|
|
|
|
pub const ABDAY_5: ::nl_item = 0x20004;
|
|
|
|
pub const ABDAY_6: ::nl_item = 0x20005;
|
|
|
|
pub const ABDAY_7: ::nl_item = 0x20006;
|
|
|
|
|
|
|
|
pub const DAY_1: ::nl_item = 0x20007;
|
|
|
|
pub const DAY_2: ::nl_item = 0x20008;
|
|
|
|
pub const DAY_3: ::nl_item = 0x20009;
|
|
|
|
pub const DAY_4: ::nl_item = 0x2000A;
|
|
|
|
pub const DAY_5: ::nl_item = 0x2000B;
|
|
|
|
pub const DAY_6: ::nl_item = 0x2000C;
|
|
|
|
pub const DAY_7: ::nl_item = 0x2000D;
|
|
|
|
|
|
|
|
pub const ABMON_1: ::nl_item = 0x2000E;
|
|
|
|
pub const ABMON_2: ::nl_item = 0x2000F;
|
|
|
|
pub const ABMON_3: ::nl_item = 0x20010;
|
|
|
|
pub const ABMON_4: ::nl_item = 0x20011;
|
|
|
|
pub const ABMON_5: ::nl_item = 0x20012;
|
|
|
|
pub const ABMON_6: ::nl_item = 0x20013;
|
|
|
|
pub const ABMON_7: ::nl_item = 0x20014;
|
|
|
|
pub const ABMON_8: ::nl_item = 0x20015;
|
|
|
|
pub const ABMON_9: ::nl_item = 0x20016;
|
|
|
|
pub const ABMON_10: ::nl_item = 0x20017;
|
|
|
|
pub const ABMON_11: ::nl_item = 0x20018;
|
|
|
|
pub const ABMON_12: ::nl_item = 0x20019;
|
|
|
|
|
|
|
|
pub const MON_1: ::nl_item = 0x2001A;
|
|
|
|
pub const MON_2: ::nl_item = 0x2001B;
|
|
|
|
pub const MON_3: ::nl_item = 0x2001C;
|
|
|
|
pub const MON_4: ::nl_item = 0x2001D;
|
|
|
|
pub const MON_5: ::nl_item = 0x2001E;
|
|
|
|
pub const MON_6: ::nl_item = 0x2001F;
|
|
|
|
pub const MON_7: ::nl_item = 0x20020;
|
|
|
|
pub const MON_8: ::nl_item = 0x20021;
|
|
|
|
pub const MON_9: ::nl_item = 0x20022;
|
|
|
|
pub const MON_10: ::nl_item = 0x20023;
|
|
|
|
pub const MON_11: ::nl_item = 0x20024;
|
|
|
|
pub const MON_12: ::nl_item = 0x20025;
|
|
|
|
|
|
|
|
pub const AM_STR: ::nl_item = 0x20026;
|
|
|
|
pub const PM_STR: ::nl_item = 0x20027;
|
|
|
|
|
|
|
|
pub const D_T_FMT: ::nl_item = 0x20028;
|
|
|
|
pub const D_FMT: ::nl_item = 0x20029;
|
|
|
|
pub const T_FMT: ::nl_item = 0x2002A;
|
|
|
|
pub const T_FMT_AMPM: ::nl_item = 0x2002B;
|
|
|
|
|
|
|
|
pub const ERA: ::nl_item = 0x2002C;
|
|
|
|
pub const ERA_D_FMT: ::nl_item = 0x2002E;
|
|
|
|
pub const ALT_DIGITS: ::nl_item = 0x2002F;
|
|
|
|
pub const ERA_D_T_FMT: ::nl_item = 0x20030;
|
|
|
|
pub const ERA_T_FMT: ::nl_item = 0x20031;
|
|
|
|
|
|
|
|
pub const CODESET: ::nl_item = 14;
|
|
|
|
|
|
|
|
pub const CRNCYSTR: ::nl_item = 0x4000F;
|
|
|
|
|
2016-10-04 02:08:12 +02:00
|
|
|
pub const RUSAGE_THREAD: ::c_int = 1;
|
|
|
|
pub const RUSAGE_CHILDREN: ::c_int = -1;
|
|
|
|
|
2016-04-01 03:08:03 +02:00
|
|
|
pub const RADIXCHAR: ::nl_item = 0x10000;
|
|
|
|
pub const THOUSEP: ::nl_item = 0x10001;
|
|
|
|
|
|
|
|
pub const YESEXPR: ::nl_item = 0x50000;
|
|
|
|
pub const NOEXPR: ::nl_item = 0x50001;
|
|
|
|
pub const YESSTR: ::nl_item = 0x50002;
|
|
|
|
pub const NOSTR: ::nl_item = 0x50003;
|
|
|
|
|
2015-09-16 01:49:37 +02:00
|
|
|
pub const FILENAME_MAX: ::c_uint = 4096;
|
|
|
|
pub const L_tmpnam: ::c_uint = 20;
|
2016-07-06 21:15:38 +02:00
|
|
|
pub const _PC_LINK_MAX: ::c_int = 0;
|
|
|
|
pub const _PC_MAX_CANON: ::c_int = 1;
|
|
|
|
pub const _PC_MAX_INPUT: ::c_int = 2;
|
2015-09-16 01:49:37 +02:00
|
|
|
pub const _PC_NAME_MAX: ::c_int = 3;
|
2016-07-06 21:15:38 +02:00
|
|
|
pub const _PC_PATH_MAX: ::c_int = 4;
|
|
|
|
pub const _PC_PIPE_BUF: ::c_int = 5;
|
|
|
|
pub const _PC_CHOWN_RESTRICTED: ::c_int = 6;
|
|
|
|
pub const _PC_NO_TRUNC: ::c_int = 7;
|
|
|
|
pub const _PC_VDISABLE: ::c_int = 8;
|
2017-06-25 20:45:27 +02:00
|
|
|
pub const _PC_SYNC_IO: ::c_int = 9;
|
|
|
|
pub const _PC_ASYNC_IO: ::c_int = 10;
|
|
|
|
pub const _PC_PRIO_IO: ::c_int = 11;
|
|
|
|
pub const _PC_SOCK_MAXBUF: ::c_int = 12;
|
|
|
|
pub const _PC_FILESIZEBITS: ::c_int = 13;
|
|
|
|
pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
|
|
|
|
pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
|
|
|
|
pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
|
|
|
|
pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
|
|
|
|
pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18;
|
|
|
|
pub const _PC_SYMLINK_MAX: ::c_int = 19;
|
|
|
|
pub const _PC_2_SYMLINKS: ::c_int = 20;
|
2015-09-16 01:49:37 +02:00
|
|
|
|
|
|
|
pub const _SC_ARG_MAX: ::c_int = 0;
|
|
|
|
pub const _SC_CHILD_MAX: ::c_int = 1;
|
|
|
|
pub const _SC_CLK_TCK: ::c_int = 2;
|
|
|
|
pub const _SC_NGROUPS_MAX: ::c_int = 3;
|
|
|
|
pub const _SC_OPEN_MAX: ::c_int = 4;
|
|
|
|
pub const _SC_STREAM_MAX: ::c_int = 5;
|
|
|
|
pub const _SC_TZNAME_MAX: ::c_int = 6;
|
|
|
|
pub const _SC_JOB_CONTROL: ::c_int = 7;
|
|
|
|
pub const _SC_SAVED_IDS: ::c_int = 8;
|
|
|
|
pub const _SC_REALTIME_SIGNALS: ::c_int = 9;
|
|
|
|
pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10;
|
|
|
|
pub const _SC_TIMERS: ::c_int = 11;
|
|
|
|
pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12;
|
|
|
|
pub const _SC_PRIORITIZED_IO: ::c_int = 13;
|
|
|
|
pub const _SC_SYNCHRONIZED_IO: ::c_int = 14;
|
|
|
|
pub const _SC_FSYNC: ::c_int = 15;
|
|
|
|
pub const _SC_MAPPED_FILES: ::c_int = 16;
|
|
|
|
pub const _SC_MEMLOCK: ::c_int = 17;
|
|
|
|
pub const _SC_MEMLOCK_RANGE: ::c_int = 18;
|
|
|
|
pub const _SC_MEMORY_PROTECTION: ::c_int = 19;
|
|
|
|
pub const _SC_MESSAGE_PASSING: ::c_int = 20;
|
|
|
|
pub const _SC_SEMAPHORES: ::c_int = 21;
|
|
|
|
pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22;
|
|
|
|
pub const _SC_AIO_LISTIO_MAX: ::c_int = 23;
|
|
|
|
pub const _SC_AIO_MAX: ::c_int = 24;
|
|
|
|
pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25;
|
|
|
|
pub const _SC_DELAYTIMER_MAX: ::c_int = 26;
|
|
|
|
pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
|
|
|
|
pub const _SC_MQ_PRIO_MAX: ::c_int = 28;
|
|
|
|
pub const _SC_VERSION: ::c_int = 29;
|
|
|
|
pub const _SC_PAGESIZE: ::c_int = 30;
|
2016-02-01 03:28:16 +01:00
|
|
|
pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
|
2015-09-16 01:49:37 +02:00
|
|
|
pub const _SC_RTSIG_MAX: ::c_int = 31;
|
|
|
|
pub const _SC_SEM_NSEMS_MAX: ::c_int = 32;
|
|
|
|
pub const _SC_SEM_VALUE_MAX: ::c_int = 33;
|
|
|
|
pub const _SC_SIGQUEUE_MAX: ::c_int = 34;
|
|
|
|
pub const _SC_TIMER_MAX: ::c_int = 35;
|
|
|
|
pub const _SC_BC_BASE_MAX: ::c_int = 36;
|
|
|
|
pub const _SC_BC_DIM_MAX: ::c_int = 37;
|
|
|
|
pub const _SC_BC_SCALE_MAX: ::c_int = 38;
|
|
|
|
pub const _SC_BC_STRING_MAX: ::c_int = 39;
|
|
|
|
pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40;
|
|
|
|
pub const _SC_EXPR_NEST_MAX: ::c_int = 42;
|
|
|
|
pub const _SC_LINE_MAX: ::c_int = 43;
|
|
|
|
pub const _SC_RE_DUP_MAX: ::c_int = 44;
|
|
|
|
pub const _SC_2_VERSION: ::c_int = 46;
|
|
|
|
pub const _SC_2_C_BIND: ::c_int = 47;
|
|
|
|
pub const _SC_2_C_DEV: ::c_int = 48;
|
|
|
|
pub const _SC_2_FORT_DEV: ::c_int = 49;
|
|
|
|
pub const _SC_2_FORT_RUN: ::c_int = 50;
|
|
|
|
pub const _SC_2_SW_DEV: ::c_int = 51;
|
|
|
|
pub const _SC_2_LOCALEDEF: ::c_int = 52;
|
2017-06-25 19:30:06 +02:00
|
|
|
pub const _SC_UIO_MAXIOV: ::c_int = 60;
|
2015-09-16 01:49:37 +02:00
|
|
|
pub const _SC_IOV_MAX: ::c_int = 60;
|
|
|
|
pub const _SC_THREADS: ::c_int = 67;
|
|
|
|
pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68;
|
|
|
|
pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69;
|
|
|
|
pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70;
|
|
|
|
pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
|
|
|
|
pub const _SC_TTY_NAME_MAX: ::c_int = 72;
|
|
|
|
pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73;
|
|
|
|
pub const _SC_THREAD_KEYS_MAX: ::c_int = 74;
|
|
|
|
pub const _SC_THREAD_STACK_MIN: ::c_int = 75;
|
|
|
|
pub const _SC_THREAD_THREADS_MAX: ::c_int = 76;
|
|
|
|
pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
|
|
|
|
pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
|
|
|
|
pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
|
|
|
|
pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
|
|
|
|
pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
|
2017-06-25 19:30:06 +02:00
|
|
|
pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 82;
|
2017-05-29 01:47:04 +02:00
|
|
|
pub const _SC_NPROCESSORS_CONF: ::c_int = 83;
|
2015-09-16 01:49:37 +02:00
|
|
|
pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
|
2017-06-25 19:30:06 +02:00
|
|
|
pub const _SC_PHYS_PAGES: ::c_int = 85;
|
|
|
|
pub const _SC_AVPHYS_PAGES: ::c_int = 86;
|
2015-09-16 01:49:37 +02:00
|
|
|
pub const _SC_ATEXIT_MAX: ::c_int = 87;
|
2017-06-25 19:30:06 +02:00
|
|
|
pub const _SC_PASS_MAX: ::c_int = 88;
|
2015-09-16 01:49:37 +02:00
|
|
|
pub const _SC_XOPEN_VERSION: ::c_int = 89;
|
|
|
|
pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90;
|
|
|
|
pub const _SC_XOPEN_UNIX: ::c_int = 91;
|
|
|
|
pub const _SC_XOPEN_CRYPT: ::c_int = 92;
|
|
|
|
pub const _SC_XOPEN_ENH_I18N: ::c_int = 93;
|
|
|
|
pub const _SC_XOPEN_SHM: ::c_int = 94;
|
|
|
|
pub const _SC_2_CHAR_TERM: ::c_int = 95;
|
|
|
|
pub const _SC_2_UPE: ::c_int = 97;
|
2017-06-25 19:30:06 +02:00
|
|
|
pub const _SC_XOPEN_XPG2: ::c_int = 98;
|
|
|
|
pub const _SC_XOPEN_XPG3: ::c_int = 99;
|
|
|
|
pub const _SC_XOPEN_XPG4: ::c_int = 100;
|
|
|
|
pub const _SC_NZERO: ::c_int = 109;
|
2015-09-16 01:49:37 +02:00
|
|
|
pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125;
|
|
|
|
pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126;
|
2017-06-25 19:30:06 +02:00
|
|
|
pub const _SC_XBS5_LP64_OFF64: ::c_int = 127;
|
2015-09-16 01:49:37 +02:00
|
|
|
pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128;
|
|
|
|
pub const _SC_XOPEN_LEGACY: ::c_int = 129;
|
|
|
|
pub const _SC_XOPEN_REALTIME: ::c_int = 130;
|
|
|
|
pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131;
|
2017-06-25 19:30:06 +02:00
|
|
|
pub const _SC_ADVISORY_INFO: ::c_int = 132;
|
|
|
|
pub const _SC_BARRIERS: ::c_int = 133;
|
|
|
|
pub const _SC_CLOCK_SELECTION: ::c_int = 137;
|
|
|
|
pub const _SC_CPUTIME: ::c_int = 138;
|
|
|
|
pub const _SC_THREAD_CPUTIME: ::c_int = 139;
|
|
|
|
pub const _SC_MONOTONIC_CLOCK: ::c_int = 149;
|
|
|
|
pub const _SC_READER_WRITER_LOCKS: ::c_int = 153;
|
|
|
|
pub const _SC_SPIN_LOCKS: ::c_int = 154;
|
|
|
|
pub const _SC_REGEXP: ::c_int = 155;
|
|
|
|
pub const _SC_SHELL: ::c_int = 157;
|
|
|
|
pub const _SC_SPAWN: ::c_int = 159;
|
|
|
|
pub const _SC_SPORADIC_SERVER: ::c_int = 160;
|
|
|
|
pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 161;
|
|
|
|
pub const _SC_TIMEOUTS: ::c_int = 164;
|
|
|
|
pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 165;
|
|
|
|
pub const _SC_2_PBS: ::c_int = 168;
|
|
|
|
pub const _SC_2_PBS_ACCOUNTING: ::c_int = 169;
|
|
|
|
pub const _SC_2_PBS_LOCATE: ::c_int = 170;
|
|
|
|
pub const _SC_2_PBS_MESSAGE: ::c_int = 171;
|
|
|
|
pub const _SC_2_PBS_TRACK: ::c_int = 172;
|
|
|
|
pub const _SC_SYMLOOP_MAX: ::c_int = 173;
|
|
|
|
pub const _SC_STREAMS: ::c_int = 174;
|
|
|
|
pub const _SC_2_PBS_CHECKPOINT: ::c_int = 175;
|
|
|
|
pub const _SC_V6_ILP32_OFF32: ::c_int = 176;
|
|
|
|
pub const _SC_V6_ILP32_OFFBIG: ::c_int = 177;
|
|
|
|
pub const _SC_V6_LP64_OFF64: ::c_int = 178;
|
|
|
|
pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 179;
|
2016-05-04 11:35:08 +02:00
|
|
|
pub const _SC_HOST_NAME_MAX: ::c_int = 180;
|
2017-06-25 19:30:06 +02:00
|
|
|
pub const _SC_TRACE: ::c_int = 181;
|
|
|
|
pub const _SC_TRACE_EVENT_FILTER: ::c_int = 182;
|
|
|
|
pub const _SC_TRACE_INHERIT: ::c_int = 183;
|
|
|
|
pub const _SC_TRACE_LOG: ::c_int = 184;
|
|
|
|
pub const _SC_IPV6: ::c_int = 235;
|
|
|
|
pub const _SC_RAW_SOCKETS: ::c_int = 236;
|
|
|
|
pub const _SC_V7_ILP32_OFF32: ::c_int = 237;
|
|
|
|
pub const _SC_V7_ILP32_OFFBIG: ::c_int = 238;
|
|
|
|
pub const _SC_V7_LP64_OFF64: ::c_int = 239;
|
|
|
|
pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 240;
|
|
|
|
pub const _SC_SS_REPL_MAX: ::c_int = 241;
|
|
|
|
pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 242;
|
|
|
|
pub const _SC_TRACE_NAME_MAX: ::c_int = 243;
|
|
|
|
pub const _SC_TRACE_SYS_MAX: ::c_int = 244;
|
|
|
|
pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 245;
|
|
|
|
pub const _SC_XOPEN_STREAMS: ::c_int = 246;
|
|
|
|
pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247;
|
|
|
|
pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248;
|
2015-09-15 23:27:15 +02:00
|
|
|
|
|
|
|
pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
|
|
|
|
pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
|
|
|
|
|
2015-09-16 01:49:37 +02:00
|
|
|
pub const GLOB_ERR: ::c_int = 1 << 0;
|
|
|
|
pub const GLOB_MARK: ::c_int = 1 << 1;
|
|
|
|
pub const GLOB_NOSORT: ::c_int = 1 << 2;
|
|
|
|
pub const GLOB_DOOFFS: ::c_int = 1 << 3;
|
|
|
|
pub const GLOB_NOCHECK: ::c_int = 1 << 4;
|
|
|
|
pub const GLOB_APPEND: ::c_int = 1 << 5;
|
|
|
|
pub const GLOB_NOESCAPE: ::c_int = 1 << 6;
|
|
|
|
|
|
|
|
pub const GLOB_NOSPACE: ::c_int = 1;
|
|
|
|
pub const GLOB_ABORTED: ::c_int = 2;
|
|
|
|
pub const GLOB_NOMATCH: ::c_int = 3;
|
|
|
|
|
|
|
|
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;
|
2015-09-15 23:27:15 +02:00
|
|
|
|
|
|
|
pub const S_IEXEC: mode_t = 64;
|
|
|
|
pub const S_IWRITE: mode_t = 128;
|
|
|
|
pub const S_IREAD: mode_t = 256;
|
|
|
|
|
2015-09-16 01:49:37 +02:00
|
|
|
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;
|
2015-09-15 23:27:15 +02:00
|
|
|
|
2017-09-10 15:35:51 +02:00
|
|
|
pub const IFF_LOWER_UP: ::c_int = 0x10000;
|
|
|
|
pub const IFF_DORMANT: ::c_int = 0x20000;
|
|
|
|
pub const IFF_ECHO: ::c_int = 0x40000;
|
|
|
|
|
2015-11-05 05:26:27 +01:00
|
|
|
pub const ST_RDONLY: ::c_ulong = 1;
|
|
|
|
pub const ST_NOSUID: ::c_ulong = 2;
|
|
|
|
pub const ST_NODEV: ::c_ulong = 4;
|
|
|
|
pub const ST_NOEXEC: ::c_ulong = 8;
|
|
|
|
pub const ST_SYNCHRONOUS: ::c_ulong = 16;
|
|
|
|
pub const ST_MANDLOCK: ::c_ulong = 64;
|
|
|
|
pub const ST_WRITE: ::c_ulong = 128;
|
|
|
|
pub const ST_APPEND: ::c_ulong = 256;
|
|
|
|
pub const ST_IMMUTABLE: ::c_ulong = 512;
|
|
|
|
pub const ST_NOATIME: ::c_ulong = 1024;
|
|
|
|
pub const ST_NODIRATIME: ::c_ulong = 2048;
|
|
|
|
|
2015-11-30 04:24:10 +01:00
|
|
|
pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void;
|
|
|
|
pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
|
2016-02-04 22:48:13 +01:00
|
|
|
pub const RTLD_NODELETE: ::c_int = 0x1000;
|
|
|
|
pub const RTLD_NOW: ::c_int = 0x2;
|
2015-11-30 03:42:14 +01:00
|
|
|
|
2015-09-16 01:49:37 +02:00
|
|
|
pub const TCP_MD5SIG: ::c_int = 14;
|
2015-09-15 23:27:15 +02:00
|
|
|
|
2015-09-17 23:47:40 +02:00
|
|
|
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
|
|
|
|
__align: [],
|
|
|
|
size: [0; __SIZEOF_PTHREAD_MUTEX_T],
|
|
|
|
};
|
|
|
|
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
|
|
|
|
__align: [],
|
|
|
|
size: [0; __SIZEOF_PTHREAD_COND_T],
|
|
|
|
};
|
|
|
|
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
|
|
|
|
__align: [],
|
|
|
|
size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
|
|
|
|
};
|
2016-05-21 07:40:14 +02:00
|
|
|
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
|
2015-09-17 23:47:40 +02:00
|
|
|
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
|
2016-05-21 07:40:14 +02:00
|
|
|
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
|
|
|
|
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
|
2017-07-02 18:47:37 +02:00
|
|
|
pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
|
|
|
|
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
|
2015-09-17 23:47:40 +02:00
|
|
|
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
|
|
|
|
|
2017-10-16 18:12:16 +02:00
|
|
|
pub const RENAME_NOREPLACE: ::c_int = 1;
|
|
|
|
pub const RENAME_EXCHANGE: ::c_int = 2;
|
|
|
|
pub const RENAME_WHITEOUT: ::c_int = 4;
|
|
|
|
|
2015-11-27 01:02:44 +01:00
|
|
|
pub const SCHED_OTHER: ::c_int = 0;
|
|
|
|
pub const SCHED_FIFO: ::c_int = 1;
|
|
|
|
pub const SCHED_RR: ::c_int = 2;
|
|
|
|
pub const SCHED_BATCH: ::c_int = 3;
|
|
|
|
pub const SCHED_IDLE: ::c_int = 5;
|
|
|
|
|
2017-09-11 03:06:28 +02:00
|
|
|
// netinet/in.h
|
|
|
|
// NOTE: These are in addition to the constants defined in src/unix/mod.rs
|
|
|
|
|
|
|
|
// IPPROTO_IP defined in src/unix/mod.rs
|
|
|
|
/// Hop-by-hop option header
|
|
|
|
pub const IPPROTO_HOPOPTS: ::c_int = 0;
|
|
|
|
// IPPROTO_ICMP defined in src/unix/mod.rs
|
|
|
|
/// group mgmt protocol
|
|
|
|
pub const IPPROTO_IGMP: ::c_int = 2;
|
|
|
|
/// for compatibility
|
|
|
|
pub const IPPROTO_IPIP: ::c_int = 4;
|
|
|
|
// IPPROTO_TCP defined in src/unix/mod.rs
|
|
|
|
/// exterior gateway protocol
|
|
|
|
pub const IPPROTO_EGP: ::c_int = 8;
|
|
|
|
/// pup
|
|
|
|
pub const IPPROTO_PUP: ::c_int = 12;
|
|
|
|
// IPPROTO_UDP defined in src/unix/mod.rs
|
|
|
|
/// xns idp
|
|
|
|
pub const IPPROTO_IDP: ::c_int = 22;
|
|
|
|
/// tp-4 w/ class negotiation
|
|
|
|
pub const IPPROTO_TP: ::c_int = 29;
|
|
|
|
/// DCCP
|
|
|
|
pub const IPPROTO_DCCP: ::c_int = 33;
|
|
|
|
// IPPROTO_IPV6 defined in src/unix/mod.rs
|
|
|
|
/// IP6 routing header
|
|
|
|
pub const IPPROTO_ROUTING: ::c_int = 43;
|
|
|
|
/// IP6 fragmentation header
|
|
|
|
pub const IPPROTO_FRAGMENT: ::c_int = 44;
|
|
|
|
/// resource reservation
|
|
|
|
pub const IPPROTO_RSVP: ::c_int = 46;
|
|
|
|
/// General Routing Encap.
|
|
|
|
pub const IPPROTO_GRE: ::c_int = 47;
|
|
|
|
/// IP6 Encap Sec. Payload
|
|
|
|
pub const IPPROTO_ESP: ::c_int = 50;
|
|
|
|
/// IP6 Auth Header
|
|
|
|
pub const IPPROTO_AH: ::c_int = 51;
|
|
|
|
// IPPROTO_ICMPV6 defined in src/unix/mod.rs
|
|
|
|
/// IP6 no next header
|
|
|
|
pub const IPPROTO_NONE: ::c_int = 59;
|
|
|
|
/// IP6 destination option
|
|
|
|
pub const IPPROTO_DSTOPTS: ::c_int = 60;
|
|
|
|
pub const IPPROTO_MTP: ::c_int = 92;
|
|
|
|
pub const IPPROTO_BEETPH: ::c_int = 94;
|
|
|
|
/// encapsulation header
|
|
|
|
pub const IPPROTO_ENCAP: ::c_int = 98;
|
|
|
|
/// Protocol indep. multicast
|
|
|
|
pub const IPPROTO_PIM: ::c_int = 103;
|
|
|
|
/// IP Payload Comp. Protocol
|
|
|
|
pub const IPPROTO_COMP: ::c_int = 108;
|
|
|
|
/// SCTP
|
|
|
|
pub const IPPROTO_SCTP: ::c_int = 132;
|
|
|
|
pub const IPPROTO_MH: ::c_int = 135;
|
|
|
|
pub const IPPROTO_UDPLITE: ::c_int = 136;
|
|
|
|
pub const IPPROTO_MPLS: ::c_int = 137;
|
|
|
|
/// raw IP packet
|
|
|
|
pub const IPPROTO_RAW: ::c_int = 255;
|
|
|
|
pub const IPPROTO_MAX: ::c_int = 256;
|
|
|
|
|
2017-02-28 04:59:17 +01:00
|
|
|
pub const AF_IB: ::c_int = 27;
|
|
|
|
pub const AF_MPLS: ::c_int = 28;
|
|
|
|
pub const AF_NFC: ::c_int = 39;
|
|
|
|
pub const AF_VSOCK: ::c_int = 40;
|
|
|
|
pub const PF_IB: ::c_int = AF_IB;
|
|
|
|
pub const PF_MPLS: ::c_int = AF_MPLS;
|
|
|
|
pub const PF_NFC: ::c_int = AF_NFC;
|
|
|
|
pub const PF_VSOCK: ::c_int = AF_VSOCK;
|
|
|
|
|
2016-09-17 22:17:17 +02:00
|
|
|
// System V IPC
|
|
|
|
pub const IPC_PRIVATE: ::key_t = 0;
|
|
|
|
|
2015-12-14 00:09:45 +01:00
|
|
|
pub const IPC_CREAT: ::c_int = 0o1000;
|
|
|
|
pub const IPC_EXCL: ::c_int = 0o2000;
|
|
|
|
pub const IPC_NOWAIT: ::c_int = 0o4000;
|
|
|
|
|
|
|
|
pub const IPC_RMID: ::c_int = 0;
|
|
|
|
pub const IPC_SET: ::c_int = 1;
|
|
|
|
pub const IPC_STAT: ::c_int = 2;
|
|
|
|
pub const IPC_INFO: ::c_int = 3;
|
2016-09-17 22:17:17 +02:00
|
|
|
pub const MSG_STAT: ::c_int = 11;
|
|
|
|
pub const MSG_INFO: ::c_int = 12;
|
|
|
|
|
|
|
|
pub const MSG_NOERROR: ::c_int = 0o10000;
|
|
|
|
pub const MSG_EXCEPT: ::c_int = 0o20000;
|
|
|
|
pub const MSG_COPY: ::c_int = 0o40000;
|
2015-12-14 00:09:45 +01:00
|
|
|
|
|
|
|
pub const SHM_R: ::c_int = 0o400;
|
|
|
|
pub const SHM_W: ::c_int = 0o200;
|
|
|
|
|
|
|
|
pub const SHM_RDONLY: ::c_int = 0o10000;
|
|
|
|
pub const SHM_RND: ::c_int = 0o20000;
|
|
|
|
pub const SHM_REMAP: ::c_int = 0o40000;
|
|
|
|
pub const SHM_EXEC: ::c_int = 0o100000;
|
|
|
|
|
|
|
|
pub const SHM_LOCK: ::c_int = 11;
|
|
|
|
pub const SHM_UNLOCK: ::c_int = 12;
|
|
|
|
|
|
|
|
pub const SHM_HUGETLB: ::c_int = 0o4000;
|
|
|
|
pub const SHM_NORESERVE: ::c_int = 0o10000;
|
|
|
|
|
2015-12-03 20:44:14 +01:00
|
|
|
pub const EPOLLRDHUP: ::c_int = 0x2000;
|
2017-02-17 16:25:19 +01:00
|
|
|
pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
|
2015-12-03 20:44:14 +01:00
|
|
|
pub const EPOLLONESHOT: ::c_int = 0x40000000;
|
|
|
|
|
|
|
|
pub const QFMT_VFS_OLD: ::c_int = 1;
|
|
|
|
pub const QFMT_VFS_V0: ::c_int = 2;
|
2017-08-30 04:33:22 +02:00
|
|
|
pub const QFMT_VFS_V1: ::c_int = 4;
|
2015-12-03 20:44:14 +01:00
|
|
|
|
|
|
|
pub const EFD_SEMAPHORE: ::c_int = 0x1;
|
|
|
|
|
2016-05-05 18:45:29 +02:00
|
|
|
pub const LOG_NFACILITIES: ::c_int = 24;
|
|
|
|
|
2016-06-04 06:02:56 +02:00
|
|
|
pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
|
|
|
|
|
2016-07-15 23:19:00 +02:00
|
|
|
pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32;
|
|
|
|
pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32;
|
|
|
|
pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32;
|
|
|
|
pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32;
|
|
|
|
pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32;
|
|
|
|
pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32;
|
|
|
|
pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32;
|
2016-07-12 19:55:08 +02:00
|
|
|
|
2016-12-20 15:29:17 +01:00
|
|
|
pub const AI_PASSIVE: ::c_int = 0x0001;
|
|
|
|
pub const AI_CANONNAME: ::c_int = 0x0002;
|
|
|
|
pub const AI_NUMERICHOST: ::c_int = 0x0004;
|
|
|
|
pub const AI_V4MAPPED: ::c_int = 0x0008;
|
|
|
|
pub const AI_ALL: ::c_int = 0x0010;
|
|
|
|
pub const AI_ADDRCONFIG: ::c_int = 0x0020;
|
|
|
|
|
|
|
|
pub const AI_NUMERICSERV: ::c_int = 0x0400;
|
|
|
|
|
|
|
|
pub const EAI_BADFLAGS: ::c_int = -1;
|
|
|
|
pub const EAI_NONAME: ::c_int = -2;
|
|
|
|
pub const EAI_AGAIN: ::c_int = -3;
|
|
|
|
pub const EAI_FAIL: ::c_int = -4;
|
|
|
|
pub const EAI_FAMILY: ::c_int = -6;
|
|
|
|
pub const EAI_SOCKTYPE: ::c_int = -7;
|
|
|
|
pub const EAI_SERVICE: ::c_int = -8;
|
|
|
|
pub const EAI_MEMORY: ::c_int = -10;
|
|
|
|
pub const EAI_OVERFLOW: ::c_int = -12;
|
|
|
|
|
|
|
|
pub const NI_NUMERICHOST: ::c_int = 1;
|
|
|
|
pub const NI_NUMERICSERV: ::c_int = 2;
|
|
|
|
pub const NI_NOFQDN: ::c_int = 4;
|
|
|
|
pub const NI_NAMEREQD: ::c_int = 8;
|
|
|
|
pub const NI_DGRAM: ::c_int = 16;
|
|
|
|
|
2016-09-07 19:15:49 +02:00
|
|
|
pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
|
|
|
|
pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
|
|
|
|
pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
|
2016-09-07 02:20:00 +02:00
|
|
|
|
2016-09-19 12:29:45 +02:00
|
|
|
pub const EAI_SYSTEM: ::c_int = -11;
|
|
|
|
|
2016-11-13 23:03:14 +01:00
|
|
|
pub const AIO_CANCELED: ::c_int = 0;
|
|
|
|
pub const AIO_NOTCANCELED: ::c_int = 1;
|
|
|
|
pub const AIO_ALLDONE: ::c_int = 2;
|
|
|
|
pub const LIO_READ: ::c_int = 0;
|
|
|
|
pub const LIO_WRITE: ::c_int = 1;
|
|
|
|
pub const LIO_NOP: ::c_int = 2;
|
|
|
|
pub const LIO_WAIT: ::c_int = 0;
|
|
|
|
pub const LIO_NOWAIT: ::c_int = 1;
|
|
|
|
|
2016-12-28 00:40:18 +01:00
|
|
|
pub const MREMAP_MAYMOVE: ::c_int = 1;
|
|
|
|
pub const MREMAP_FIXED: ::c_int = 2;
|
|
|
|
|
2016-12-28 22:59:35 +01:00
|
|
|
pub const PR_SET_PDEATHSIG: ::c_int = 1;
|
|
|
|
pub const PR_GET_PDEATHSIG: ::c_int = 2;
|
|
|
|
|
|
|
|
pub const PR_GET_DUMPABLE: ::c_int = 3;
|
|
|
|
pub const PR_SET_DUMPABLE: ::c_int = 4;
|
|
|
|
|
|
|
|
pub const PR_GET_UNALIGN: ::c_int = 5;
|
|
|
|
pub const PR_SET_UNALIGN: ::c_int = 6;
|
|
|
|
pub const PR_UNALIGN_NOPRINT: ::c_int = 1;
|
|
|
|
pub const PR_UNALIGN_SIGBUS: ::c_int = 2;
|
|
|
|
|
|
|
|
pub const PR_GET_KEEPCAPS: ::c_int = 7;
|
|
|
|
pub const PR_SET_KEEPCAPS: ::c_int = 8;
|
|
|
|
|
|
|
|
pub const PR_GET_FPEMU: ::c_int = 9;
|
|
|
|
pub const PR_SET_FPEMU: ::c_int = 10;
|
|
|
|
pub const PR_FPEMU_NOPRINT: ::c_int = 1;
|
|
|
|
pub const PR_FPEMU_SIGFPE: ::c_int = 2;
|
|
|
|
|
|
|
|
pub const PR_GET_FPEXC: ::c_int = 11;
|
|
|
|
pub const PR_SET_FPEXC: ::c_int = 12;
|
|
|
|
pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80;
|
|
|
|
pub const PR_FP_EXC_DIV: ::c_int = 0x010000;
|
|
|
|
pub const PR_FP_EXC_OVF: ::c_int = 0x020000;
|
|
|
|
pub const PR_FP_EXC_UND: ::c_int = 0x040000;
|
|
|
|
pub const PR_FP_EXC_RES: ::c_int = 0x080000;
|
|
|
|
pub const PR_FP_EXC_INV: ::c_int = 0x100000;
|
|
|
|
pub const PR_FP_EXC_DISABLED: ::c_int = 0;
|
|
|
|
pub const PR_FP_EXC_NONRECOV: ::c_int = 1;
|
|
|
|
pub const PR_FP_EXC_ASYNC: ::c_int = 2;
|
|
|
|
pub const PR_FP_EXC_PRECISE: ::c_int = 3;
|
|
|
|
|
|
|
|
pub const PR_GET_TIMING: ::c_int = 13;
|
|
|
|
pub const PR_SET_TIMING: ::c_int = 14;
|
|
|
|
pub const PR_TIMING_STATISTICAL: ::c_int = 0;
|
|
|
|
pub const PR_TIMING_TIMESTAMP: ::c_int = 1;
|
|
|
|
|
|
|
|
pub const PR_SET_NAME: ::c_int = 15;
|
|
|
|
pub const PR_GET_NAME: ::c_int = 16;
|
|
|
|
|
|
|
|
pub const PR_GET_ENDIAN: ::c_int = 19;
|
|
|
|
pub const PR_SET_ENDIAN: ::c_int = 20;
|
|
|
|
pub const PR_ENDIAN_BIG: ::c_int = 0;
|
|
|
|
pub const PR_ENDIAN_LITTLE: ::c_int = 1;
|
|
|
|
pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2;
|
|
|
|
|
|
|
|
pub const PR_GET_SECCOMP: ::c_int = 21;
|
|
|
|
pub const PR_SET_SECCOMP: ::c_int = 22;
|
|
|
|
|
|
|
|
pub const PR_CAPBSET_READ: ::c_int = 23;
|
|
|
|
pub const PR_CAPBSET_DROP: ::c_int = 24;
|
|
|
|
|
|
|
|
pub const PR_GET_TSC: ::c_int = 25;
|
|
|
|
pub const PR_SET_TSC: ::c_int = 26;
|
|
|
|
pub const PR_TSC_ENABLE: ::c_int = 1;
|
|
|
|
pub const PR_TSC_SIGSEGV: ::c_int = 2;
|
|
|
|
|
|
|
|
pub const PR_GET_SECUREBITS: ::c_int = 27;
|
|
|
|
pub const PR_SET_SECUREBITS: ::c_int = 28;
|
|
|
|
|
|
|
|
pub const PR_SET_TIMERSLACK: ::c_int = 29;
|
|
|
|
pub const PR_GET_TIMERSLACK: ::c_int = 30;
|
|
|
|
|
|
|
|
pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31;
|
|
|
|
pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32;
|
|
|
|
|
|
|
|
pub const PR_MCE_KILL: ::c_int = 33;
|
|
|
|
pub const PR_MCE_KILL_CLEAR: ::c_int = 0;
|
|
|
|
pub const PR_MCE_KILL_SET: ::c_int = 1;
|
|
|
|
|
|
|
|
pub const PR_MCE_KILL_LATE: ::c_int = 0;
|
|
|
|
pub const PR_MCE_KILL_EARLY: ::c_int = 1;
|
|
|
|
pub const PR_MCE_KILL_DEFAULT: ::c_int = 2;
|
|
|
|
|
|
|
|
pub const PR_MCE_KILL_GET: ::c_int = 34;
|
|
|
|
|
|
|
|
pub const PR_SET_MM: ::c_int = 35;
|
|
|
|
pub const PR_SET_MM_START_CODE: ::c_int = 1;
|
|
|
|
pub const PR_SET_MM_END_CODE: ::c_int = 2;
|
|
|
|
pub const PR_SET_MM_START_DATA: ::c_int = 3;
|
|
|
|
pub const PR_SET_MM_END_DATA: ::c_int = 4;
|
|
|
|
pub const PR_SET_MM_START_STACK: ::c_int = 5;
|
|
|
|
pub const PR_SET_MM_START_BRK: ::c_int = 6;
|
|
|
|
pub const PR_SET_MM_BRK: ::c_int = 7;
|
|
|
|
pub const PR_SET_MM_ARG_START: ::c_int = 8;
|
|
|
|
pub const PR_SET_MM_ARG_END: ::c_int = 9;
|
|
|
|
pub const PR_SET_MM_ENV_START: ::c_int = 10;
|
|
|
|
pub const PR_SET_MM_ENV_END: ::c_int = 11;
|
|
|
|
pub const PR_SET_MM_AUXV: ::c_int = 12;
|
|
|
|
pub const PR_SET_MM_EXE_FILE: ::c_int = 13;
|
|
|
|
pub const PR_SET_MM_MAP: ::c_int = 14;
|
|
|
|
pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
|
|
|
|
|
|
|
|
pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
|
|
|
|
|
|
|
|
pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
|
|
|
|
pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
|
|
|
|
|
|
|
|
pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38;
|
|
|
|
pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
|
|
|
|
|
|
|
|
pub const PR_GET_TID_ADDRESS: ::c_int = 40;
|
|
|
|
|
|
|
|
pub const PR_SET_THP_DISABLE: ::c_int = 41;
|
|
|
|
pub const PR_GET_THP_DISABLE: ::c_int = 42;
|
|
|
|
|
|
|
|
pub const PR_MPX_ENABLE_MANAGEMENT: ::c_int = 43;
|
|
|
|
pub const PR_MPX_DISABLE_MANAGEMENT: ::c_int = 44;
|
|
|
|
|
|
|
|
pub const PR_SET_FP_MODE: ::c_int = 45;
|
|
|
|
pub const PR_GET_FP_MODE: ::c_int = 46;
|
|
|
|
pub const PR_FP_MODE_FR: ::c_int = 1 << 0;
|
|
|
|
pub const PR_FP_MODE_FRE: ::c_int = 1 << 1;
|
|
|
|
|
|
|
|
pub const PR_CAP_AMBIENT: ::c_int = 47;
|
|
|
|
pub const PR_CAP_AMBIENT_IS_SET: ::c_int = 1;
|
|
|
|
pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2;
|
|
|
|
pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3;
|
|
|
|
pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
|
|
|
|
|
2017-11-01 21:41:58 +01:00
|
|
|
pub const GRND_NONBLOCK: ::c_uint = 0x0001;
|
|
|
|
pub const GRND_RANDOM: ::c_uint = 0x0002;
|
|
|
|
|
add a number of syscalls
vfork, wait4, getresuid, getresgid, personality, vhangup,
swapon, swapoff, getdomainname, setdomainname, iopl, ioperm
2017-06-08 01:26:42 +02:00
|
|
|
pub const ITIMER_REAL: ::c_int = 0;
|
|
|
|
pub const ITIMER_VIRTUAL: ::c_int = 1;
|
|
|
|
pub const ITIMER_PROF: ::c_int = 2;
|
|
|
|
|
2017-09-09 20:41:09 +02:00
|
|
|
pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
|
|
|
|
pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK;
|
2017-09-09 13:02:29 +02:00
|
|
|
pub const TFD_TIMER_ABSTIME: ::c_int = 1;
|
|
|
|
|
2017-05-07 23:40:21 +02:00
|
|
|
pub const XATTR_CREATE: ::c_int = 0x1;
|
|
|
|
pub const XATTR_REPLACE: ::c_int = 0x2;
|
|
|
|
|
2017-06-22 21:15:15 +02:00
|
|
|
pub const _POSIX_VDISABLE: ::cc_t = 0;
|
|
|
|
|
2017-07-17 17:35:16 +02:00
|
|
|
pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
|
|
|
|
pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
|
|
|
|
pub const FALLOC_FL_COLLAPSE_RANGE: ::c_int = 0x08;
|
|
|
|
pub const FALLOC_FL_ZERO_RANGE: ::c_int = 0x10;
|
|
|
|
pub const FALLOC_FL_INSERT_RANGE: ::c_int = 0x20;
|
|
|
|
pub const FALLOC_FL_UNSHARE_RANGE: ::c_int = 0x40;
|
|
|
|
|
2017-05-15 17:15:53 +02:00
|
|
|
// On Linux, libc doesn't define this constant, libattr does instead.
|
|
|
|
// We still define it for Linux as it's defined by libc on other platforms,
|
|
|
|
// and it's mentioned in the man pages for getxattr and setxattr.
|
|
|
|
pub const ENOATTR: ::c_int = ::ENODATA;
|
|
|
|
|
2017-08-27 05:39:46 +02:00
|
|
|
pub const SO_ORIGINAL_DST: ::c_int = 80;
|
|
|
|
pub const IUTF8: ::tcflag_t = 0x00004000;
|
|
|
|
pub const CMSPAR: ::tcflag_t = 0o10000000000;
|
|
|
|
|
2016-03-01 08:02:36 +01:00
|
|
|
f! {
|
|
|
|
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
|
|
|
|
for slot in cpuset.bits.iter_mut() {
|
|
|
|
*slot = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
|
2016-04-10 13:13:46 +02:00
|
|
|
let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
|
|
|
|
let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
|
2016-03-01 08:02:36 +01:00
|
|
|
cpuset.bits[idx] |= 1 << offset;
|
|
|
|
()
|
|
|
|
}
|
|
|
|
|
2016-08-18 21:47:08 +02:00
|
|
|
pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
|
|
|
|
let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
|
|
|
|
let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
|
|
|
|
cpuset.bits[idx] &= !(1 << offset);
|
|
|
|
()
|
|
|
|
}
|
|
|
|
|
2016-03-01 08:02:36 +01:00
|
|
|
pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
|
2016-04-10 13:13:46 +02:00
|
|
|
let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]);
|
|
|
|
let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
|
2016-03-01 08:02:36 +01:00
|
|
|
0 != (cpuset.bits[idx] & (1 << offset))
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
|
|
|
|
set1.bits == set2.bits
|
|
|
|
}
|
2017-04-30 22:23:37 +02:00
|
|
|
|
|
|
|
pub fn major(dev: ::dev_t) -> ::c_uint {
|
|
|
|
let mut major = 0;
|
|
|
|
major |= (dev & 0x00000000000fff00) >> 8;
|
|
|
|
major |= (dev & 0xfffff00000000000) >> 32;
|
|
|
|
major as ::c_uint
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn minor(dev: ::dev_t) -> ::c_uint {
|
|
|
|
let mut minor = 0;
|
2017-08-30 23:49:19 +02:00
|
|
|
minor |= (dev & 0x00000000000000ff) >> 0;
|
2017-04-30 22:23:37 +02:00
|
|
|
minor |= (dev & 0x00000ffffff00000) >> 12;
|
|
|
|
minor as ::c_uint
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
|
|
|
|
let major = major as ::dev_t;
|
|
|
|
let minor = minor as ::dev_t;
|
|
|
|
let mut dev = 0;
|
|
|
|
dev |= (major & 0x00000fff) << 8;
|
|
|
|
dev |= (major & 0xfffff000) << 32;
|
|
|
|
dev |= (minor & 0x000000ff) << 0;
|
|
|
|
dev |= (minor & 0xffffff00) << 12;
|
|
|
|
dev
|
|
|
|
}
|
2016-03-01 08:02:36 +01:00
|
|
|
}
|
|
|
|
|
2015-09-15 23:27:15 +02:00
|
|
|
extern {
|
2016-11-13 22:35:17 +01:00
|
|
|
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
|
|
|
|
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
|
|
|
|
pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
|
|
|
|
pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
|
|
|
|
pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
|
|
|
|
pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int,
|
|
|
|
timeout: *const ::timespec) -> ::c_int;
|
|
|
|
pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
|
|
|
|
pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
|
|
|
|
nitems: ::c_int, sevp: *mut ::sigevent) -> ::c_int;
|
|
|
|
|
2016-08-27 18:32:35 +02:00
|
|
|
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
|
|
|
|
|
2016-07-31 11:00:15 +02:00
|
|
|
pub fn setpwent();
|
2017-08-10 20:28:27 +02:00
|
|
|
pub fn endpwent();
|
2016-07-31 11:00:15 +02:00
|
|
|
pub fn getpwent() -> *mut passwd;
|
2016-09-26 22:00:29 +02:00
|
|
|
pub fn setspent();
|
|
|
|
pub fn endspent();
|
|
|
|
pub fn getspent() -> *mut spwd;
|
|
|
|
pub fn getspnam(__name: *const ::c_char) -> *mut spwd;
|
|
|
|
|
2015-09-16 01:49:37 +02:00
|
|
|
pub fn shm_open(name: *const c_char, oflag: ::c_int,
|
|
|
|
mode: mode_t) -> ::c_int;
|
2016-09-17 22:17:17 +02:00
|
|
|
|
|
|
|
// System V IPC
|
2015-12-14 00:09:45 +01:00
|
|
|
pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
|
2016-03-01 08:02:36 +01:00
|
|
|
pub fn shmat(shmid: ::c_int,
|
|
|
|
shmaddr: *const ::c_void,
|
|
|
|
shmflg: ::c_int) -> *mut ::c_void;
|
2015-12-14 00:09:45 +01:00
|
|
|
pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
|
2016-03-01 08:02:36 +01:00
|
|
|
pub fn shmctl(shmid: ::c_int,
|
|
|
|
cmd: ::c_int,
|
|
|
|
buf: *mut ::shmid_ds) -> ::c_int;
|
2016-09-17 22:17:17 +02:00
|
|
|
pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
|
2017-05-26 13:35:40 +02:00
|
|
|
pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
|
2017-05-26 22:11:03 +02:00
|
|
|
pub fn semop(semid: ::c_int,
|
|
|
|
sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int;
|
|
|
|
pub fn semctl(semid: ::c_int,
|
|
|
|
semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
|
2016-09-17 22:17:17 +02:00
|
|
|
pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
|
|
|
|
pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
|
|
|
|
pub fn msgrcv(msqid: ::c_int, msgp: *mut ::c_void, msgsz: ::size_t,
|
|
|
|
msgtyp: ::c_long, msgflg: ::c_int) -> ::ssize_t;
|
|
|
|
pub fn msgsnd(msqid: ::c_int, msgp: *const ::c_void, msgsz: ::size_t,
|
|
|
|
msgflg: ::c_int) -> ::c_int;
|
|
|
|
|
2015-09-16 02:14:23 +02:00
|
|
|
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
|
|
|
|
-> ::c_int;
|
2015-09-17 23:47:40 +02:00
|
|
|
pub fn __errno_location() -> *mut ::c_int;
|
2015-09-18 02:25:52 +02:00
|
|
|
|
2015-10-30 01:36:55 +01:00
|
|
|
pub fn fopen64(filename: *const c_char,
|
|
|
|
mode: *const c_char) -> *mut ::FILE;
|
|
|
|
pub fn freopen64(filename: *const c_char, mode: *const c_char,
|
|
|
|
file: *mut ::FILE) -> *mut ::FILE;
|
|
|
|
pub fn tmpfile64() -> *mut ::FILE;
|
|
|
|
pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
|
|
|
|
pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
|
|
|
|
pub fn fseeko64(stream: *mut ::FILE,
|
|
|
|
offset: ::off64_t,
|
|
|
|
whence: ::c_int) -> ::c_int;
|
|
|
|
pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
|
2015-11-04 05:58:44 +01:00
|
|
|
pub fn fallocate(fd: ::c_int, mode: ::c_int,
|
|
|
|
offset: ::off_t, len: ::off_t) -> ::c_int;
|
2015-11-04 06:02:46 +01:00
|
|
|
pub fn posix_fallocate(fd: ::c_int, offset: ::off_t,
|
|
|
|
len: ::off_t) -> ::c_int;
|
2015-11-05 07:20:29 +01:00
|
|
|
pub fn readahead(fd: ::c_int, offset: ::off64_t,
|
|
|
|
count: ::size_t) -> ::ssize_t;
|
2015-12-01 13:29:05 +01:00
|
|
|
pub fn getxattr(path: *const c_char, name: *const c_char,
|
|
|
|
value: *mut ::c_void, size: ::size_t) -> ::ssize_t;
|
|
|
|
pub fn lgetxattr(path: *const c_char, name: *const c_char,
|
|
|
|
value: *mut ::c_void, size: ::size_t) -> ::ssize_t;
|
|
|
|
pub fn fgetxattr(filedes: ::c_int, name: *const c_char,
|
|
|
|
value: *mut ::c_void, size: ::size_t) -> ::ssize_t;
|
|
|
|
pub fn setxattr(path: *const c_char, name: *const c_char,
|
|
|
|
value: *const ::c_void, size: ::size_t,
|
|
|
|
flags: ::c_int) -> ::c_int;
|
|
|
|
pub fn lsetxattr(path: *const c_char, name: *const c_char,
|
|
|
|
value: *const ::c_void, size: ::size_t,
|
|
|
|
flags: ::c_int) -> ::c_int;
|
|
|
|
pub fn fsetxattr(filedes: ::c_int, name: *const c_char,
|
|
|
|
value: *const ::c_void, size: ::size_t,
|
|
|
|
flags: ::c_int) -> ::c_int;
|
|
|
|
pub fn listxattr(path: *const c_char, list: *mut c_char,
|
|
|
|
size: ::size_t) -> ::ssize_t;
|
|
|
|
pub fn llistxattr(path: *const c_char, list: *mut c_char,
|
|
|
|
size: ::size_t) -> ::ssize_t;
|
|
|
|
pub fn flistxattr(filedes: ::c_int, list: *mut c_char,
|
|
|
|
size: ::size_t) -> ::ssize_t;
|
|
|
|
pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int;
|
|
|
|
pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int;
|
|
|
|
pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int;
|
2015-12-03 20:44:14 +01:00
|
|
|
pub fn signalfd(fd: ::c_int,
|
|
|
|
mask: *const ::sigset_t,
|
|
|
|
flags: ::c_int) -> ::c_int;
|
2017-09-09 13:02:29 +02:00
|
|
|
pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int;
|
|
|
|
pub fn timerfd_gettime(fd: ::c_int,
|
|
|
|
curr_value: *mut itimerspec) -> ::c_int;
|
|
|
|
pub fn timerfd_settime(fd: ::c_int,
|
|
|
|
flags: ::c_int,
|
|
|
|
new_value: *const itimerspec,
|
|
|
|
old_value: *mut itimerspec) -> ::c_int;
|
2015-12-03 20:44:14 +01:00
|
|
|
pub fn pwritev(fd: ::c_int,
|
|
|
|
iov: *const ::iovec,
|
|
|
|
iovcnt: ::c_int,
|
|
|
|
offset: ::off_t) -> ::ssize_t;
|
|
|
|
pub fn preadv(fd: ::c_int,
|
|
|
|
iov: *const ::iovec,
|
|
|
|
iovcnt: ::c_int,
|
|
|
|
offset: ::off_t) -> ::ssize_t;
|
|
|
|
pub fn quotactl(cmd: ::c_int,
|
|
|
|
special: *const ::c_char,
|
|
|
|
id: ::c_int,
|
|
|
|
data: *mut ::c_char) -> ::c_int;
|
|
|
|
pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
|
|
|
|
pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
|
|
|
|
pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
|
|
|
|
pub fn mq_receive(mqd: ::mqd_t,
|
|
|
|
msg_ptr: *mut ::c_char,
|
|
|
|
msg_len: ::size_t,
|
|
|
|
msq_prio: *mut ::c_uint) -> ::ssize_t;
|
|
|
|
pub fn mq_send(mqd: ::mqd_t,
|
|
|
|
msg_ptr: *const ::c_char,
|
|
|
|
msg_len: ::size_t,
|
|
|
|
msq_prio: ::c_uint) -> ::c_int;
|
|
|
|
pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
|
|
|
|
pub fn mq_setattr(mqd: ::mqd_t,
|
|
|
|
newattr: *const ::mq_attr,
|
|
|
|
oldattr: *mut ::mq_attr) -> ::c_int;
|
|
|
|
pub fn epoll_pwait(epfd: ::c_int,
|
|
|
|
events: *mut ::epoll_event,
|
|
|
|
maxevents: ::c_int,
|
|
|
|
timeout: ::c_int,
|
|
|
|
sigmask: *const ::sigset_t) -> ::c_int;
|
|
|
|
pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
|
2016-02-15 06:40:19 +01:00
|
|
|
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
|
2016-03-01 08:02:36 +01:00
|
|
|
pub fn mkostemps(template: *mut ::c_char,
|
|
|
|
suffixlen: ::c_int,
|
|
|
|
flags: ::c_int) -> ::c_int;
|
2016-02-28 16:06:45 +01:00
|
|
|
pub fn sigtimedwait(set: *const sigset_t,
|
|
|
|
info: *mut siginfo_t,
|
|
|
|
timeout: *const ::timespec) -> ::c_int;
|
|
|
|
pub fn sigwaitinfo(set: *const sigset_t,
|
|
|
|
info: *mut siginfo_t) -> ::c_int;
|
2016-04-01 03:08:03 +02:00
|
|
|
pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
|
2016-04-27 20:04:31 +02:00
|
|
|
pub fn getnameinfo(sa: *const ::sockaddr,
|
|
|
|
salen: ::socklen_t,
|
|
|
|
host: *mut ::c_char,
|
|
|
|
hostlen: ::socklen_t,
|
|
|
|
serv: *mut ::c_char,
|
|
|
|
sevlen: ::socklen_t,
|
|
|
|
flags: ::c_int) -> ::c_int;
|
2017-06-13 13:49:12 +02:00
|
|
|
pub fn pthread_setschedprio(native: ::pthread_t,
|
|
|
|
priority: ::c_int) -> ::c_int;
|
2016-04-27 20:29:19 +02:00
|
|
|
pub fn prlimit(pid: ::pid_t, resource: ::c_int, new_limit: *const ::rlimit,
|
|
|
|
old_limit: *mut ::rlimit) -> ::c_int;
|
|
|
|
pub fn prlimit64(pid: ::pid_t,
|
|
|
|
resource: ::c_int,
|
|
|
|
new_limit: *const ::rlimit64,
|
|
|
|
old_limit: *mut ::rlimit64) -> ::c_int;
|
2016-05-11 19:06:14 +02:00
|
|
|
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
|
2016-05-11 14:44:27 +02:00
|
|
|
pub fn process_vm_readv(pid: ::pid_t,
|
|
|
|
local_iov: *const ::iovec,
|
|
|
|
liovcnt: ::c_ulong,
|
|
|
|
remote_iov: *const ::iovec,
|
|
|
|
riovcnt: ::c_ulong,
|
|
|
|
flags: ::c_ulong) -> isize;
|
|
|
|
pub fn process_vm_writev(pid: ::pid_t,
|
|
|
|
local_iov: *const ::iovec,
|
|
|
|
liovcnt: ::c_ulong,
|
|
|
|
remote_iov: *const ::iovec,
|
|
|
|
riovcnt: ::c_ulong,
|
|
|
|
flags: ::c_ulong) -> isize;
|
2016-07-12 19:56:43 +02:00
|
|
|
pub fn reboot(how_to: ::c_int) -> ::c_int;
|
2016-11-05 21:19:53 +01:00
|
|
|
pub fn setfsgid(gid: ::gid_t) -> ::c_int;
|
|
|
|
pub fn setfsuid(uid: ::uid_t) -> ::c_int;
|
2016-06-10 02:33:32 +02:00
|
|
|
|
|
|
|
// Not available now on Android
|
|
|
|
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
|
|
|
|
mode: ::mode_t) -> ::c_int;
|
2016-07-12 09:32:42 +02:00
|
|
|
pub fn if_nameindex() -> *mut if_nameindex;
|
|
|
|
pub fn if_freenameindex(ptr: *mut if_nameindex);
|
2016-09-07 02:20:00 +02:00
|
|
|
pub fn sync_file_range(fd: ::c_int, offset: ::off64_t,
|
|
|
|
nbytes: ::off64_t, flags: ::c_uint) -> ::c_int;
|
2016-02-02 21:21:36 +01:00
|
|
|
pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
|
|
|
|
pub fn freeifaddrs(ifa: *mut ::ifaddrs);
|
2016-12-28 00:40:18 +01:00
|
|
|
|
|
|
|
pub fn mremap(addr: *mut ::c_void,
|
|
|
|
len: ::size_t,
|
|
|
|
new_len: ::size_t,
|
|
|
|
flags: ::c_int,
|
|
|
|
...) -> *mut ::c_void;
|
2017-02-27 20:41:57 +01:00
|
|
|
|
|
|
|
pub fn glob(pattern: *const c_char,
|
|
|
|
flags: ::c_int,
|
|
|
|
errfunc: Option<extern fn(epath: *const c_char,
|
|
|
|
errno: ::c_int) -> ::c_int>,
|
2017-02-27 21:25:55 +01:00
|
|
|
pglob: *mut ::glob_t) -> ::c_int;
|
|
|
|
pub fn globfree(pglob: *mut ::glob_t);
|
2017-02-27 20:41:57 +01:00
|
|
|
|
|
|
|
pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
|
|
|
|
-> ::c_int;
|
|
|
|
|
2017-02-27 21:25:55 +01:00
|
|
|
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
|
2017-02-27 20:41:57 +01:00
|
|
|
|
2017-02-27 21:25:55 +01:00
|
|
|
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
|
2017-02-27 20:41:57 +01:00
|
|
|
|
2017-02-27 21:25:55 +01:00
|
|
|
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
|
2017-02-27 20:41:57 +01:00
|
|
|
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
|
|
|
|
-> ::c_int;
|
|
|
|
|
|
|
|
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
|
|
|
|
|
|
|
|
pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
|
2017-02-27 21:25:55 +01:00
|
|
|
flags: ::c_int, addr: *mut ::sockaddr,
|
|
|
|
addrlen: *mut ::socklen_t) -> ::ssize_t;
|
2017-02-27 20:41:57 +01:00
|
|
|
pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
|
|
|
|
pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
|
|
|
|
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
|
|
|
|
|
2017-02-27 21:25:55 +01:00
|
|
|
pub fn bind(socket: ::c_int, address: *const ::sockaddr,
|
|
|
|
address_len: ::socklen_t) -> ::c_int;
|
2017-02-27 20:41:57 +01:00
|
|
|
|
|
|
|
pub fn writev(fd: ::c_int,
|
|
|
|
iov: *const ::iovec,
|
|
|
|
iovcnt: ::c_int) -> ::ssize_t;
|
|
|
|
pub fn readv(fd: ::c_int,
|
|
|
|
iov: *const ::iovec,
|
|
|
|
iovcnt: ::c_int) -> ::ssize_t;
|
|
|
|
|
|
|
|
pub fn sendmsg(fd: ::c_int,
|
2017-02-27 21:25:55 +01:00
|
|
|
msg: *const ::msghdr,
|
2017-02-27 20:41:57 +01:00
|
|
|
flags: ::c_int) -> ::ssize_t;
|
2017-02-27 21:54:51 +01:00
|
|
|
pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
|
|
|
|
-> ::ssize_t;
|
2017-06-08 05:19:42 +02:00
|
|
|
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 vhangup() -> ::c_int;
|
2016-04-10 16:21:55 +02:00
|
|
|
pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint,
|
|
|
|
flags: ::c_int) -> ::c_int;
|
|
|
|
pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut mmsghdr, vlen: ::c_uint,
|
|
|
|
flags: ::c_int, timeout: *mut ::timespec) -> ::c_int;
|
2017-05-26 17:52:12 +02:00
|
|
|
pub fn sync();
|
2017-08-27 05:39:46 +02:00
|
|
|
pub fn syscall(num: ::c_long, ...) -> ::c_long;
|
|
|
|
pub fn sched_getaffinity(pid: ::pid_t,
|
|
|
|
cpusetsize: ::size_t,
|
|
|
|
cpuset: *mut cpu_set_t) -> ::c_int;
|
|
|
|
pub fn sched_setaffinity(pid: ::pid_t,
|
|
|
|
cpusetsize: ::size_t,
|
|
|
|
cpuset: *const cpu_set_t) -> ::c_int;
|
|
|
|
pub fn epoll_create(size: ::c_int) -> ::c_int;
|
|
|
|
pub fn epoll_create1(flags: ::c_int) -> ::c_int;
|
|
|
|
pub fn epoll_wait(epfd: ::c_int,
|
|
|
|
events: *mut ::epoll_event,
|
|
|
|
maxevents: ::c_int,
|
|
|
|
timeout: ::c_int) -> ::c_int;
|
|
|
|
pub fn epoll_ctl(epfd: ::c_int,
|
|
|
|
op: ::c_int,
|
|
|
|
fd: ::c_int,
|
|
|
|
event: *mut ::epoll_event) -> ::c_int;
|
|
|
|
pub fn pthread_getschedparam(native: ::pthread_t,
|
|
|
|
policy: *mut ::c_int,
|
|
|
|
param: *mut ::sched_param) -> ::c_int;
|
|
|
|
pub fn unshare(flags: ::c_int) -> ::c_int;
|
|
|
|
pub fn umount(target: *const ::c_char) -> ::c_int;
|
|
|
|
pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
|
|
|
|
pub fn tee(fd_in: ::c_int,
|
|
|
|
fd_out: ::c_int,
|
|
|
|
len: ::size_t,
|
|
|
|
flags: ::c_uint) -> ::ssize_t;
|
|
|
|
pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
|
|
|
|
pub fn splice(fd_in: ::c_int,
|
|
|
|
off_in: *mut ::loff_t,
|
|
|
|
fd_out: ::c_int,
|
|
|
|
off_out: *mut ::loff_t,
|
|
|
|
len: ::size_t,
|
|
|
|
flags: ::c_uint) -> ::ssize_t;
|
|
|
|
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
|
|
|
|
pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
|
|
|
|
pub fn sem_timedwait(sem: *mut sem_t,
|
|
|
|
abstime: *const ::timespec) -> ::c_int;
|
|
|
|
pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
|
|
|
|
pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int;
|
|
|
|
pub fn swapoff(puath: *const ::c_char) -> ::c_int;
|
|
|
|
pub fn vmsplice(fd: ::c_int,
|
|
|
|
iov: *const ::iovec,
|
|
|
|
nr_segs: ::size_t,
|
|
|
|
flags: ::c_uint) -> ::ssize_t;
|
|
|
|
pub fn mount(src: *const ::c_char,
|
|
|
|
target: *const ::c_char,
|
|
|
|
fstype: *const ::c_char,
|
|
|
|
flags: ::c_ulong,
|
|
|
|
data: *const ::c_void) -> ::c_int;
|
|
|
|
pub fn personality(persona: ::c_ulong) -> ::c_int;
|
|
|
|
pub fn prctl(option: ::c_int, ...) -> ::c_int;
|
|
|
|
pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
|
|
|
|
pub fn ppoll(fds: *mut ::pollfd,
|
|
|
|
nfds: nfds_t,
|
|
|
|
timeout: *const ::timespec,
|
|
|
|
sigmask: *const sigset_t) -> ::c_int;
|
|
|
|
pub fn pthread_mutex_timedlock(lock: *mut pthread_mutex_t,
|
|
|
|
abstime: *const ::timespec) -> ::c_int;
|
|
|
|
pub fn clone(cb: extern fn(*mut ::c_void) -> ::c_int,
|
|
|
|
child_stack: *mut ::c_void,
|
|
|
|
flags: ::c_int,
|
|
|
|
arg: *mut ::c_void, ...) -> ::c_int;
|
|
|
|
pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
|
|
|
|
pub fn clock_nanosleep(clk_id: ::clockid_t,
|
|
|
|
flags: ::c_int,
|
|
|
|
rqtp: *const ::timespec,
|
|
|
|
rmtp: *mut ::timespec) -> ::c_int;
|
|
|
|
pub fn pthread_attr_getguardsize(attr: *const ::pthread_attr_t,
|
|
|
|
guardsize: *mut ::size_t) -> ::c_int;
|
|
|
|
pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
|
|
|
|
pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
|
|
|
|
pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t,
|
|
|
|
pshared: *mut ::c_int) -> ::c_int;
|
|
|
|
pub fn sysinfo(info: *mut ::sysinfo) -> ::c_int;
|
|
|
|
pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int;
|
|
|
|
pub fn pthread_setschedparam(native: ::pthread_t,
|
|
|
|
policy: ::c_int,
|
|
|
|
param: *const ::sched_param) -> ::c_int;
|
|
|
|
pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
|
|
|
|
pub fn sched_setscheduler(pid: ::pid_t,
|
|
|
|
policy: ::c_int,
|
|
|
|
param: *const ::sched_param) -> ::c_int;
|
|
|
|
pub fn sendfile(out_fd: ::c_int,
|
|
|
|
in_fd: ::c_int,
|
|
|
|
offset: *mut off_t,
|
|
|
|
count: ::size_t) -> ::ssize_t;
|
|
|
|
pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
|
|
|
|
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")]
|
|
|
|
pub fn getgrgid_r(uid: ::uid_t,
|
|
|
|
grp: *mut ::group,
|
|
|
|
buf: *mut ::c_char,
|
|
|
|
buflen: ::size_t,
|
|
|
|
result: *mut *mut ::group) -> ::c_int;
|
|
|
|
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
|
|
|
link_name = "sigaltstack$UNIX2003")]
|
|
|
|
#[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")]
|
|
|
|
pub fn sigaltstack(ss: *const stack_t,
|
|
|
|
oss: *mut stack_t) -> ::c_int;
|
|
|
|
pub fn sem_close(sem: *mut sem_t) -> ::c_int;
|
|
|
|
pub fn getdtablesize() -> ::c_int;
|
|
|
|
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")]
|
|
|
|
pub fn getgrnam_r(name: *const ::c_char,
|
|
|
|
grp: *mut ::group,
|
|
|
|
buf: *mut ::c_char,
|
|
|
|
buflen: ::size_t,
|
|
|
|
result: *mut *mut ::group) -> ::c_int;
|
2017-09-09 15:38:15 +02:00
|
|
|
pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
|
2017-08-27 05:39:46 +02:00
|
|
|
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
|
|
|
link_name = "pthread_sigmask$UNIX2003")]
|
|
|
|
pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t,
|
|
|
|
oldset: *mut sigset_t) -> ::c_int;
|
|
|
|
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
|
|
|
|
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
|
2017-10-18 12:48:31 +02:00
|
|
|
pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
|
2017-08-27 05:39:46 +02:00
|
|
|
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
|
|
|
|
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
|
|
|
|
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
|
|
|
|
#[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
|
|
|
|
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")]
|
|
|
|
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")]
|
|
|
|
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")]
|
|
|
|
pub fn getpwuid_r(uid: ::uid_t,
|
|
|
|
pwd: *mut passwd,
|
|
|
|
buf: *mut ::c_char,
|
|
|
|
buflen: ::size_t,
|
|
|
|
result: *mut *mut passwd) -> ::c_int;
|
|
|
|
#[cfg_attr(all(target_os = "macos", target_arch ="x86"),
|
|
|
|
link_name = "sigwait$UNIX2003")]
|
|
|
|
#[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]
|
|
|
|
pub fn sigwait(set: *const sigset_t,
|
|
|
|
sig: *mut ::c_int) -> ::c_int;
|
|
|
|
pub fn pthread_atfork(prepare: Option<unsafe extern fn()>,
|
|
|
|
parent: Option<unsafe extern fn()>,
|
|
|
|
child: Option<unsafe extern fn()>) -> ::c_int;
|
|
|
|
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
|
|
|
|
pub fn getgrouplist(user: *const ::c_char,
|
|
|
|
group: ::gid_t,
|
|
|
|
groups: *mut ::gid_t,
|
|
|
|
ngroups: *mut ::c_int) -> ::c_int;
|
|
|
|
pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t,
|
|
|
|
pshared: *mut ::c_int) -> ::c_int;
|
|
|
|
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
|
|
|
|
link_name = "popen$UNIX2003")]
|
|
|
|
pub fn popen(command: *const c_char,
|
|
|
|
mode: *const c_char) -> *mut ::FILE;
|
|
|
|
pub fn faccessat(dirfd: ::c_int, pathname: *const ::c_char,
|
|
|
|
mode: ::c_int, flags: ::c_int) -> ::c_int;
|
|
|
|
pub fn pthread_create(native: *mut ::pthread_t,
|
|
|
|
attr: *const ::pthread_attr_t,
|
|
|
|
f: extern fn(*mut ::c_void) -> *mut ::c_void,
|
|
|
|
value: *mut ::c_void) -> ::c_int;
|
2016-04-10 16:21:55 +02:00
|
|
|
}
|
|
|
|
|
2015-09-18 02:25:52 +02:00
|
|
|
cfg_if! {
|
2017-08-27 05:39:46 +02:00
|
|
|
if #[cfg(any(target_env = "musl", target_os = "fuchsia"))] {
|
2015-10-30 01:36:55 +01:00
|
|
|
mod musl;
|
|
|
|
pub use self::musl::*;
|
2016-11-14 15:40:05 +01:00
|
|
|
} else if #[cfg(any(target_arch = "mips",
|
|
|
|
target_arch = "mips64"))] {
|
2015-09-15 23:27:15 +02:00
|
|
|
mod mips;
|
|
|
|
pub use self::mips::*;
|
2016-09-03 04:08:02 +02:00
|
|
|
} else if #[cfg(any(target_arch = "s390x"))] {
|
|
|
|
mod s390x;
|
|
|
|
pub use self::s390x::*;
|
2015-09-15 23:27:15 +02:00
|
|
|
} else {
|
2015-11-09 22:58:44 +01:00
|
|
|
mod other;
|
|
|
|
pub use self::other::*;
|
2015-09-15 23:27:15 +02:00
|
|
|
}
|
|
|
|
}
|