summaryrefslogtreecommitdiff
path: root/src/unix
diff options
context:
space:
mode:
Diffstat (limited to 'src/unix')
-rw-r--r--src/unix/aix/mod.rs1077
-rw-r--r--src/unix/aix/powerpc64.rs152
-rw-r--r--src/unix/bsd/apple/mod.rs17
-rw-r--r--src/unix/bsd/freebsdlike/dragonfly/mod.rs1
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/mod.rs27
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/x86.rs155
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/mod.rs25
-rw-r--r--src/unix/bsd/netbsdlike/openbsd/mod.rs27
-rw-r--r--src/unix/haiku/mod.rs33
-rw-r--r--src/unix/linux_like/android/mod.rs26
-rw-r--r--src/unix/linux_like/linux/arch/generic/mod.rs11
-rw-r--r--src/unix/linux_like/linux/gnu/b32/arm/mod.rs1
-rw-r--r--src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs35
-rw-r--r--src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs35
-rw-r--r--src/unix/linux_like/linux/mod.rs71
-rw-r--r--src/unix/linux_like/mod.rs8
-rw-r--r--src/unix/redox/mod.rs11
-rw-r--r--src/unix/solarish/mod.rs2
18 files changed, 1650 insertions, 64 deletions
diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs
index 3348ead5b6..ffe3f18284 100644
--- a/src/unix/aix/mod.rs
+++ b/src/unix/aix/mod.rs
@@ -6,16 +6,19 @@ pub type blkcnt_t = ::c_long;
pub type clock_t = ::c_int;
pub type daddr_t = ::c_long;
pub type dev_t = ::c_ulong;
+pub type fpos64_t = ::c_longlong;
pub type fsblkcnt_t = ::c_ulong;
pub type fsfilcnt_t = ::c_ulong;
+pub type idtype_t = ::c_int;
pub type ino_t = ::c_ulong;
-pub type key_t = ::c_long;
+pub type key_t = ::c_int;
pub type mode_t = ::c_uint;
pub type nlink_t = ::c_short;
pub type rlim_t = ::c_ulong;
pub type speed_t = ::c_uint;
pub type tcflag_t = ::c_uint;
pub type time_t = ::c_long;
+pub type time64_t = ::int64_t;
pub type timer_t = ::c_long;
pub type wchar_t = ::c_uint;
pub type nfds_t = ::c_int;
@@ -23,6 +26,7 @@ pub type projid_t = ::c_int;
pub type id_t = ::c_uint;
pub type blksize64_t = ::c_ulonglong;
pub type blkcnt64_t = ::c_ulonglong;
+pub type sctp_assoc_t = ::uint32_t;
pub type suseconds_t = ::c_int;
pub type useconds_t = ::c_uint;
@@ -37,10 +41,13 @@ pub type in_addr_t = ::c_uint;
pub type signal_t = ::c_int;
pub type pthread_t = ::c_uint;
pub type pthread_key_t = ::c_uint;
+pub type thread_t = pthread_t;
pub type blksize_t = ::c_long;
pub type nl_item = ::c_int;
pub type mqd_t = ::c_int;
pub type shmatt_t = ::c_ulong;
+pub type regoff_t = ::c_long;
+pub type rlim64_t = ::c_ulonglong;
pub type sem_t = ::c_int;
pub type pollset_t = ::c_int;
@@ -49,6 +56,9 @@ pub type pthread_rwlockattr_t = *mut ::c_void;
pub type pthread_condattr_t = *mut ::c_void;
pub type pthread_mutexattr_t = *mut ::c_void;
pub type pthread_attr_t = *mut ::c_void;
+pub type pthread_barrierattr_t = *mut ::c_void;
+pub type posix_spawn_file_actions_t = *mut ::c_char;
+pub type iconv_t = *mut ::c_void;
e! {
pub enum uio_rw {
@@ -303,7 +313,7 @@ s! {
pub sigev_value: ::sigval,
pub sigev_signo: ::c_int,
pub sigev_notify: ::c_int,
- pub sigev_notify_function: extern fn(val: sigval),
+ pub sigev_notify_function: extern fn(val: ::sigval),
pub sigev_notify_attributes: *mut pthread_attr_t,
}
@@ -342,6 +352,186 @@ s! {
pub trailer_length: ::c_uint,
pub bytes_sent: ::uint64_t,
}
+
+ pub struct mmsghdr {
+ pub msg_hdr: ::msghdr,
+ pub msg_len: ::c_uint,
+ }
+
+ pub struct sched_param {
+ pub sched_priority: ::c_int,
+ pub sched_policy: ::c_int,
+ pub sched_reserved: [::c_int; 6],
+ }
+
+ pub struct stack_t {
+ pub ss_sp: *mut ::c_void,
+ pub ss_size: ::size_t,
+ pub ss_flags: ::c_int,
+ pub __pad: [::c_int; 4],
+ }
+
+ pub struct posix_spawnattr_t {
+ pub posix_attr_flags: ::c_short,
+ pub posix_attr_pgroup: ::pid_t,
+ pub posix_attr_sigmask: ::sigset_t,
+ pub posix_attr_sigdefault: ::sigset_t,
+ pub posix_attr_schedpolicy: ::c_int,
+ pub posix_attr_schedparam: sched_param,
+ }
+
+ pub struct glob_t {
+ pub gl_pathc: ::size_t,
+ pub gl_pathv: *mut *mut c_char,
+ pub gl_offs: ::size_t,
+ pub gl_padr: *mut ::c_void,
+ pub gl_ptx: *mut ::c_void,
+ }
+
+ pub struct mallinfo {
+ pub arena: ::c_ulong,
+ pub ordblks: ::c_int,
+ pub smblks: ::c_int,
+ pub hblks: ::c_int,
+ pub hblkhd: ::c_int,
+ pub usmblks: ::c_ulong,
+ pub fsmblks: ::c_ulong,
+ pub uordblks: ::c_ulong,
+ pub fordblks: ::c_ulong,
+ pub keepcost: ::c_int,
+ }
+
+ pub struct utmp_exit_status {
+ pub e_termination: ::c_short,
+ pub e_exit: ::c_short,
+ }
+
+ pub struct utmp {
+ pub ut_user: [::c_char; 256],
+ pub ut_id: [::c_char; 14],
+ pub ut_line: [::c_char; 64],
+ pub ut_pid: ::pid_t,
+ pub ut_type: ::c_short,
+ pub ut_time: time64_t,
+ pub ut_exit: utmp_exit_status,
+ pub ut_host: [::c_char; 256],
+ pub __dbl_word_pad: ::c_int,
+ pub __reservedA: [::c_int; 2],
+ pub __reservedV: [::c_int; 6],
+ }
+
+ pub struct regmatch_t {
+ pub rm_so: regoff_t,
+ pub rm_eo: regoff_t,
+ }
+
+ pub struct regex_t {
+ pub re_nsub: ::size_t,
+ pub re_comp: *mut ::c_void,
+ pub re_cflags: ::c_int,
+ pub re_erroff: ::size_t,
+ pub re_len: ::size_t,
+ pub re_ucoll: [::wchar_t; 2],
+ pub re_lsub: [*mut ::c_void; 24],
+ pub re_esub: [*mut ::c_void; 24],
+ pub re_map: *mut ::c_uchar,
+ pub __maxsub: ::c_int,
+ pub __unused: [*mut ::c_void; 34],
+ }
+
+ pub struct rlimit64 {
+ pub rlim_cur: rlim64_t,
+ pub rlim_max: rlim64_t,
+ }
+
+ pub struct shmid_ds {
+ pub shm_perm: ipc_perm,
+ pub shm_segsz: ::size_t,
+ pub shm_lpid: ::pid_t,
+ pub shm_cpid: ::pid_t,
+ pub shm_nattch: shmatt_t,
+ pub shm_cnattch: shmatt_t,
+ pub shm_atime: time_t,
+ pub shm_dtime: time_t,
+ pub shm_ctime: time_t,
+ pub shm_handle: ::uint32_t,
+ pub shm_extshm: ::c_int,
+ pub shm_pagesize: ::int64_t,
+ pub shm_lba: ::uint64_t,
+ pub shm_reserved: ::int64_t,
+ pub shm_reserved1: ::int64_t,
+ }
+
+ pub struct stat64 {
+ pub st_dev: dev_t,
+ pub st_ino: ino_t,
+ pub st_mode: mode_t,
+ pub st_nlink: nlink_t,
+ pub st_flag: ::c_ushort,
+ pub st_uid: ::uid_t,
+ pub st_gid: ::gid_t,
+ pub st_rdev: dev_t,
+ pub st_ssize: ::c_int,
+ pub st_atim: st_timespec,
+ pub st_mtim: st_timespec,
+ pub st_ctim: st_timespec,
+ pub st_blksize: blksize_t,
+ pub st_blocks: blkcnt_t,
+ pub st_vfstype: ::c_int,
+ pub st_vfs: ::c_uint,
+ pub st_type: ::c_uint,
+ pub st_gen: ::c_uint,
+ pub st_reserved: [::c_uint; 10],
+ pub st_size: off64_t,
+ }
+
+ pub struct mntent {
+ pub mnt_fsname: *mut ::c_char,
+ pub mnt_dir: *mut ::c_char,
+ pub mnt_type: *mut ::c_char,
+ pub mnt_opts: *mut ::c_char,
+ pub mnt_freq: ::c_int,
+ pub mnt_passno: ::c_int,
+ }
+
+ pub struct ipc_perm {
+ pub uid: ::uid_t,
+ pub gid: ::gid_t,
+ pub cuid: ::uid_t,
+ pub cgid: ::gid_t,
+ pub mode: mode_t,
+ pub seq: ::c_ushort,
+ pub __reserved: ::c_ushort,
+ pub key: key_t,
+ }
+
+ pub struct entry {
+ pub key: *mut ::c_char,
+ pub data: *mut ::c_void,
+ }
+
+ pub struct mq_attr {
+ pub mq_flags: ::c_long,
+ pub mq_maxmsg: ::c_long,
+ pub mq_msgsize: ::c_long,
+ pub mq_curmsgs: ::c_long,
+ }
+
+ pub struct sembuf {
+ pub sem_num: ::c_ushort,
+ pub sem_op: ::c_short,
+ pub sem_flg: ::c_short,
+ }
+
+ pub struct if_nameindex {
+ pub if_index: ::c_uint,
+ pub if_name: *mut ::c_char,
+ }
+
+ pub struct itimerspec {
+ pub it_interval: ::timespec,
+ pub it_value: ::timespec,
+ }
}
s_no_extra_traits! {
@@ -520,6 +710,8 @@ pub const RTLD_NOW: ::c_int = 0x2;
pub const RTLD_GLOBAL: ::c_int = 0x10000;
pub const RTLD_LOCAL: ::c_int = 0x80000;
pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
+pub const RTLD_MYSELF: *mut ::c_void = -2isize as *mut ::c_void;
+pub const RTLD_NEXT: *mut ::c_void = -3isize as *mut ::c_void;
// fcntl.h
pub const O_RDONLY: ::c_int = 0x0;
@@ -539,6 +731,10 @@ pub const O_EXEC: ::c_int = 0x20;
pub const O_CLOEXEC: ::c_int = 0x800000;
pub const O_ACCMODE: ::c_int = O_RDONLY | O_WRONLY | O_RDWR;
pub const O_DIRECT: ::c_int = 0x8000000;
+pub const O_TTY_INIT: ::c_int = 0;
+pub const O_RSYNC: ::c_int = 0x200000;
+pub const O_LARGEFILE: ::c_int = 0x4000000;
+pub const F_CLOSEM: ::c_int = 10;
pub const F_DUPFD_CLOEXEC: ::c_int = 16;
pub const F_GETLK64: ::c_int = 11;
pub const F_SETLK64: ::c_int = 12;
@@ -562,6 +758,7 @@ pub const F_GETFL: ::c_int = 3;
pub const F_SETFL: ::c_int = 4;
pub const O_SYNC: ::c_int = 16;
pub const O_NONBLOCK: ::c_int = 4;
+pub const FASYNC: ::c_int = 0x20000;
pub const POSIX_FADV_NORMAL: ::c_int = 1;
pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_FADV_RANDOM: ::c_int = 3;
@@ -580,6 +777,7 @@ pub const GLOB_NOESCAPE: ::c_int = 0x80;
pub const GLOB_NOSPACE: ::c_int = 0x2000;
pub const GLOB_ABORTED: ::c_int = 0x1000;
pub const GLOB_NOMATCH: ::c_int = 0x4000;
+pub const GLOB_NOSYS: ::c_int = 0x8000;
// langinfo.h
pub const DAY_1: ::nl_item = 13;
@@ -641,6 +839,7 @@ pub const YESEXPR: ::nl_item = 61;
pub const NOEXPR: ::nl_item = 62;
// locale.h
+pub const LC_GLOBAL_LOCALE: ::locale_t = -1isize as ::locale_t;
pub const LC_CTYPE: ::c_int = 1;
pub const LC_NUMERIC: ::c_int = 3;
pub const LC_TIME: ::c_int = 4;
@@ -690,6 +889,33 @@ pub const AI_ALL: ::c_int = 0x20;
pub const AI_NUMERICSERV: ::c_int = 0x40;
pub const AI_EXTFLAGS: ::c_int = 0x80;
pub const AI_DEFAULT: ::c_int = AI_V4MAPPED | AI_ADDRCONFIG;
+pub const IPV6_ADDRFORM: ::c_int = 22;
+pub const IPV6_ADDR_PREFERENCES: ::c_int = 74;
+pub const IPV6_CHECKSUM: ::c_int = 39;
+pub const IPV6_DONTFRAG: ::c_int = 45;
+pub const IPV6_DSTOPTS: ::c_int = 54;
+pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 16777215;
+pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 251658240;
+pub const IPV6_HOPLIMIT: ::c_int = 40;
+pub const IPV6_HOPOPTS: ::c_int = 52;
+pub const IPV6_NEXTHOP: ::c_int = 48;
+pub const IPV6_PATHMTU: ::c_int = 46;
+pub const IPV6_PKTINFO: ::c_int = 33;
+pub const IPV6_PREFER_SRC_CGA: ::c_int = 16;
+pub const IPV6_PREFER_SRC_COA: ::c_int = 2;
+pub const IPV6_PREFER_SRC_HOME: ::c_int = 1;
+pub const IPV6_PREFER_SRC_NONCGA: ::c_int = 32;
+pub const IPV6_PREFER_SRC_PUBLIC: ::c_int = 4;
+pub const IPV6_PREFER_SRC_TMP: ::c_int = 8;
+pub const IPV6_RECVDSTOPTS: ::c_int = 56;
+pub const IPV6_RECVHOPLIMIT: ::c_int = 41;
+pub const IPV6_RECVHOPOPTS: ::c_int = 53;
+pub const IPV6_RECVPATHMTU: ::c_int = 47;
+pub const IPV6_RECVRTHDR: ::c_int = 51;
+pub const IPV6_RECVTCLASS: ::c_int = 42;
+pub const IPV6_RTHDR: ::c_int = 50;
+pub const IPV6_RTHDRDSTOPTS: ::c_int = 55;
+pub const IPV6_TCLASS: ::c_int = 43;
// net/bpf.h
pub const DLT_NULL: ::c_int = 0x18;
@@ -716,8 +942,50 @@ pub const BIOCGSTATS: ::c_int = 0x4008426f;
pub const BIOCIMMEDIATE: ::c_int = 0x80044270;
pub const BIOCVERSION: ::c_int = 0x40044271;
pub const BIOCSDEVNO: ::c_int = 0x20004272;
+pub const BIOCGETIF: ::c_ulong = 0x4020426b;
+pub const BIOCSETIF: ::c_ulong = 0xffffffff8020426c;
+pub const BPF_ABS: ::c_int = 32;
+pub const BPF_ADD: ::c_int = 0;
+pub const BPF_ALIGNMENT: ::c_ulong = 4;
+pub const BPF_ALU: ::c_int = 4;
+pub const BPF_AND: ::c_int = 80;
+pub const BPF_B: ::c_int = 16;
+pub const BPF_DIV: ::c_int = 48;
+pub const BPF_H: ::c_int = 8;
+pub const BPF_IMM: ::c_int = 0;
+pub const BPF_IND: ::c_int = 64;
+pub const BPF_JA: ::c_int = 0;
+pub const BPF_JEQ: ::c_int = 16;
+pub const BPF_JGE: ::c_int = 48;
+pub const BPF_JGT: ::c_int = 32;
+pub const BPF_JMP: ::c_int = 5;
+pub const BPF_JSET: ::c_int = 64;
+pub const BPF_K: ::c_int = 0;
+pub const BPF_LD: ::c_int = 0;
+pub const BPF_LDX: ::c_int = 1;
+pub const BPF_LEN: ::c_int = 128;
+pub const BPF_LSH: ::c_int = 96;
+pub const BPF_MAXINSNS: ::c_int = 512;
+pub const BPF_MEM: ::c_int = 96;
+pub const BPF_MEMWORDS: ::c_int = 16;
+pub const BPF_MISC: ::c_int = 7;
+pub const BPF_MSH: ::c_int = 160;
+pub const BPF_MUL: ::c_int = 32;
+pub const BPF_NEG: ::c_int = 128;
+pub const BPF_OR: ::c_int = 64;
+pub const BPF_RET: ::c_int = 6;
+pub const BPF_RSH: ::c_int = 112;
+pub const BPF_ST: ::c_int = 2;
+pub const BPF_STX: ::c_int = 3;
+pub const BPF_SUB: ::c_int = 16;
+pub const BPF_W: ::c_int = 0;
+pub const BPF_X: ::c_int = 8;
// net/if.h
+pub const IFNET_SLOWHZ: ::c_int = 1;
+pub const IFQ_MAXLEN: ::c_int = 50;
+pub const IF_NAMESIZE: ::c_int = 16;
+pub const IFNAMSIZ: ::c_int = 16;
pub const IFF_UP: ::c_int = 0x1;
pub const IFF_BROADCAST: ::c_int = 0x2;
pub const IFF_DEBUG: ::c_int = 0x4;
@@ -729,6 +997,19 @@ pub const IFF_NOARP: ::c_int = 0x80;
pub const IFF_PROMISC: ::c_int = 0x100;
pub const IFF_ALLMULTI: ::c_int = 0x200;
pub const IFF_MULTICAST: ::c_int = 0x80000;
+pub const IFF_LINK0: ::c_int = 0x100000;
+pub const IFF_LINK1: ::c_int = 0x200000;
+pub const IFF_LINK2: ::c_int = 0x400000;
+pub const IFF_OACTIVE: ::c_int = 0x400;
+pub const IFF_SIMPLEX: ::c_int = 0x800;
+
+// net/if_arp.h
+pub const ARPHRD_ETHER: ::c_int = 1;
+pub const ARPHRD_802_5: ::c_int = 6;
+pub const ARPHRD_802_3: ::c_int = 6;
+pub const ARPHRD_FDDI: ::c_int = 1;
+pub const ARPOP_REQUEST: ::c_int = 1;
+pub const ARPOP_REPLY: ::c_int = 2;
// net/route.h
pub const RTM_ADD: ::c_int = 0x1;
@@ -878,6 +1159,46 @@ pub const IPV6_ADD_MEMBERSHIP: ::c_int = IP_ADD_MEMBERSHIP;
pub const IPV6_DROP_MEMBERSHIP: ::c_int = IP_DROP_MEMBERSHIP;
pub const IPV6_JOIN_GROUP: ::c_int = IP_ADD_MEMBERSHIP;
pub const IPV6_LEAVE_GROUP: ::c_int = IP_DROP_MEMBERSHIP;
+pub const MCAST_BLOCK_SOURCE: ::c_int = 64;
+pub const MCAST_EXCLUDE: ::c_int = 2;
+pub const MCAST_INCLUDE: ::c_int = 1;
+pub const MCAST_JOIN_GROUP: ::c_int = 62;
+pub const MCAST_JOIN_SOURCE_GROUP: ::c_int = 66;
+pub const MCAST_LEAVE_GROUP: ::c_int = 63;
+pub const MCAST_LEAVE_SOURCE_GROUP: ::c_int = 67;
+pub const MCAST_UNBLOCK_SOURCE: ::c_int = 65;
+
+// netinet/ip.h
+pub const MAXTTL: ::c_int = 255;
+pub const IPDEFTTL: ::c_int = 64;
+pub const IPOPT_CONTROL: ::c_int = 0;
+pub const IPOPT_EOL: ::c_int = 0;
+pub const IPOPT_LSRR: ::c_int = 131;
+pub const IPOPT_MINOFF: ::c_int = 4;
+pub const IPOPT_NOP: ::c_int = 1;
+pub const IPOPT_OFFSET: ::c_int = 2;
+pub const IPOPT_OLEN: ::c_int = 1;
+pub const IPOPT_OPTVAL: ::c_int = 0;
+pub const IPOPT_RESERVED1: ::c_int = 0x20;
+pub const IPOPT_RESERVED2: ::c_int = 0x60;
+pub const IPOPT_RR: ::c_int = 7;
+pub const IPOPT_SSRR: ::c_int = 137;
+pub const IPOPT_TS: ::c_int = 68;
+pub const IPOPT_TS_PRESPEC: ::c_int = 3;
+pub const IPOPT_TS_TSANDADDR: ::c_int = 1;
+pub const IPOPT_TS_TSONLY: ::c_int = 0;
+pub const IPTOS_LOWDELAY: ::c_int = 16;
+pub const IPTOS_PREC_CRITIC_ECP: ::c_int = 160;
+pub const IPTOS_PREC_FLASH: ::c_int = 96;
+pub const IPTOS_PREC_FLASHOVERRIDE: ::c_int = 128;
+pub const IPTOS_PREC_IMMEDIATE: ::c_int = 64;
+pub const IPTOS_PREC_INTERNETCONTROL: ::c_int = 192;
+pub const IPTOS_PREC_NETCONTROL: ::c_int = 224;
+pub const IPTOS_PREC_PRIORITY: ::c_int = 32;
+pub const IPTOS_PREC_ROUTINE: ::c_int = 16;
+pub const IPTOS_RELIABILITY: ::c_int = 4;
+pub const IPTOS_THROUGHPUT: ::c_int = 8;
+pub const IPVERSION: ::c_int = 4;
// netinet/tcp.h
pub const TCP_NODELAY: ::c_int = 0x1;
@@ -899,6 +1220,59 @@ pub const PTHREAD_MUTEX_NORMAL: ::c_int = 5;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 3;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 4;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
+pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1;
+pub const PTHREAD_MUTEX_STALLED: ::c_int = 0;
+pub const PTHREAD_PRIO_INHERIT: ::c_int = 3;
+pub const PTHREAD_PRIO_NONE: ::c_int = 1;
+pub const PTHREAD_PRIO_PROTECT: ::c_int = 2;
+
+// regex.h
+pub const REG_EXTENDED: ::c_int = 1;
+pub const REG_ICASE: ::c_int = 2;
+pub const REG_NEWLINE: ::c_int = 4;
+pub const REG_NOSUB: ::c_int = 8;
+pub const REG_NOTBOL: ::c_int = 0x100;
+pub const REG_NOTEOL: ::c_int = 0x200;
+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_ECHAR: ::c_int = 14;
+pub const REG_EBOL: ::c_int = 15;
+pub const REG_EEOL: ::c_int = 16;
+pub const REG_ENOSYS: ::c_int = 17;
+
+// rpcsvc/mount.h
+pub const NFSMNT_ACDIRMAX: ::c_int = 2048;
+pub const NFSMNT_ACDIRMIN: ::c_int = 1024;
+pub const NFSMNT_ACREGMAX: ::c_int = 512;
+pub const NFSMNT_ACREGMIN: ::c_int = 256;
+pub const NFSMNT_INT: ::c_int = 64;
+pub const NFSMNT_NOAC: ::c_int = 128;
+pub const NFSMNT_RETRANS: ::c_int = 16;
+pub const NFSMNT_RSIZE: ::c_int = 4;
+pub const NFSMNT_SOFT: ::c_int = 1;
+pub const NFSMNT_TIMEO: ::c_int = 8;
+pub const NFSMNT_WSIZE: ::c_int = 2;
+
+// rpcsvc/rstat.h
+pub const CPUSTATES: ::c_int = 4;
+
+// search.h
+pub const FIND: ::c_int = 0;
+pub const ENTER: ::c_int = 1;
+
+// semaphore.h
+pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t;
// spawn.h
pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x1;
@@ -938,6 +1312,11 @@ pub const X_OK: ::c_int = 1;
pub const LIO_NOP: ::c_int = 0;
pub const LIO_READ: ::c_int = 1;
pub const LIO_WRITE: ::c_int = 2;
+pub const LIO_NOWAIT: ::c_int = 0;
+pub const LIO_WAIT: ::c_int = 1;
+pub const AIO_ALLDONE: ::c_int = 2;
+pub const AIO_CANCELED: ::c_int = 0;
+pub const AIO_NOTCANCELED: ::c_int = 1;
// sys/errno.h
pub const EPERM: ::c_int = 1;
@@ -997,6 +1376,9 @@ pub const ENODATA: ::c_int = 122;
pub const ETIME: ::c_int = 119;
pub const ENOSR: ::c_int = 118;
pub const EREMOTE: ::c_int = 93;
+pub const ENOATTR: ::c_int = 112;
+pub const ESAD: ::c_int = 113;
+pub const ENOTRUST: ::c_int = 114;
pub const ENOLINK: ::c_int = 126;
pub const EPROTO: ::c_int = 121;
pub const EMULTIHOP: ::c_int = 125;
@@ -1115,6 +1497,42 @@ pub const TIOCGETC: ::c_int = 0x40067412;
pub const TANDEM: ::c_int = 0x1;
pub const CBREAK: ::c_int = 0x2;
pub const LCASE: ::c_int = 0x4;
+pub const MDMBUF: ::c_int = 0x800000;
+pub const XTABS: ::c_int = 0xc00;
+pub const SIOCADDMULTI: ::c_int = -2145359567;
+pub const SIOCADDRT: ::c_int = -2143784438;
+pub const SIOCDARP: ::c_int = -2142476000;
+pub const SIOCDELMULTI: ::c_int = -2145359566;
+pub const SIOCDELRT: ::c_int = -2143784437;
+pub const SIOCDIFADDR: ::c_int = -2144835303;
+pub const SIOCGARP: ::c_int = -1068734170;
+pub const SIOCGIFADDR: ::c_int = -1071093471;
+pub const SIOCGIFBRDADDR: ::c_int = -1071093469;
+pub const SIOCGIFCONF: ::c_int = -1072666299;
+pub const SIOCGIFDSTADDR: ::c_int = -1071093470;
+pub const SIOCGIFFLAGS: ::c_int = -1071093487;
+pub const SIOCGIFHWADDR: ::c_int = -1068209771;
+pub const SIOCGIFMETRIC: ::c_int = -1071093481;
+pub const SIOCGIFMTU: ::c_int = -1071093418;
+pub const SIOCGIFNETMASK: ::c_int = -1071093467;
+pub const SIOCSARP: ::c_int = -2142476002;
+pub const SIOCSIFADDR: ::c_int = -2144835316;
+pub const SIOCSIFBRDADDR: ::c_int = -2144835309;
+pub const SIOCSIFDSTADDR: ::c_int = -2144835314;
+pub const SIOCSIFFLAGS: ::c_int = -2144835312;
+pub const SIOCSIFMETRIC: ::c_int = -2144835304;
+pub const SIOCSIFMTU: ::c_int = -2144835240;
+pub const SIOCSIFNETMASK: ::c_int = -2144835306;
+pub const TIOCUCNTL: ::c_int = -2147191706;
+pub const TIOCCONS: ::c_int = -2147191710;
+pub const TIOCPKT: ::c_int = -2147191696;
+pub const TIOCPKT_DATA: ::c_int = 0;
+pub const TIOCPKT_FLUSHREAD: ::c_int = 1;
+pub const TIOCPKT_FLUSHWRITE: ::c_int = 2;
+pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
+pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
+pub const TIOCPKT_START: ::c_int = 8;
+pub const TIOCPKT_STOP: ::c_int = 4;
// sys/ipc.h
pub const IPC_ALLOC: ::c_int = 0o100000;
@@ -1127,6 +1545,10 @@ pub const IPC_R: ::c_int = 0o0400;
pub const IPC_W: ::c_int = 0o0200;
pub const IPC_O: ::c_int = 0o1000;
pub const IPC_NOERROR: ::c_int = 0o10000;
+pub const IPC_STAT: ::c_int = 102;
+pub const IPC_PRIVATE: ::key_t = -1;
+pub const SHM_LOCK: ::c_int = 201;
+pub const SHM_UNLOCK: ::c_int = 202;
// sys/ldr.h
pub const L_GETINFO: ::c_int = 2;
@@ -1140,6 +1562,19 @@ pub const PAGESIZE: ::c_int = 4096;
pub const IOV_MAX: ::c_int = 16;
pub const AIO_LISTIO_MAX: ::c_int = 4096;
pub const PIPE_BUF: usize = 32768;
+pub const OPEN_MAX: ::c_int = 65534;
+pub const MAX_INPUT: ::c_int = 512;
+pub const MAX_CANON: ::c_int = 256;
+pub const ARG_MAX: ::c_int = 1048576;
+pub const BC_BASE_MAX: ::c_int = 99;
+pub const BC_DIM_MAX: ::c_int = 0x800;
+pub const BC_SCALE_MAX: ::c_int = 99;
+pub const BC_STRING_MAX: ::c_int = 0x800;
+pub const CHARCLASS_NAME_MAX: ::c_int = 14;
+pub const CHILD_MAX: ::c_int = 128;
+pub const COLL_WEIGHTS_MAX: ::c_int = 4;
+pub const EXPR_NEST_MAX: ::c_int = 32;
+pub const NZERO: ::c_int = 20;
// sys/lockf.h
pub const F_LOCK: ::c_int = 1;
@@ -1147,6 +1582,11 @@ pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
+// sys/machine.h
+pub const BIG_ENDIAN: ::c_int = 4321;
+pub const LITTLE_ENDIAN: ::c_int = 1234;
+pub const PDP_ENDIAN: ::c_int = 3412;
+
// sys/mman.h
pub const PROT_NONE: ::c_int = 0;
pub const PROT_READ: ::c_int = 1;
@@ -1159,6 +1599,7 @@ pub const MAP_FIXED: ::c_int = 0x100;
pub const MAP_ANON: ::c_int = 0x10;
pub const MAP_ANONYMOUS: ::c_int = 0x10;
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
+pub const MAP_TYPE: ::c_int = 0xf0;
pub const MCL_CURRENT: ::c_int = 0x100;
pub const MCL_FUTURE: ::c_int = 0x200;
pub const MS_SYNC: ::c_int = 0x20;
@@ -1196,6 +1637,12 @@ pub const S_IWOTH: mode_t = 2;
pub const S_IXOTH: mode_t = 1;
pub const S_IFLNK: mode_t = 0o120000;
pub const S_IFSOCK: mode_t = 0o140000;
+pub const S_IEXEC: mode_t = 0o100;
+pub const S_IWRITE: mode_t = 0o200;
+pub const S_IREAD: mode_t = 0o400;
+
+// sys/msg.h
+pub const MSG_NOERROR: ::c_int = 0o10000;
// sys/m_signal.h
pub const SIGSTKSZ: ::size_t = 4096;
@@ -1204,6 +1651,11 @@ pub const MINSIGSTKSZ: ::size_t = 1200;
// sys/params.h
pub const MAXPATHLEN: ::c_int = PATH_MAX + 1;
pub const MAXSYMLINKS: ::c_int = 20;
+pub const MAXHOSTNAMELEN: ::c_int = 256;
+pub const MAXUPRC: ::c_int = 128;
+pub const NGROUPS_MAX: ::c_ulong = 2048;
+pub const NGROUPS: ::c_ulong = NGROUPS_MAX;
+pub const NOFILE: ::c_int = OPEN_MAX;
// sys/poll.h
pub const POLLIN: ::c_short = 0x0001;
@@ -1273,6 +1725,23 @@ pub const PTT_WRITE_FPSCR_HI: ::c_int = 66;
pub const PTT_READ_VSX: ::c_int = 67;
pub const PTT_WRITE_VSX: ::c_int = 68;
pub const PTT_READ_TM: ::c_int = 69;
+pub const PTRACE_ATTACH: ::c_int = 14;
+pub const PTRACE_CONT: ::c_int = 7;
+pub const PTRACE_DETACH: ::c_int = 15;
+pub const PTRACE_GETFPREGS: ::c_int = 12;
+pub const PTRACE_GETREGS: ::c_int = 10;
+pub const PTRACE_KILL: ::c_int = 8;
+pub const PTRACE_PEEKDATA: ::c_int = 2;
+pub const PTRACE_PEEKTEXT: ::c_int = 1;
+pub const PTRACE_PEEKUSER: ::c_int = 3;
+pub const PTRACE_POKEDATA: ::c_int = 5;
+pub const PTRACE_POKETEXT: ::c_int = 4;
+pub const PTRACE_POKEUSER: ::c_int = 6;
+pub const PTRACE_SETFPREGS: ::c_int = 13;
+pub const PTRACE_SETREGS: ::c_int = 11;
+pub const PTRACE_SINGLESTEP: ::c_int = 9;
+pub const PTRACE_SYSCALL: ::c_int = 16;
+pub const PTRACE_TRACEME: ::c_int = 0;
// sys/resource.h
pub const RLIMIT_CPU: ::c_int = 0;
@@ -1290,6 +1759,10 @@ pub const RUSAGE_CHILDREN: ::c_int = -1;
pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;
+pub const RUSAGE_THREAD: ::c_int = 1;
+pub const RLIM_SAVED_MAX: ::c_ulong = RLIM_INFINITY - 1;
+pub const RLIM_SAVED_CUR: ::c_ulong = RLIM_INFINITY - 2;
+pub const RLIM_NLIMITS: ::c_int = 10;
// sys/sched.h
pub const SCHED_OTHER: ::c_int = 0;
@@ -1376,6 +1849,9 @@ pub const SIGPROF: ::c_int = 32;
pub const SIGXCPU: ::c_int = 24;
pub const SIGXFSZ: ::c_int = 25;
pub const SIGTRAP: ::c_int = 5;
+pub const SIGCLD: ::c_int = 20;
+pub const SIGRTMAX: ::c_int = 57;
+pub const SIGRTMIN: ::c_int = 50;
pub const SI_USER: ::c_int = 0;
pub const SI_UNDEFINED: ::c_int = 8;
pub const SI_EMPTY: ::c_int = 9;
@@ -1437,6 +1913,11 @@ 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 SO_TIMESTAMPNS: ::c_int = 0x100a;
+pub const SOMAXCONN: ::c_int = 1024;
+pub const AF_LOCAL: ::c_int = AF_UNIX;
+pub const UIO_MAXIOV: ::c_int = 1024;
+pub const pseudo_AF_XTP: ::c_int = 19;
pub const AF_HYLINK: ::c_int = 15;
pub const AF_APPLETALK: ::c_int = 16;
pub const AF_ISO: ::c_int = 7;
@@ -1670,8 +2151,17 @@ pub const ITIMER_PROF: ::c_int = 2;
pub const ITIMER_VIRT: ::c_int = 3;
pub const ITIMER_REAL1: ::c_int = 20;
pub const ITIMER_REAL_TH: ::c_int = ITIMER_REAL1;
+pub const DST_AUST: ::c_int = 2;
+pub const DST_CAN: ::c_int = 6;
+pub const DST_EET: ::c_int = 5;
+pub const DST_MET: ::c_int = 4;
+pub const DST_NONE: ::c_int = 0;
+pub const DST_USA: ::c_int = 1;
+pub const DST_WET: ::c_int = 3;
// sys/termio.h
+pub const CSTART: ::tcflag_t = 0o21;
+pub const CSTOP: ::tcflag_t = 0o23;
pub const TCGETA: ::c_int = TIOC | 5;
pub const TCSETA: ::c_int = TIOC | 6;
pub const TCSETAW: ::c_int = TIOC | 7;
@@ -1720,6 +2210,15 @@ pub const TIOCMBIC: ::c_int = 0x8004746b;
pub const TIOCMGET: ::c_int = 0x4004746a;
pub const TIOCREMOTE: ::c_int = 0x80047469;
+// sys/user.h
+pub const MAXCOMLEN: ::c_int = 32;
+pub const UF_SYSTEM: ::c_int = 0x1000;
+
+// sys/vattr.h
+pub const AT_FLAGS: ::c_int = 0x80;
+pub const AT_GID: ::c_int = 8;
+pub const AT_UID: ::c_int = 4;
+
// sys/wait.h
pub const P_ALL: ::c_int = 0;
pub const P_PID: ::c_int = 1;
@@ -1729,6 +2228,7 @@ pub const WUNTRACED: ::c_int = 0x2;
pub const WEXITED: ::c_int = 0x04;
pub const WCONTINUED: ::c_int = 0x01000000;
pub const WNOWAIT: ::c_int = 0x10;
+pub const WSTOPPED: ::c_int = _W_STOPPED;
pub const _W_STOPPED: ::c_int = 0x00000040;
pub const _W_SLWTED: ::c_int = 0x0000007c;
pub const _W_SEWTED: ::c_int = 0x0000007d;
@@ -1737,6 +2237,7 @@ pub const _W_STRC: ::c_int = 0x0000007f;
// termios.h
pub const NCCS: usize = 16;
+pub const OLCUC: ::tcflag_t = 2;
pub const CSIZE: ::tcflag_t = 0x00000030;
pub const CS5: ::tcflag_t = 0x00000000;
pub const CS6: ::tcflag_t = 0x00000010;
@@ -2054,7 +2555,7 @@ f! {
::mem::size_of::<::cmsghdr>() as ::c_uint + length
}
- pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
+ pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
::mem::size_of::<::cmsghdr>() as ::c_uint + length
}
@@ -2151,27 +2652,216 @@ safe_f! {
}
}
+#[link(name = "thread")]
+extern "C" {
+ pub fn thr_kill(id: thread_t, sig: ::c_int) -> ::c_int;
+ pub fn thr_self() -> thread_t;
+}
+
+#[link(name = "pthread")]
+extern "C" {
+ 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 pthread_attr_getguardsize(
+ attr: *const ::pthread_attr_t,
+ guardsize: *mut ::size_t,
+ ) -> ::c_int;
+ pub fn pthread_attr_getschedparam(
+ attr: *const ::pthread_attr_t,
+ param: *mut sched_param,
+ ) -> ::c_int;
+ pub fn pthread_attr_getstack(
+ attr: *const ::pthread_attr_t,
+ stackaddr: *mut *mut ::c_void,
+ stacksize: *mut ::size_t,
+ ) -> ::c_int;
+ pub fn pthread_attr_setschedparam(
+ attr: *mut ::pthread_attr_t,
+ param: *const sched_param,
+ ) -> ::c_int;
+ pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int;
+ pub fn pthread_barrier_init(
+ barrier: *mut pthread_barrier_t,
+ attr: *const ::pthread_barrierattr_t,
+ count: ::c_uint,
+ ) -> ::c_int;
+ pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
+ pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+ pub fn pthread_barrierattr_getpshared(
+ attr: *const ::pthread_barrierattr_t,
+ shared: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
+ pub fn pthread_barrierattr_setpshared(
+ attr: *mut ::pthread_barrierattr_t,
+ shared: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
+ pub fn pthread_condattr_getclock(
+ attr: *const pthread_condattr_t,
+ clock_id: *mut clockid_t,
+ ) -> ::c_int;
+ pub fn pthread_condattr_getpshared(
+ attr: *const pthread_condattr_t,
+ pshared: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_condattr_setclock(
+ attr: *mut pthread_condattr_t,
+ clock_id: ::clockid_t,
+ ) -> ::c_int;
+ pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
+ pub fn pthread_create(
+ native: *mut ::pthread_t,
+ attr: *const ::pthread_attr_t,
+ f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+ value: *mut ::c_void,
+ ) -> ::c_int;
+ pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
+ pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
+ pub fn pthread_getschedparam(
+ thread: ::pthread_t,
+ policy: *mut ::c_int,
+ param: *mut sched_param,
+ ) -> ::c_int;
+ pub fn pthread_kill(thread: ::pthread_t, signal: ::c_int) -> ::c_int;
+ pub fn pthread_mutex_consistent(mutex: *mut ::pthread_mutex_t) -> ::c_int;
+ pub fn pthread_mutex_timedlock(
+ lock: *mut pthread_mutex_t,
+ abstime: *const ::timespec,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_getprotocol(
+ attr: *const pthread_mutexattr_t,
+ protocol: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_getpshared(
+ attr: *const pthread_mutexattr_t,
+ pshared: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_getrobust(
+ attr: *mut ::pthread_mutexattr_t,
+ robust: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_setprotocol(
+ attr: *mut pthread_mutexattr_t,
+ protocol: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_setpshared(
+ attr: *mut pthread_mutexattr_t,
+ pshared: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_mutexattr_setrobust(
+ attr: *mut ::pthread_mutexattr_t,
+ robust: ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_rwlockattr_getpshared(
+ attr: *const pthread_rwlockattr_t,
+ val: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
+ pub fn pthread_setschedparam(
+ thread: ::pthread_t,
+ policy: ::c_int,
+ param: *const sched_param,
+ ) -> ::c_int;
+ pub fn pthread_setschedprio(native: ::pthread_t, priority: ::c_int) -> ::c_int;
+ pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
+ pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
+ pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::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;
+}
+
+#[link(name = "iconv")]
+extern "C" {
+ pub fn iconv(
+ cd: iconv_t,
+ inbuf: *mut *mut ::c_char,
+ inbytesleft: *mut ::size_t,
+ outbuf: *mut *mut ::c_char,
+ outbytesleft: *mut ::size_t,
+ ) -> ::size_t;
+ pub fn iconv_close(cd: iconv_t) -> ::c_int;
+ pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
+}
+
extern "C" {
pub fn acct(filename: *const ::c_char) -> ::c_int;
+ pub fn aio_cancel(fildes: ::c_int, aiocbp: *mut ::aiocb) -> ::c_int;
+ pub fn aio_error(aiocbp: *mut ::aiocb) -> ::c_int;
+ #[link_name = "_posix_aio_fsync"]
+ pub fn aio_fsync(op: ::c_int, aiocbp: *mut ::aiocb) -> ::c_int;
+ pub fn aio_read(aiocbp: *mut ::aiocb) -> ::c_int;
+ // pub fn aio_suspend
+ // pub fn aio_write
+ pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
+ pub fn brk(addr: *mut ::c_void) -> ::c_int;
+ pub fn clearenv() -> ::c_int;
+ pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn clock_nanosleep(
+ clk_id: ::clockid_t,
+ flags: ::c_int,
+ rqtp: *const ::timespec,
+ rmtp: *mut ::timespec,
+ ) -> ::c_int;
pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
+ pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
+ pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
+ pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
+ pub fn drand48() -> ::c_double;
+ pub fn duplocale(arg1: ::locale_t) -> ::locale_t;
pub fn endgrent();
+ pub fn endmntent(streamp: *mut ::FILE) -> ::c_int;
pub fn endpwent();
+ pub fn endutent();
+ pub fn endutxent();
+ pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double;
pub fn faccessat(
dirfd: ::c_int,
pathname: *const ::c_char,
mode: ::c_int,
flags: ::c_int,
) -> ::c_int;
+ pub fn fattach(fildes: ::c_int, path: *const ::c_char) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
+ pub fn fexecve(
+ fd: ::c_int,
+ argv: *const *const ::c_char,
+ envp: *const *const ::c_char,
+ ) -> ::c_int;
+ pub fn ffs(value: ::c_int) -> ::c_int;
+ pub fn ffsl(value: ::c_long) -> ::c_int;
+ pub fn ffsll(value: ::c_longlong) -> ::c_int;
pub fn fgetgrent(file: *mut ::FILE) -> *mut ::group;
+ pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
pub fn fgetpwent(file: *mut ::FILE) -> *mut ::passwd;
+ pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE;
+ pub fn freelocale(loc: ::locale_t);
+ pub fn freopen64(
+ filename: *const c_char,
+ mode: *const c_char,
+ file: *mut ::FILE,
+ ) -> *mut ::FILE;
+ pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int;
+ pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
+ pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
pub fn fstatfs64(fd: ::c_int, buf: *mut statfs64) -> ::c_int;
+ pub fn fstatvfs64(fd: ::c_int, buf: *mut statvfs64) -> ::c_int;
+ pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
+ pub fn ftok(path: *const ::c_char, id: ::c_int) -> ::key_t;
+ pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
+ pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
+ pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
+ pub fn getdtablesize() -> ::c_int;
pub fn getgrent() -> *mut ::group;
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
pub fn getgrgid_r(
@@ -2190,6 +2880,18 @@ extern "C" {
result: *mut *mut ::group,
) -> ::c_int;
pub fn getgrset(user: *mut ::c_char) -> *mut ::c_char;
+ pub fn gethostid() -> ::c_long;
+ pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent;
+ pub fn getnameinfo(
+ sa: *const ::sockaddr,
+ salen: ::size_t,
+ host: *mut ::c_char,
+ hostlen: ::size_t,
+ serv: *mut ::c_char,
+ sevlen: ::size_t,
+ flags: ::c_int,
+ ) -> ::c_int;
+ pub fn getpagesize() -> ::c_int;
pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::gid_t) -> ::c_int;
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
pub fn getpwent() -> *mut ::passwd;
@@ -2208,13 +2910,70 @@ extern "C" {
result: *mut *mut passwd,
) -> ::c_int;
pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+ pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
+ pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int;
+ pub fn getutent() -> *mut utmp;
+ pub fn getutid(u: *const utmp) -> *mut utmp;
+ pub fn getutline(u: *const utmp) -> *mut utmp;
+ pub fn getutxent() -> *mut utmpx;
+ pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
+ pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
+ pub fn glob(
+ pattern: *const ::c_char,
+ flags: ::c_int,
+ errfunc: ::Option<extern "C" fn(epath: *const ::c_char, errno: ::c_int) -> ::c_int>,
+ pglob: *mut ::glob_t,
+ ) -> ::c_int;
+ pub fn globfree(pglob: *mut ::glob_t);
+ pub fn hasmntopt(mnt: *const ::mntent, opt: *const ::c_char) -> *mut ::c_char;
+ pub fn hcreate(nelt: ::size_t) -> ::c_int;
+ pub fn hdestroy();
+ pub fn hsearch(entry: entry, action: ::c_int) -> *mut entry;
+ pub fn if_freenameindex(ptr: *mut if_nameindex);
+ pub fn if_nameindex() -> *mut if_nameindex;
pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
pub fn ioctl(fildes: ::c_int, request: ::c_int, ...) -> ::c_int;
+ pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long;
+ pub fn lcong48(p: *mut ::c_ushort);
+ pub fn lfind(
+ key: *const ::c_void,
+ base: *const ::c_void,
+ nelp: *mut ::size_t,
+ width: ::size_t,
+ compar: ::Option<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::c_int>,
+ ) -> *mut ::c_void;
+ pub fn lio_listio(
+ mode: ::c_int,
+ aiocb_list: *const *mut aiocb,
+ nitems: ::c_int,
+ sevp: *mut sigevent,
+ ) -> ::c_int;
pub fn loadquery(flags: ::c_int, buf: *mut ::c_char, buflen: ::c_uint) -> ::c_int;
pub fn lpar_get_info(command: ::c_int, buf: *mut ::c_void, bufsize: ::size_t) -> ::c_int;
pub fn lpar_set_resources(id: ::c_int, resource: *mut ::c_void) -> ::c_int;
+ pub fn lrand48() -> c_long;
+ pub fn lsearch(
+ key: *const ::c_void,
+ base: *mut ::c_void,
+ nelp: *mut ::size_t,
+ width: ::size_t,
+ compar: ::Option<unsafe extern "C" fn(*const ::c_void, *const ::c_void) -> ::c_int>,
+ ) -> *mut ::c_void;
+ pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
+ pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+ pub fn makecontext(ucp: *mut ::ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
+ pub fn mallinfo() -> ::mallinfo;
+ pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
+ pub fn memmem(
+ haystack: *const ::c_void,
+ haystacklen: ::size_t,
+ needle: *const ::c_void,
+ needlelen: ::size_t,
+ ) -> *mut ::c_void;
+ pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
+ pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn mknodat(
dirfd: ::c_int,
@@ -2222,8 +2981,62 @@ extern "C" {
mode: ::mode_t,
dev: dev_t,
) -> ::c_int;
+ pub fn mount(device: *const ::c_char, path: *const ::c_char, flags: ::c_int) -> ::c_int;
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
+ pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
+ pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
+ pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
+ pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
+ pub fn mq_receive(
+ mqd: ::mqd_t,
+ msg_ptr: *mut ::c_char,
+ msg_len: ::size_t,
+ msg_prio: *mut ::c_uint,
+ ) -> ::ssize_t;
+ pub fn mq_send(
+ mqd: ::mqd_t,
+ msg_ptr: *const ::c_char,
+ msg_len: ::size_t,
+ msg_prio: ::c_uint,
+ ) -> ::c_int;
+ pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
+ pub fn mq_timedreceive(
+ mqd: ::mqd_t,
+ msg_ptr: *mut ::c_char,
+ msg_len: ::size_t,
+ msg_prio: *mut ::c_uint,
+ abs_timeout: *const ::timespec,
+ ) -> ::ssize_t;
+ pub fn mq_timedsend(
+ mqd: ::mqd_t,
+ msg_ptr: *const ::c_char,
+ msg_len: ::size_t,
+ msg_prio: ::c_uint,
+ abs_timeout: *const ::timespec,
+ ) -> ::c_int;
+ pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
+ pub fn mrand48() -> c_long;
+ 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;
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
+ pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
+ pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
+ pub fn nl_langinfo_l(item: ::nl_item, loc: ::locale_t) -> *mut ::c_char;
+ pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long;
+ pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
pub fn pollset_create(maxfd: ::c_int) -> pollset_t;
pub fn pollset_ctl(
ps: pollset_t,
@@ -2238,26 +3051,109 @@ extern "C" {
timeout: ::c_int,
) -> ::c_int;
pub fn pollset_query(ps: pollset_t, pollfd_query: *mut ::pollfd) -> ::c_int;
+ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
+ pub fn posix_fadvise64(
+ fd: ::c_int,
+ offset: ::off64_t,
+ len: ::off64_t,
+ advise: ::c_int,
+ ) -> ::c_int;
pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
- pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
- pub fn pthread_atfork(
- prepare: ::Option<unsafe extern "C" fn()>,
- parent: ::Option<unsafe extern "C" fn()>,
- child: ::Option<unsafe extern "C" fn()>,
+ pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int;
+ pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
+ pub fn posix_spawn(
+ pid: *mut ::pid_t,
+ path: *const ::c_char,
+ file_actions: *const ::posix_spawn_file_actions_t,
+ attrp: *const ::posix_spawnattr_t,
+ argv: *const *mut ::c_char,
+ envp: *const *mut ::c_char,
) -> ::c_int;
- pub fn pthread_condattr_setclock(
- attr: *mut pthread_condattr_t,
- clock_id: ::clockid_t,
+ pub fn posix_spawn_file_actions_addclose(
+ actions: *mut posix_spawn_file_actions_t,
+ fd: ::c_int,
) -> ::c_int;
- pub fn pthread_create(
- native: *mut ::pthread_t,
- attr: *const ::pthread_attr_t,
- f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
- value: *mut ::c_void,
+ pub fn posix_spawn_file_actions_adddup2(
+ actions: *mut posix_spawn_file_actions_t,
+ fd: ::c_int,
+ newfd: ::c_int,
) -> ::c_int;
- pub fn pthread_kill(thread: ::pthread_t, signal: ::c_int) -> ::c_int;
- pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_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_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+ pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
+ pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
+ pub fn posix_spawnattr_getflags(
+ attr: *const posix_spawnattr_t,
+ flags: *mut ::c_short,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_getpgroup(
+ attr: *const posix_spawnattr_t,
+ flags: *mut ::pid_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_getschedparam(
+ attr: *const posix_spawnattr_t,
+ param: *mut ::sched_param,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_getschedpolicy(
+ attr: *const posix_spawnattr_t,
+ flags: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_getsigdefault(
+ attr: *const posix_spawnattr_t,
+ default: *mut sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_getsigmask(
+ attr: *const posix_spawnattr_t,
+ default: *mut sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
+ pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
+ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
+ pub fn posix_spawnattr_setschedparam(
+ attr: *mut posix_spawnattr_t,
+ param: *const ::sched_param,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
+ pub fn posix_spawnattr_setsigdefault(
+ attr: *mut posix_spawnattr_t,
+ default: *const ::sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnattr_setsigmask(
+ attr: *mut posix_spawnattr_t,
+ default: *const ::sigset_t,
+ ) -> ::c_int;
+ pub fn posix_spawnp(
+ pid: *mut ::pid_t,
+ file: *const ::c_char,
+ file_actions: *const ::posix_spawn_file_actions_t,
+ attrp: *const ::posix_spawnattr_t,
+ argv: *const *mut ::c_char,
+ envp: *const *mut ::c_char,
+ ) -> ::c_int;
+ pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off64_t) -> ::ssize_t;
+ pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
+ pub fn ptrace64(
+ request: ::c_int,
+ id: ::c_longlong,
+ addr: ::c_longlong,
+ data: ::c_int,
+ buff: *mut ::c_int,
+ ) -> ::c_int;
+ pub fn pututline(u: *const utmp) -> *mut utmp;
+ pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
+ pub fn pwrite64(
+ fd: ::c_int,
+ buf: *const ::c_void,
+ count: ::size_t,
+ offset: off64_t,
+ ) -> ::ssize_t;
pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
-> ::ssize_t;
#[link_name = "__linux_quotactl"]
@@ -2267,6 +3163,7 @@ extern "C" {
id: ::c_int,
data: *mut ::c_char,
) -> ::c_int;
+ pub fn rand() -> ::c_int;
pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
pub fn recvfrom(
socket: ::c_int,
@@ -2276,30 +3173,174 @@ extern "C" {
addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t,
) -> ::ssize_t;
+ pub fn recvmmsg(
+ sockfd: ::c_int,
+ msgvec: *mut ::mmsghdr,
+ vlen: ::c_uint,
+ flags: ::c_int,
+ timeout: *mut ::timespec,
+ ) -> ::c_int;
pub fn recvmsg(sockfd: ::c_int, msg: *mut msghdr, flags: ::c_int) -> ::ssize_t;
+ pub fn regcomp(preg: *mut regex_t, pattern: *const ::c_char, cflags: ::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 regexec(
+ preg: *const regex_t,
+ input: *const ::c_char,
+ nmatch: ::size_t,
+ pmatch: *mut regmatch_t,
+ eflags: ::c_int,
+ ) -> ::c_int;
+ pub fn regfree(preg: *mut regex_t);
+ pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
+ pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
+ pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
+ pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
+ pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
+ pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
+ pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
+ pub fn sched_setscheduler(
+ pid: ::pid_t,
+ policy: ::c_int,
+ param: *const ::sched_param,
+ ) -> ::c_int;
+ pub fn sctp_opt_info(
+ sd: ::c_int,
+ id: ::sctp_assoc_t,
+ opt: ::c_int,
+ arg_size: *mut ::c_void,
+ size: *mut ::size_t,
+ ) -> ::c_int;
+ pub fn sctp_peeloff(s: ::c_int, id: ::sctp_assoc_t) -> ::c_int;
+ pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
+ pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
+ pub fn sem_close(sem: *mut sem_t) -> ::c_int;
+ pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
+ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
+ pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
+ pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
+ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
+ pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
+ pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
+ pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
+ pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
pub fn send_file(socket: *mut ::c_int, iobuf: *mut sf_parms, flags: ::c_uint) -> ::ssize_t;
+ pub fn sendmmsg(
+ sockfd: ::c_int,
+ msgvec: *mut mmsghdr,
+ vlen: ::c_uint,
+ flags: ::c_int,
+ ) -> ::c_int;
pub fn sendmsg(sockfd: ::c_int, msg: *const msghdr, flags: ::c_int) -> ::ssize_t;
+ pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
+ pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
pub fn setgrent();
+ pub fn sethostid(hostid: ::c_int) -> ::c_int;
pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
+ pub fn setmntent(filename: *const ::c_char, ty: *const ::c_char) -> *mut ::FILE;
pub fn setpriority(which: ::c_int, who: id_t, priority: ::c_int) -> ::c_int;
pub fn setpwent();
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+ pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
+ pub fn setitimer(
+ which: ::c_int,
+ new_value: *const ::itimerval,
+ old_value: *mut ::itimerval,
+ ) -> ::c_int;
+ pub fn setutent();
+ pub fn setutxent();
+ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
+ pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
+ pub fn sigtimedwait(
+ set: *const sigset_t,
+ info: *mut siginfo_t,
+ timeout: *const ::timespec,
+ ) -> ::c_int;
pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
+ pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
+ pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
+ pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
+ pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
+ pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
+ pub fn splice(socket1: ::c_int, socket2: ::c_int, flags: ::c_int) -> ::c_int;
+ pub fn srand(seed: ::c_uint);
+ pub fn srand48(seed: ::c_long);
+ pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int;
+ pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int;
+ pub fn statx(
+ path: *const ::c_char,
+ buf: *mut stat,
+ length: ::c_int,
+ command: ::c_int,
+ ) -> ::c_int;
+ pub fn strcasecmp_l(
+ string1: *const ::c_char,
+ string2: *const ::c_char,
+ locale: ::locale_t,
+ ) -> ::c_int;
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
+ pub fn strftime(
+ arg1: *mut c_char,
+ arg2: ::size_t,
+ arg3: *const c_char,
+ arg4: *const tm,
+ ) -> ::size_t;
+ pub fn strncasecmp_l(
+ string1: *const ::c_char,
+ string2: *const ::c_char,
+ length: ::size_t,
+ locale: ::locale_t,
+ ) -> ::c_int;
+ pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
+ pub fn strsep(string: *mut *mut ::c_char, delim: *const ::c_char) -> *mut ::c_char;
+ pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int;
+ pub fn swapoff(puath: *const ::c_char) -> ::c_int;
+ pub fn swapon(path: *const ::c_char) -> ::c_int;
pub fn sync();
+ pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
+ pub fn timer_create(
+ clockid: ::clockid_t,
+ sevp: *mut ::sigevent,
+ timerid: *mut ::timer_t,
+ ) -> ::c_int;
+ pub fn timer_delete(timerid: timer_t) -> ::c_int;
+ pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
+ pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int;
+ pub fn timer_settime(
+ timerid: ::timer_t,
+ flags: ::c_int,
+ new_value: *const ::itimerspec,
+ old_value: *mut ::itimerspec,
+ ) -> ::c_int;
+ pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
+ pub fn updwtmp(file: *const ::c_char, u: *mut utmp);
+ pub fn uselocale(loc: ::locale_t) -> ::locale_t;
+ pub fn utmpname(file: *const ::c_char) -> ::c_int;
pub fn utimensat(
dirfd: ::c_int,
path: *const ::c_char,
times: *const ::timespec,
flag: ::c_int,
) -> ::c_int;
+ pub fn wait4(
+ pid: ::pid_t,
+ status: *mut ::c_int,
+ options: ::c_int,
+ rusage: *mut ::rusage,
+ ) -> ::pid_t;
+ pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
+ -> ::c_int;
pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
// Use AIX thread-safe version errno.
diff --git a/src/unix/aix/powerpc64.rs b/src/unix/aix/powerpc64.rs
index 1f96ae37ad..2cacf29f6b 100644
--- a/src/unix/aix/powerpc64.rs
+++ b/src/unix/aix/powerpc64.rs
@@ -93,15 +93,98 @@ s! {
pub f_fpack: [::c_char; 32],
pub f_name_max: ::c_int,
}
-}
-s_no_extra_traits! {
- #[cfg(libc_union)]
- pub union sigval {
- pub sival_ptr: *mut ::c_void,
- pub sival_int: ::c_int,
+ pub struct aiocb {
+ pub aio_lio_opcode: ::c_int,
+ pub aio_fildes: ::c_int,
+ pub aio_word1: ::c_int,
+ pub aio_offset: ::off_t,
+ pub aio_buf: *mut ::c_void,
+ pub aio_return: ::ssize_t,
+ pub aio_errno: ::c_int,
+ pub aio_nbytes: ::size_t,
+ pub aio_reqprio: ::c_int,
+ pub aio_sigevent: ::sigevent,
+ pub aio_word2: ::c_int,
+ pub aio_fp: ::c_int,
+ pub aio_handle: *mut aiocb,
+ pub aio_reserved: [::c_uint; 2],
+ pub aio_sigev_tid: c_long,
+ }
+
+ pub struct ucontext_t {
+ pub __sc_onstack: ::c_int,
+ pub uc_sigmask: ::sigset_t,
+ pub __sc_uerror: ::c_int,
+ pub uc_mcontext: ::mcontext_t,
+ pub uc_link: *mut ucontext_t,
+ pub uc_stack: ::stack_t,
+ // Should be pointer to __extctx_t
+ pub __extctx: *mut ::c_void,
+ pub __extctx_magic: ::c_int,
+ pub __pad: [::c_int; 1],
+ }
+
+ pub struct mcontext_t {
+ pub gpr: [::c_ulonglong; 32],
+ pub msr: ::c_ulonglong,
+ pub iar: ::c_ulonglong,
+ pub lr: ::c_ulonglong,
+ pub ctr: ::c_ulonglong,
+ pub cr: ::c_uint,
+ pub xer: ::c_uint,
+ pub fpscr: ::c_uint,
+ pub fpscrx: ::c_uint,
+ pub except: [::c_ulonglong; 1],
+ // Should be array of double type
+ pub fpr: [::uint64_t; 32],
+ pub fpeu: ::c_char,
+ pub fpinfo: ::c_char,
+ pub fpscr24_31: ::c_char,
+ pub pad: [::c_char; 1],
+ pub excp_type: ::c_int,
+ }
+
+ pub struct utmpx {
+ pub ut_user: [::c_char; 256],
+ pub ut_id: [::c_char; 14],
+ pub ut_line: [::c_char; 64],
+ pub ut_pid: ::pid_t,
+ pub ut_type: ::c_short,
+ pub ut_tv: ::timeval,
+ pub ut_host: [::c_char; 256],
+ pub __dbl_word_pad: ::c_int,
+ pub __reservedA: [::c_int; 2],
+ pub __reservedV: [::c_int; 6],
+ }
+
+ pub struct pthread_spinlock_t {
+ pub __sp_word: [::c_long; 3],
+ }
+
+ pub struct pthread_barrier_t {
+ pub __br_word: [::c_long; 5],
+ }
+
+ pub struct msqid_ds {
+ pub msg_perm: ::ipc_perm,
+ pub msg_first: ::c_uint,
+ pub msg_last: ::c_uint,
+ pub msg_cbytes: ::c_uint,
+ pub msg_qnum: ::c_uint,
+ pub msg_qbytes: ::c_ulong,
+ pub msg_lspid: ::pid_t,
+ pub msg_lrpid: ::pid_t,
+ pub msg_stime: ::time_t,
+ pub msg_rtime: ::time_t,
+ pub msg_ctime: ::time_t,
+ pub msg_rwait: ::c_int,
+ pub msg_wwait: ::c_int,
+ pub msg_reqevents: ::c_ushort,
}
+}
+s_no_extra_traits! {
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
@@ -111,8 +194,7 @@ s_no_extra_traits! {
pub si_status: ::c_int,
pub si_addr: *mut ::c_void,
pub si_band: ::c_long,
- #[cfg(libc_union)]
- pub si_value: sigval,
+ pub si_value: ::sigval,
pub __si_flags: ::c_int,
pub __pad: [::c_int; 3],
}
@@ -192,38 +274,30 @@ s_no_extra_traits! {
}
}
+impl siginfo_t {
+ pub unsafe fn si_addr(&self) -> *mut ::c_void {
+ self.si_addr
+ }
+
+ pub unsafe fn si_value(&self) -> ::sigval {
+ self.si_value
+ }
+
+ pub unsafe fn si_pid(&self) -> ::pid_t {
+ self.si_pid
+ }
+
+ pub unsafe fn si_uid(&self) -> ::uid_t {
+ self.si_uid
+ }
+
+ pub unsafe fn si_status(&self) -> ::c_int {
+ self.si_status
+ }
+}
+
cfg_if! {
if #[cfg(feature = "extra_traits")] {
- #[cfg(libc_union)]
- impl PartialEq for sigval {
- fn eq(&self, other: &sigval) -> bool {
- unsafe {
- self.sival_ptr == other.sival_ptr
- && self.sival_int == other.sival_int
- }
- }
- }
- #[cfg(libc_union)]
- impl Eq for sigval {}
- #[cfg(libc_union)]
- impl ::fmt::Debug for sigval {
- fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
- f.debug_struct("sigval")
- .field("sival_ptr", unsafe { &self.sival_ptr })
- .field("sival_int", unsafe { &self.sival_int })
- .finish()
- }
- }
- #[cfg(libc_union)]
- impl ::hash::Hash for sigval {
- fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
- unsafe {
- self.sival_ptr.hash(state);
- self.sival_int.hash(state);
- }
- }
- }
-
impl PartialEq for siginfo_t {
fn eq(&self, other: &siginfo_t) -> bool {
#[cfg(libc_union)]
@@ -290,7 +364,7 @@ cfg_if! {
#[cfg(libc_union)]
impl ::fmt::Debug for _kernel_simple_lock {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
- f.debug_struct("sigval")
+ f.debug_struct("_kernel_simple_lock")
.field("_slock", unsafe { &self._slock })
.field("_slockp", unsafe { &self._slockp })
.finish()
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 519a993465..3348a7a8af 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -5121,6 +5121,23 @@ extern "C" {
pub fn endutxent();
pub fn utmpxname(file: *const ::c_char) -> ::c_int;
+ pub fn asctime(tm: *const ::tm) -> *mut ::c_char;
+ pub fn ctime(clock: *const time_t) -> *mut ::c_char;
+ pub fn getdate(datestr: *const ::c_char) -> *mut ::tm;
+ pub fn strftime(
+ buf: *mut ::c_char,
+ maxsize: ::size_t,
+ format: *const ::c_char,
+ timeptr: *const ::tm,
+ ) -> ::size_t;
+ pub fn strptime(
+ buf: *const ::c_char,
+ format: *const ::c_char,
+ timeptr: *mut ::tm,
+ ) -> *mut ::c_char;
+ pub fn asctime_r(tm: *const ::tm, result: *mut ::c_char) -> *mut ::c_char;
+ pub fn ctime_r(clock: *const time_t, result: *mut ::c_char) -> *mut ::c_char;
+
pub fn getnameinfo(
sa: *const ::sockaddr,
salen: ::socklen_t,
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index 70fe6e2edd..63c0594f41 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -1091,6 +1091,7 @@ pub const EV_NODATA: u16 = 0x1000;
pub const EV_FLAG1: u16 = 0x2000;
pub const EV_ERROR: u16 = 0x4000;
pub const EV_EOF: u16 = 0x8000;
+pub const EV_HUP: u16 = 0x8000;
pub const EV_SYSFLAGS: u16 = 0xf000;
pub const FIODNAME: ::c_ulong = 0x80106678;
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index b70a40f15d..2ee676d973 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -2693,15 +2693,20 @@ pub const EV_ADD: u16 = 0x1;
pub const EV_DELETE: u16 = 0x2;
pub const EV_ENABLE: u16 = 0x4;
pub const EV_DISABLE: u16 = 0x8;
+pub const EV_FORCEONESHOT: u16 = 0x100;
+pub const EV_KEEPUDATA: u16 = 0x200;
+
pub const EV_ONESHOT: u16 = 0x10;
pub const EV_CLEAR: u16 = 0x20;
pub const EV_RECEIPT: u16 = 0x40;
pub const EV_DISPATCH: u16 = 0x80;
+pub const EV_SYSFLAGS: u16 = 0xf000;
pub const EV_DROP: u16 = 0x1000;
pub const EV_FLAG1: u16 = 0x2000;
-pub const EV_ERROR: u16 = 0x4000;
+pub const EV_FLAG2: u16 = 0x4000;
+
pub const EV_EOF: u16 = 0x8000;
-pub const EV_SYSFLAGS: u16 = 0xf000;
+pub const EV_ERROR: u16 = 0x4000;
pub const NOTE_TRIGGER: u32 = 0x01000000;
pub const NOTE_FFNOP: u32 = 0x00000000;
@@ -2711,6 +2716,7 @@ pub const NOTE_FFCOPY: u32 = 0xc0000000;
pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
pub const NOTE_LOWAT: u32 = 0x00000001;
+pub const NOTE_FILE_POLL: u32 = 0x00000002;
pub const NOTE_DELETE: u32 = 0x00000001;
pub const NOTE_WRITE: u32 = 0x00000002;
pub const NOTE_EXTEND: u32 = 0x00000004;
@@ -2718,6 +2724,10 @@ pub const NOTE_ATTRIB: u32 = 0x00000008;
pub const NOTE_LINK: u32 = 0x00000010;
pub const NOTE_RENAME: u32 = 0x00000020;
pub const NOTE_REVOKE: u32 = 0x00000040;
+pub const NOTE_OPEN: u32 = 0x00000080;
+pub const NOTE_CLOSE: u32 = 0x00000100;
+pub const NOTE_CLOSE_WRITE: u32 = 0x00000200;
+pub const NOTE_READ: u32 = 0x00000400;
pub const NOTE_EXIT: u32 = 0x80000000;
pub const NOTE_FORK: u32 = 0x40000000;
pub const NOTE_EXEC: u32 = 0x20000000;
@@ -2730,6 +2740,7 @@ pub const NOTE_SECONDS: u32 = 0x00000001;
pub const NOTE_MSECONDS: u32 = 0x00000002;
pub const NOTE_USECONDS: u32 = 0x00000004;
pub const NOTE_NSECONDS: u32 = 0x00000008;
+pub const NOTE_ABSTIME: u32 = 0x00000010;
pub const MADV_PROTECT: ::c_int = 10;
@@ -4659,6 +4670,18 @@ pub const SCTP_ASSOC_RESET_FAILED: ::c_int = 0x0008;
pub const SCTP_STREAM_CHANGE_DENIED: ::c_int = 0x0004;
pub const SCTP_STREAM_CHANGE_FAILED: ::c_int = 0x0008;
+cfg_if! {
+ if #[cfg(libc_const_extern_fn)] {
+ pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
+ a << 24
+ }
+ } else {
+ pub fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
+ a << 24
+ }
+ }
+}
+
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs
index d3a3f34b0f..4046ec3109 100644
--- a/src/unix/bsd/freebsdlike/freebsd/x86.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/x86.rs
@@ -6,6 +6,41 @@ pub type time_t = i32;
pub type suseconds_t = i32;
pub type register_t = i32;
+s_no_extra_traits! {
+ pub struct mcontext_t {
+ pub mc_onstack: register_t,
+ pub mc_gs: register_t,
+ pub mc_fs: register_t,
+ pub mc_es: register_t,
+ pub mc_ds: register_t,
+ pub mc_edi: register_t,
+ pub mc_esi: register_t,
+ pub mc_ebp: register_t,
+ pub mc_isp: register_t,
+ pub mc_ebx: register_t,
+ pub mc_edx: register_t,
+ pub mc_ecx: register_t,
+ pub mc_eax: register_t,
+ pub mc_trapno: register_t,
+ pub mc_err: register_t,
+ pub mc_eip: register_t,
+ pub mc_cs: register_t,
+ pub mc_eflags: register_t,
+ pub mc_esp: register_t,
+ pub mc_ss: register_t,
+ pub mc_len: ::c_int,
+ pub mc_fpformat: ::c_int,
+ pub mc_ownedfp: ::c_int,
+ pub mc_flags: register_t,
+ pub mc_fpstate: [[::c_int; 32]; 4],
+ pub mc_fsbase: register_t,
+ pub mc_gsbase: register_t,
+ pub mc_xfpustate: register_t,
+ pub mc_xfpustate_len: register_t,
+ pub mc_spare2: [::c_int; 4],
+ }
+}
+
s! {
pub struct stat {
pub st_dev: ::dev_t,
@@ -31,6 +66,15 @@ s! {
pub st_birthtime_nsec: ::c_long,
__unused: [u8; 8],
}
+
+ pub struct ucontext_t {
+ pub uc_sigmask: ::sigset_t,
+ pub uc_mcontext: ::mcontext_t,
+ pub uc_link: *mut ::ucontext_t,
+ pub uc_stack: ::stack_t,
+ pub uc_flags: ::c_int,
+ __spare__: [::c_int; 4],
+ }
}
// should be pub(crate), but that requires Rust 1.18.0
@@ -43,4 +87,115 @@ cfg_if! {
pub const _ALIGNBYTES: usize = 4 - 1;
}
}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for mcontext_t {
+ fn eq(&self, other: &mcontext_t) -> bool {
+ self.mc_onstack == other.mc_onstack &&
+ self.mc_gs == other.mc_gs &&
+ self.mc_fs == other.mc_fs &&
+ self.mc_es == other.mc_es &&
+ self.mc_ds == other.mc_ds &&
+ self.mc_edi == other.mc_edi &&
+ self.mc_esi == other.mc_esi &&
+ self.mc_ebp == other.mc_ebp &&
+ self.mc_isp == other.mc_isp &&
+ self.mc_ebx == other.mc_ebx &&
+ self.mc_edx == other.mc_edx &&
+ self.mc_ecx == other.mc_ecx &&
+ self.mc_eax == other.mc_eax &&
+ self.mc_trapno == other.mc_trapno &&
+ self.mc_err == other.mc_err &&
+ self.mc_eip == other.mc_eip &&
+ self.mc_cs == other.mc_cs &&
+ self.mc_eflags == other.mc_eflags &&
+ self.mc_esp == other.mc_esp &&
+ self.mc_ss == other.mc_ss &&
+ self.mc_len == other.mc_len &&
+ self.mc_fpformat == other.mc_fpformat &&
+ self.mc_ownedfp == other.mc_ownedfp &&
+ self.mc_flags == other.mc_flags &&
+ self.mc_fpstate.iter().zip(other.mc_fpstate.iter()).all(|(a, b)| a == b) &&
+ self.mc_fsbase == other.mc_fsbase &&
+ self.mc_gsbase == other.mc_gsbase &&
+ self.mc_xfpustate == other.mc_xfpustate &&
+ self.mc_xfpustate_len == other.mc_xfpustate_len &&
+ self.mc_spare2.iter().zip(other.mc_spare2.iter()).all(|(a, b)| a == b)
+ }
+ }
+ impl Eq for mcontext_t {}
+ impl ::fmt::Debug for mcontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mcontext_t")
+ .field("mc_onstack", &self.mc_onstack)
+ .field("mc_gs", &self.mc_gs)
+ .field("mc_fs", &self.mc_fs)
+ .field("mc_es", &self.mc_es)
+ .field("mc_ds", &self.mc_ds)
+ .field("mc_edi", &self.mc_edi)
+ .field("mc_esi", &self.mc_esi)
+ .field("mc_ebp", &self.mc_ebp)
+ .field("mc_isp", &self.mc_isp)
+ .field("mc_ebx", &self.mc_ebx)
+ .field("mc_edx", &self.mc_edx)
+ .field("mc_ecx", &self.mc_ecx)
+ .field("mc_eax", &self.mc_eax)
+ .field("mc_trapno", &self.mc_trapno)
+ .field("mc_err", &self.mc_err)
+ .field("mc_eip", &self.mc_eip)
+ .field("mc_cs", &self.mc_cs)
+ .field("mc_eflags", &self.mc_eflags)
+ .field("mc_esp", &self.mc_esp)
+ .field("mc_ss", &self.mc_ss)
+ .field("mc_len", &self.mc_len)
+ .field("mc_fpformat", &self.mc_fpformat)
+ .field("mc_ownedfp", &self.mc_ownedfp)
+ .field("mc_flags", &self.mc_flags)
+ .field("mc_fpstate", &self.mc_fpstate)
+ .field("mc_fsbase", &self.mc_fsbase)
+ .field("mc_gsbase", &self.mc_gsbase)
+ .field("mc_xfpustate", &self.mc_xfpustate)
+ .field("mc_xfpustate_len", &self.mc_xfpustate_len)
+ .field("mc_spare2", &self.mc_spare2)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for mcontext_t {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.mc_onstack.hash(state);
+ self.mc_gs.hash(state);
+ self.mc_fs.hash(state);
+ self.mc_es.hash(state);
+ self.mc_ds.hash(state);
+ self.mc_edi.hash(state);
+ self.mc_esi.hash(state);
+ self.mc_ebp.hash(state);
+ self.mc_isp.hash(state);
+ self.mc_ebx.hash(state);
+ self.mc_edx.hash(state);
+ self.mc_ecx.hash(state);
+ self.mc_eax.hash(state);
+ self.mc_trapno.hash(state);
+ self.mc_err.hash(state);
+ self.mc_eip.hash(state);
+ self.mc_cs.hash(state);
+ self.mc_eflags.hash(state);
+ self.mc_esp.hash(state);
+ self.mc_ss.hash(state);
+ self.mc_len.hash(state);
+ self.mc_fpformat.hash(state);
+ self.mc_ownedfp.hash(state);
+ self.mc_flags.hash(state);
+ self.mc_fpstate.hash(state);
+ self.mc_fsbase.hash(state);
+ self.mc_gsbase.hash(state);
+ self.mc_xfpustate.hash(state);
+ self.mc_xfpustate_len.hash(state);
+ self.mc_spare2.hash(state);
+ }
+ }
+ }
+}
+
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 87132e2587..402257fd3b 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -1986,6 +1986,13 @@ pub const EV_ERROR: u32 = 0x4000;
pub const EV_EOF: u32 = 0x8000;
pub const EV_SYSFLAGS: u32 = 0xf000;
+pub const NOTE_TRIGGER: u32 = 0x01000000;
+pub const NOTE_FFNOP: u32 = 0x00000000;
+pub const NOTE_FFAND: u32 = 0x40000000;
+pub const NOTE_FFOR: u32 = 0x80000000;
+pub const NOTE_FFCOPY: u32 = 0xc0000000;
+pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
+pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
pub const NOTE_LOWAT: u32 = 0x00000001;
pub const NOTE_DELETE: u32 = 0x00000001;
pub const NOTE_WRITE: u32 = 0x00000002;
@@ -2213,6 +2220,11 @@ pub const WCONTINUED: ::c_int = 0x00000010;
pub const WEXITED: ::c_int = 0x000000020;
pub const WNOWAIT: ::c_int = 0x00010000;
+pub const WALTSIG: ::c_int = 0x00000004;
+pub const WALLSIG: ::c_int = 0x00000008;
+pub const WTRAPPED: ::c_int = 0x00000040;
+pub const WNOZOMBIE: ::c_int = 0x00020000;
+
pub const P_ALL: idtype_t = 0;
pub const P_PID: idtype_t = 1;
pub const P_PGID: idtype_t = 4;
@@ -2377,6 +2389,19 @@ pub const GRND_NONBLOCK: ::c_uint = 0x1;
pub const GRND_RANDOM: ::c_uint = 0x2;
pub const GRND_INSECURE: ::c_uint = 0x4;
+cfg_if! {
+
+ if #[cfg(libc_const_extern_fn)] {
+ pub const fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int {
+ alignment << MAP_ALIGNMENT_SHIFT
+ }
+ } else {
+ pub fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int {
+ alignment << MAP_ALIGNMENT_SHIFT
+ }
+ }
+}
+
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index 87acecb6a7..8099bad1d1 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -7,6 +7,7 @@ pub type sigset_t = ::c_uint;
pub type blksize_t = i32;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
+pub type idtype_t = ::c_uint;
pub type pthread_attr_t = *mut ::c_void;
pub type pthread_mutex_t = *mut ::c_void;
pub type pthread_mutexattr_t = *mut ::c_void;
@@ -1279,13 +1280,15 @@ pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
pub const PTHREAD_MUTEX_STRICT_NP: ::c_int = 4;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_STRICT_NP;
+pub const EVFILT_READ: i16 = -1;
+pub const EVFILT_WRITE: i16 = -2;
pub const EVFILT_AIO: i16 = -3;
+pub const EVFILT_VNODE: i16 = -4;
pub const EVFILT_PROC: i16 = -5;
-pub const EVFILT_READ: i16 = -1;
pub const EVFILT_SIGNAL: i16 = -6;
pub const EVFILT_TIMER: i16 = -7;
-pub const EVFILT_VNODE: i16 = -4;
-pub const EVFILT_WRITE: i16 = -2;
+pub const EVFILT_DEVICE: i16 = -8;
+pub const EVFILT_EXCEPT: i16 = -9;
pub const EV_ADD: u16 = 0x1;
pub const EV_DELETE: u16 = 0x2;
@@ -1304,6 +1307,7 @@ pub const EV_SYSFLAGS: u16 = 0xf800;
pub const NOTE_LOWAT: u32 = 0x00000001;
pub const NOTE_EOF: u32 = 0x00000002;
+pub const NOTE_OOB: u32 = 0x00000004;
pub const NOTE_DELETE: u32 = 0x00000001;
pub const NOTE_WRITE: u32 = 0x00000002;
pub const NOTE_EXTEND: u32 = 0x00000004;
@@ -1320,6 +1324,7 @@ pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
pub const NOTE_TRACK: u32 = 0x00000001;
pub const NOTE_TRACKERR: u32 = 0x00000002;
pub const NOTE_CHILD: u32 = 0x00000004;
+pub const NOTE_CHANGE: u32 = 0x00000001;
pub const TMP_MAX: ::c_uint = 0x7fffffff;
@@ -1611,7 +1616,15 @@ pub const BIOCSDLT: ::c_ulong = 0x8004427a;
pub const PTRACE_FORK: ::c_int = 0x0002;
-pub const WCONTINUED: ::c_int = 8;
+pub const WCONTINUED: ::c_int = 0x08;
+pub const WEXITED: ::c_int = 0x04;
+pub const WSTOPPED: ::c_int = 0x02; // same as WUNTRACED
+pub const WNOWAIT: ::c_int = 0x10;
+pub const WTRAPPED: ::c_int = 0x20;
+
+pub const P_ALL: ::idtype_t = 0;
+pub const P_PGID: ::idtype_t = 1;
+pub const P_PID: ::idtype_t = 2;
// search.h
pub const FIND: ::ACTION = 0;
@@ -1660,6 +1673,12 @@ pub const MNT_WAIT: ::c_int = 1;
pub const MNT_NOWAIT: ::c_int = 2;
pub const MNT_LAZY: ::c_int = 3;
+// sys/_time.h
+pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
+pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 4;
+pub const CLOCK_UPTIME: ::clockid_t = 5;
+pub const CLOCK_BOOTTIME: ::clockid_t = 6;
+
pub const LC_COLLATE_MASK: ::c_int = 1 << ::LC_COLLATE;
pub const LC_CTYPE_MASK: ::c_int = 1 << ::LC_CTYPE;
pub const LC_MONETARY_MASK: ::c_int = 1 << ::LC_MONETARY;
diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs
index 89f8806eb4..2fa3327834 100644
--- a/src/unix/haiku/mod.rs
+++ b/src/unix/haiku/mod.rs
@@ -445,6 +445,13 @@ s! {
pub sl_max: ::size_t,
pub sl_cur: ::size_t,
}
+
+ pub struct dl_phdr_info {
+ pub dlpi_addr: ::Elf_Addr,
+ pub dlpi_name: *const ::c_char,
+ pub dlpi_phdr: *const ::Elf_Phdr,
+ pub dlpi_phnum: ::Elf_Half,
+ }
}
s_no_extra_traits! {
@@ -678,6 +685,9 @@ 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 L_SET: ::c_int = SEEK_SET;
+pub const L_INCR: ::c_int = SEEK_CUR;
+pub const L_XTND: ::c_int = SEEK_END;
pub const _IOFBF: ::c_int = 0;
pub const _IONBF: ::c_int = 2;
pub const _IOLBF: ::c_int = 1;
@@ -2030,6 +2040,29 @@ extern "C" {
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;
+
+ pub fn getprogname() -> *const ::c_char;
+ pub fn setprogname(progname: *const ::c_char);
+ 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;
+}
+
+#[link(name = "unix")]
+extern "C" {
+ pub fn memmem(
+ source: *const ::c_void,
+ sourceLength: ::size_t,
+ search: *const ::c_void,
+ searchLength: ::size_t,
+ ) -> *mut ::c_void;
}
cfg_if! {
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
index ca2938ac22..fd4b0593b4 100644
--- a/src/unix/linux_like/android/mod.rs
+++ b/src/unix/linux_like/android/mod.rs
@@ -1579,6 +1579,23 @@ pub const FIONREAD: ::c_int = 0x541B;
pub const TIOCCONS: ::c_int = 0x541D;
pub const TIOCSBRK: ::c_int = 0x5427;
pub const TIOCCBRK: ::c_int = 0x5428;
+cfg_if! {
+ if #[cfg(any(target_arch = "x86",
+ target_arch = "x86_64",
+ target_arch = "arm",
+ target_arch = "aarch64",
+ target_arch = "riscv64",
+ target_arch = "s390x"))] {
+ pub const FICLONE: ::c_int = 0x40049409;
+ pub const FICLONERANGE: ::c_int = 0x4020940D;
+ } else if #[cfg(any(target_arch = "mips",
+ target_arch = "mips64",
+ target_arch = "powerpc",
+ target_arch = "powerpc64"))] {
+ pub const FICLONE: ::c_int = 0x80049409;
+ pub const FICLONERANGE: ::c_int = 0x8020940D;
+ }
+}
pub const ST_RDONLY: ::c_ulong = 1;
pub const ST_NOSUID: ::c_ulong = 2;
@@ -1606,6 +1623,14 @@ pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
pub const AI_V4MAPPED: ::c_int = 0x00000800;
pub const AI_DEFAULT: ::c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG;
+// linux/kexec.h
+pub const KEXEC_ON_CRASH: ::c_int = 0x00000001;
+pub const KEXEC_PRESERVE_CONTEXT: ::c_int = 0x00000002;
+pub const KEXEC_ARCH_MASK: ::c_int = 0xffff0000;
+pub const KEXEC_FILE_UNLOAD: ::c_int = 0x00000001;
+pub const KEXEC_FILE_ON_CRASH: ::c_int = 0x00000002;
+pub const KEXEC_FILE_NO_INITRAMFS: ::c_int = 0x00000004;
+
pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793;
pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278;
@@ -3523,6 +3548,7 @@ extern "C" {
longindex: *mut ::c_int,
) -> ::c_int;
+ pub fn sync();
pub fn syncfs(fd: ::c_int) -> ::c_int;
}
diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs
index cffe748de9..4693978311 100644
--- a/src/unix/linux_like/linux/arch/generic/mod.rs
+++ b/src/unix/linux_like/linux/arch/generic/mod.rs
@@ -108,9 +108,18 @@ cfg_if! {
cfg_if! {
if #[cfg(any(target_arch = "x86",
target_arch = "x86_64",
- target_arch = "aarch64"))] {
+ target_arch = "arm",
+ target_arch = "aarch64",
+ target_arch = "riscv64",
+ target_arch = "s390x"))] {
pub const FICLONE: ::c_ulong = 0x40049409;
pub const FICLONERANGE: ::c_ulong = 0x4020940D;
+ } else if #[cfg(any(target_arch = "mips",
+ target_arch = "mips64",
+ target_arch = "powerpc",
+ target_arch = "powerpc64"))] {
+ pub const FICLONE: ::c_ulong = 0x80049409;
+ pub const FICLONERANGE: ::c_ulong = 0x8020940D;
}
}
// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
diff --git a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
index ea905eb7ca..fd690a17e1 100644
--- a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs
@@ -837,6 +837,7 @@ 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;
diff --git a/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs b/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
index 6e3130324a..f3b130cbc6 100644
--- a/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
@@ -196,6 +196,41 @@ s! {
pub l_len: ::off64_t,
pub l_pid: ::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,
+ }
}
pub const O_LARGEFILE: ::c_int = 0;
diff --git a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
index c84442f1f3..c65a562ac2 100644
--- a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
@@ -192,6 +192,41 @@ s! {
pub l_len: ::off64_t,
pub l_pid: ::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,
+ }
}
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 1d272d601d..a982901113 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -798,6 +798,12 @@ s_no_extra_traits! {
#[cfg(not(libc_union))]
pub ifr_ifru: ::sockaddr,
}
+
+ pub struct hwtstamp_config {
+ pub flags: ::c_int,
+ pub tx_type: ::c_int,
+ pub rx_filter: ::c_int,
+ }
}
s_no_extra_traits! {
@@ -1221,6 +1227,31 @@ cfg_if! {
.finish()
}
}
+
+ impl ::fmt::Debug for hwtstamp_config {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("hwtstamp_config")
+ .field("flags", &self.flags)
+ .field("tx_type", &self.tx_type)
+ .field("rx_filter", &self.rx_filter)
+ .finish()
+ }
+ }
+ impl PartialEq for hwtstamp_config {
+ fn eq(&self, other: &hwtstamp_config) -> bool {
+ self.flags == other.flags &&
+ self.tx_type == other.tx_type &&
+ self.rx_filter == other.rx_filter
+ }
+ }
+ impl Eq for hwtstamp_config {}
+ impl ::hash::Hash for hwtstamp_config {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.flags.hash(state);
+ self.tx_type.hash(state);
+ self.rx_filter.hash(state);
+ }
+ }
}
}
@@ -2771,6 +2802,8 @@ pub const SIOCGRARP: ::c_ulong = 0x00008961;
pub const SIOCSRARP: ::c_ulong = 0x00008962;
pub const SIOCGIFMAP: ::c_ulong = 0x00008970;
pub const SIOCSIFMAP: ::c_ulong = 0x00008971;
+pub const SIOCSHWTSTAMP: ::c_ulong = 0x000089b0;
+pub const SIOCGHWTSTAMP: ::c_ulong = 0x000089b1;
pub const IPTOS_TOS_MASK: u8 = 0x1E;
pub const IPTOS_PREC_MASK: u8 = 0xE0;
@@ -3042,6 +3075,14 @@ pub const ARPD_LOOKUP: ::c_ushort = 0x02;
pub const ARPD_FLUSH: ::c_ushort = 0x03;
pub const ATF_MAGIC: ::c_int = 0x80;
+pub const RTEXT_FILTER_VF: ::c_int = 1 << 0;
+pub const RTEXT_FILTER_BRVLAN: ::c_int = 1 << 1;
+pub const RTEXT_FILTER_BRVLAN_COMPRESSED: ::c_int = 1 << 2;
+pub const RTEXT_FILTER_SKIP_STATS: ::c_int = 1 << 3;
+pub const RTEXT_FILTER_MRP: ::c_int = 1 << 4;
+pub const RTEXT_FILTER_CFM_CONFIG: ::c_int = 1 << 5;
+pub const RTEXT_FILTER_CFM_STATUS: ::c_int = 1 << 6;
+
// userspace compat definitions for RTNLGRP_*
pub const RTMGRP_LINK: ::c_int = 0x00001;
pub const RTMGRP_NOTIFY: ::c_int = 0x00002;
@@ -3121,6 +3162,28 @@ pub const SOF_TIMESTAMPING_OPT_TX_SWHW: ::c_uint = 1 << 14;
pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0;
pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1;
+pub const HWTSTAMP_TX_OFF: ::c_uint = 0;
+pub const HWTSTAMP_TX_ON: ::c_uint = 1;
+pub const HWTSTAMP_TX_ONESTEP_SYNC: ::c_uint = 2;
+pub const HWTSTAMP_TX_ONESTEP_P2P: ::c_uint = 3;
+
+pub const HWTSTAMP_FILTER_NONE: ::c_uint = 0;
+pub const HWTSTAMP_FILTER_ALL: ::c_uint = 1;
+pub const HWTSTAMP_FILTER_SOME: ::c_uint = 2;
+pub const HWTSTAMP_FILTER_PTP_V1_L4_EVENT: ::c_uint = 3;
+pub const HWTSTAMP_FILTER_PTP_V1_L4_SYNC: ::c_uint = 4;
+pub const HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: ::c_uint = 5;
+pub const HWTSTAMP_FILTER_PTP_V2_L4_EVENT: ::c_uint = 6;
+pub const HWTSTAMP_FILTER_PTP_V2_L4_SYNC: ::c_uint = 7;
+pub const HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ: ::c_uint = 8;
+pub const HWTSTAMP_FILTER_PTP_V2_L2_EVENT: ::c_uint = 9;
+pub const HWTSTAMP_FILTER_PTP_V2_L2_SYNC: ::c_uint = 10;
+pub const HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ: ::c_uint = 11;
+pub const HWTSTAMP_FILTER_PTP_V2_EVENT: ::c_uint = 12;
+pub const HWTSTAMP_FILTER_PTP_V2_SYNC: ::c_uint = 13;
+pub const HWTSTAMP_FILTER_PTP_V2_DELAY_REQ: ::c_uint = 14;
+pub const HWTSTAMP_FILTER_NTP_ALL: ::c_uint = 15;
+
// linux/if_alg.h
pub const ALG_SET_KEY: ::c_int = 1;
pub const ALG_SET_IV: ::c_int = 2;
@@ -3550,6 +3613,14 @@ pub fn FUTEX_OP(op: ::c_int, oparg: ::c_int, cmp: ::c_int, cmparg: ::c_int) -> :
((op & 0xf) << 28) | ((cmp & 0xf) << 24) | ((oparg & 0xfff) << 12) | (cmparg & 0xfff)
}
+// linux/kexec.h
+pub const KEXEC_ON_CRASH: ::c_int = 0x00000001;
+pub const KEXEC_PRESERVE_CONTEXT: ::c_int = 0x00000002;
+pub const KEXEC_ARCH_MASK: ::c_int = 0xffff0000;
+pub const KEXEC_FILE_UNLOAD: ::c_int = 0x00000001;
+pub const KEXEC_FILE_ON_CRASH: ::c_int = 0x00000002;
+pub const KEXEC_FILE_NO_INITRAMFS: ::c_int = 0x00000004;
+
// linux/reboot.h
pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead;
pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793;
diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs
index db57745967..584e308ce2 100644
--- a/src/unix/linux_like/mod.rs
+++ b/src/unix/linux_like/mod.rs
@@ -557,6 +557,14 @@ pub const XATTR_CREATE: ::c_int = 0x1;
pub const XATTR_REPLACE: ::c_int = 0x2;
cfg_if! {
+ if #[cfg(target_os = "android")] {
+ pub const RLIM64_INFINITY: ::c_ulonglong = !0;
+ } else {
+ pub const RLIM64_INFINITY: ::rlim64_t = !0;
+ }
+}
+
+cfg_if! {
if #[cfg(target_env = "ohos")] {
pub const LC_CTYPE: ::c_int = 0;
pub const LC_NUMERIC: ::c_int = 1;
diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs
index cb4512d8bc..dec47c610b 100644
--- a/src/unix/redox/mod.rs
+++ b/src/unix/redox/mod.rs
@@ -993,6 +993,7 @@ extern "C" {
// unistd.h
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
+ pub fn getdtablesize() -> ::c_int;
// malloc.h
pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
@@ -1043,6 +1044,13 @@ extern "C" {
pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
+ // stdlib.h
+ pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
+
+ // string.h
+ pub fn strlcat(dst: *mut ::c_char, src: *const ::c_char, siz: ::size_t) -> ::size_t;
+ pub fn strlcpy(dst: *mut ::c_char, src: *const ::c_char, siz: ::size_t) -> ::size_t;
+
// sys/epoll.h
pub fn epoll_create(size: ::c_int) -> ::c_int;
pub fn epoll_create1(flags: ::c_int) -> ::c_int;
@@ -1093,6 +1101,9 @@ extern "C" {
// time.h
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
+
+ // strings.h
+ pub fn explicit_bzero(p: *mut ::c_void, len: ::size_t);
}
cfg_if! {
diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs
index 1993e18490..cc688331f4 100644
--- a/src/unix/solarish/mod.rs
+++ b/src/unix/solarish/mod.rs
@@ -3196,6 +3196,8 @@ extern "C" {
longopts: *const option,
longindex: *mut ::c_int,
) -> ::c_int;
+
+ pub fn sync();
}
#[link(name = "sendfile")]