aboutsummaryrefslogtreecommitdiff
path: root/libc/src/unix/notbsd
diff options
context:
space:
mode:
Diffstat (limited to 'libc/src/unix/notbsd')
-rw-r--r--libc/src/unix/notbsd/android/b32/mod.rs63
-rw-r--r--libc/src/unix/notbsd/android/b64/aarch64.rs14
-rw-r--r--libc/src/unix/notbsd/android/b64/mod.rs39
-rw-r--r--libc/src/unix/notbsd/android/b64/x86_64.rs24
-rw-r--r--libc/src/unix/notbsd/android/mod.rs246
-rw-r--r--libc/src/unix/notbsd/emscripten/mod.rs162
-rw-r--r--libc/src/unix/notbsd/linux/mips/mod.rs68
-rw-r--r--libc/src/unix/notbsd/linux/mod.rs413
-rw-r--r--libc/src/unix/notbsd/linux/musl/b32/arm.rs27
-rw-r--r--libc/src/unix/notbsd/linux/musl/b32/mips.rs24
-rw-r--r--libc/src/unix/notbsd/linux/musl/b32/powerpc.rs23
-rw-r--r--libc/src/unix/notbsd/linux/musl/b32/x86.rs27
-rw-r--r--libc/src/unix/notbsd/linux/musl/b64/aarch64.rs16
-rw-r--r--libc/src/unix/notbsd/linux/musl/b64/mod.rs11
-rw-r--r--libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs14
-rw-r--r--libc/src/unix/notbsd/linux/musl/b64/x86_64.rs19
-rw-r--r--libc/src/unix/notbsd/linux/musl/mod.rs44
-rw-r--r--libc/src/unix/notbsd/linux/other/b32/arm.rs21
-rw-r--r--libc/src/unix/notbsd/linux/other/b32/mod.rs4
-rw-r--r--libc/src/unix/notbsd/linux/other/b32/powerpc.rs29
-rw-r--r--libc/src/unix/notbsd/linux/other/b32/x86.rs21
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/aarch64.rs24
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/not_x32.rs1
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/powerpc64.rs31
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/sparc64.rs19
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/x32.rs1
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/x86_64.rs24
-rw-r--r--libc/src/unix/notbsd/linux/other/mod.rs155
-rw-r--r--libc/src/unix/notbsd/linux/s390x/mod.rs43
-rw-r--r--libc/src/unix/notbsd/mod.rs63
30 files changed, 1161 insertions, 509 deletions
diff --git a/libc/src/unix/notbsd/android/b32/mod.rs b/libc/src/unix/notbsd/android/b32/mod.rs
index a8cc51b..e8fd20e 100644
--- a/libc/src/unix/notbsd/android/b32/mod.rs
+++ b/libc/src/unix/notbsd/android/b32/mod.rs
@@ -13,7 +13,7 @@ s! {
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
- pub sa_flags: ::c_ulong,
+ pub sa_flags: ::c_int,
pub sa_restorer: ::Option<extern fn()>,
}
@@ -35,12 +35,12 @@ s! {
pub st_size: ::c_longlong,
pub st_blksize: ::blksize_t,
pub st_blocks: ::c_ulonglong,
- pub st_atime: ::c_ulong,
- pub st_atime_nsec: ::c_ulong,
- pub st_mtime: ::c_ulong,
- pub st_mtime_nsec: ::c_ulong,
- pub st_ctime: ::c_ulong,
- pub st_ctime_nsec: ::c_ulong,
+ pub st_atime: ::c_long,
+ pub st_atime_nsec: ::c_long,
+ pub st_mtime: ::c_long,
+ pub st_mtime_nsec: ::c_long,
+ pub st_ctime: ::c_long,
+ pub st_ctime_nsec: ::c_long,
pub st_ino: ::c_ulonglong,
}
@@ -57,12 +57,12 @@ s! {
pub st_size: ::c_longlong,
pub st_blksize: ::blksize_t,
pub st_blocks: ::c_ulonglong,
- pub st_atime: ::c_ulong,
- pub st_atime_nsec: ::c_ulong,
- pub st_mtime: ::c_ulong,
- pub st_mtime_nsec: ::c_ulong,
- pub st_ctime: ::c_ulong,
- pub st_ctime_nsec: ::c_ulong,
+ pub st_atime: ::c_long,
+ pub st_atime_nsec: ::c_long,
+ pub st_mtime: ::c_long,
+ pub st_mtime_nsec: ::c_long,
+ pub st_ctime: ::c_long,
+ pub st_ctime_nsec: ::c_long,
pub st_ino: ::c_ulonglong,
}
@@ -96,12 +96,12 @@ s! {
}
pub struct pthread_attr_t {
- pub flags: ::uint32_t,
+ pub flags: u32,
pub stack_base: *mut ::c_void,
pub stack_size: ::size_t,
pub guard_size: ::size_t,
- pub sched_policy: ::int32_t,
- pub sched_priority: ::int32_t,
+ pub sched_policy: i32,
+ pub sched_priority: i32,
}
pub struct pthread_mutex_t { value: ::c_int }
@@ -129,18 +129,18 @@ s! {
}
pub struct statfs {
- pub f_type: ::uint32_t,
- pub f_bsize: ::uint32_t,
- pub f_blocks: ::uint64_t,
- pub f_bfree: ::uint64_t,
- pub f_bavail: ::uint64_t,
- pub f_files: ::uint64_t,
- pub f_ffree: ::uint64_t,
+ pub f_type: u32,
+ pub f_bsize: u32,
+ pub f_blocks: u64,
+ pub f_bfree: u64,
+ pub f_bavail: u64,
+ pub f_files: u64,
+ pub f_ffree: u64,
pub f_fsid: ::__fsid_t,
- pub f_namelen: ::uint32_t,
- pub f_frsize: ::uint32_t,
- pub f_flags: ::uint32_t,
- pub f_spare: [::uint32_t; 4],
+ pub f_namelen: u32,
+ pub f_frsize: u32,
+ pub f_flags: u32,
+ pub f_spare: [u32; 4],
}
pub struct sysinfo {
@@ -161,6 +161,15 @@ s! {
}
}
+// These constants must be of the same type of sigaction.sa_flags
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+
pub const RTLD_GLOBAL: ::c_int = 2;
pub const RTLD_NOW: ::c_int = 0;
pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
diff --git a/libc/src/unix/notbsd/android/b64/aarch64.rs b/libc/src/unix/notbsd/android/b64/aarch64.rs
index 44dfee6..cb1c81b 100644
--- a/libc/src/unix/notbsd/android/b64/aarch64.rs
+++ b/libc/src/unix/notbsd/android/b64/aarch64.rs
@@ -16,11 +16,11 @@ s! {
__pad2: ::c_int,
pub st_blocks: ::c_long,
pub st_atime: ::time_t,
- pub st_atime_nsec: ::c_ulong,
+ pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
- pub st_mtime_nsec: ::c_ulong,
+ pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
- pub st_ctime_nsec: ::c_ulong,
+ pub st_ctime_nsec: ::c_long,
__unused4: ::c_uint,
__unused5: ::c_uint,
}
@@ -39,11 +39,11 @@ s! {
__pad2: ::c_int,
pub st_blocks: ::c_long,
pub st_atime: ::time_t,
- pub st_atime_nsec: ::c_ulong,
+ pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
- pub st_mtime_nsec: ::c_ulong,
+ pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
- pub st_ctime_nsec: ::c_ulong,
+ pub st_ctime_nsec: ::c_long,
__unused4: ::c_uint,
__unused5: ::c_uint,
}
@@ -322,4 +322,4 @@ pub const SYS_pwritev2: ::c_long = 287;
pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
-pub const SYS_syscalls: ::c_long = 291;
+pub const SYS_syscalls: ::c_long = 292;
diff --git a/libc/src/unix/notbsd/android/b64/mod.rs b/libc/src/unix/notbsd/android/b64/mod.rs
index 46becc5..d9759bd 100644
--- a/libc/src/unix/notbsd/android/b64/mod.rs
+++ b/libc/src/unix/notbsd/android/b64/mod.rs
@@ -13,7 +13,7 @@ s! {
}
pub struct sigaction {
- pub sa_flags: ::c_uint,
+ pub sa_flags: ::c_int,
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_restorer: ::Option<extern fn()>,
@@ -25,12 +25,12 @@ s! {
}
pub struct pthread_attr_t {
- pub flags: ::uint32_t,
+ pub flags: u32,
pub stack_base: *mut ::c_void,
pub stack_size: ::size_t,
pub guard_size: ::size_t,
- pub sched_policy: ::int32_t,
- pub sched_priority: ::int32_t,
+ pub sched_policy: i32,
+ pub sched_priority: i32,
__reserved: [::c_char; 16],
}
@@ -45,18 +45,18 @@ s! {
}
pub struct statfs {
- pub f_type: ::uint64_t,
- pub f_bsize: ::uint64_t,
- pub f_blocks: ::uint64_t,
- pub f_bfree: ::uint64_t,
- pub f_bavail: ::uint64_t,
- pub f_files: ::uint64_t,
- pub f_ffree: ::uint64_t,
+ pub f_type: u64,
+ pub f_bsize: u64,
+ pub f_blocks: u64,
+ pub f_bfree: u64,
+ pub f_bavail: u64,
+ pub f_files: u64,
+ pub f_ffree: u64,
pub f_fsid: ::__fsid_t,
- pub f_namelen: ::uint64_t,
- pub f_frsize: ::uint64_t,
- pub f_flags: ::uint64_t,
- pub f_spare: [::uint64_t; 4],
+ pub f_namelen: u64,
+ pub f_frsize: u64,
+ pub f_flags: u64,
+ pub f_spare: [u64; 4],
}
pub struct sysinfo {
@@ -231,6 +231,15 @@ cfg_if! {
}
}
+// These constants must be of the same type of sigaction.sa_flags
+pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
+pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
+pub const SA_NODEFER: ::c_int = 0x40000000;
+pub const SA_ONSTACK: ::c_int = 0x08000000;
+pub const SA_RESETHAND: ::c_int = 0x80000000;
+pub const SA_RESTART: ::c_int = 0x10000000;
+pub const SA_SIGINFO: ::c_int = 0x00000004;
+
pub const RTLD_GLOBAL: ::c_int = 0x00100;
pub const RTLD_NOW: ::c_int = 2;
pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
diff --git a/libc/src/unix/notbsd/android/b64/x86_64.rs b/libc/src/unix/notbsd/android/b64/x86_64.rs
index c813e7d..2ab6080 100644
--- a/libc/src/unix/notbsd/android/b64/x86_64.rs
+++ b/libc/src/unix/notbsd/android/b64/x86_64.rs
@@ -13,12 +13,12 @@ s! {
pub st_size: ::off64_t,
pub st_blksize: ::c_long,
pub st_blocks: ::c_long,
- pub st_atime: ::c_ulong,
- pub st_atime_nsec: ::c_ulong,
- pub st_mtime: ::c_ulong,
- pub st_mtime_nsec: ::c_ulong,
- pub st_ctime: ::c_ulong,
- pub st_ctime_nsec: ::c_ulong,
+ pub st_atime: ::c_long,
+ pub st_atime_nsec: ::c_long,
+ pub st_mtime: ::c_long,
+ pub st_mtime_nsec: ::c_long,
+ pub st_ctime: ::c_long,
+ pub st_ctime_nsec: ::c_long,
__unused: [::c_long; 3],
}
@@ -33,12 +33,12 @@ s! {
pub st_size: ::off64_t,
pub st_blksize: ::c_long,
pub st_blocks: ::c_long,
- pub st_atime: ::c_ulong,
- pub st_atime_nsec: ::c_ulong,
- pub st_mtime: ::c_ulong,
- pub st_mtime_nsec: ::c_ulong,
- pub st_ctime: ::c_ulong,
- pub st_ctime_nsec: ::c_ulong,
+ pub st_atime: ::c_long,
+ pub st_atime_nsec: ::c_long,
+ pub st_mtime: ::c_long,
+ pub st_mtime_nsec: ::c_long,
+ pub st_ctime: ::c_long,
+ pub st_ctime_nsec: ::c_long,
__unused: [::c_long; 3],
}
}
diff --git a/libc/src/unix/notbsd/android/mod.rs b/libc/src/unix/notbsd/android/mod.rs
index a430b1a..f4fb83d 100644
--- a/libc/src/unix/notbsd/android/mod.rs
+++ b/libc/src/unix/notbsd/android/mod.rs
@@ -12,6 +12,7 @@ pub type pthread_t = ::c_long;
pub type pthread_mutexattr_t = ::c_long;
pub type pthread_rwlockattr_t = ::c_long;
pub type pthread_condattr_t = ::c_long;
+pub type pthread_key_t = ::c_int;
pub type fsfilcnt_t = ::c_ulong;
pub type fsblkcnt_t = ::c_ulong;
pub type nfds_t = ::c_uint;
@@ -112,28 +113,28 @@ s! {
}
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_signo: u32,
+ pub ssi_errno: i32,
+ pub ssi_code: i32,
+ pub ssi_pid: u32,
+ pub ssi_uid: u32,
+ pub ssi_fd: i32,
+ pub ssi_tid: u32,
+ pub ssi_band: u32,
+ pub ssi_overrun: u32,
+ pub ssi_trapno: u32,
+ pub ssi_status: i32,
+ pub ssi_int: i32,
pub ssi_ptr: ::c_ulonglong,
pub ssi_utime: ::c_ulonglong,
pub ssi_stime: ::c_ulonglong,
pub ssi_addr: ::c_ulonglong,
- pub ssi_addr_lsb: ::uint16_t,
- _pad2: ::uint16_t,
- pub ssi_syscall: ::int32_t,
- pub ssi_call_addr: ::uint64_t,
- pub ssi_arch: ::uint32_t,
- _pad: [::uint8_t; 28],
+ pub ssi_addr_lsb: u16,
+ _pad2: u16,
+ pub ssi_syscall: i32,
+ pub ssi_call_addr: u64,
+ pub ssi_arch: u32,
+ _pad: [u8; 28],
}
pub struct ucred {
@@ -193,13 +194,20 @@ s! {
pub struct inotify_event {
pub wd: ::c_int,
- pub mask: ::uint32_t,
- pub cookie: ::uint32_t,
- pub len: ::uint32_t
+ pub mask: u32,
+ pub cookie: u32,
+ pub len: u32
}
}
s_no_extra_traits!{
+ pub struct sockaddr_nl {
+ pub nl_family: ::sa_family_t,
+ nl_pad: ::c_ushort,
+ pub nl_pid: u32,
+ pub nl_groups: u32
+ }
+
pub struct dirent {
pub d_ino: u64,
pub d_off: i64,
@@ -240,7 +248,7 @@ s_no_extra_traits!{
pub ut_exit: exit_status,
pub ut_session: ::c_long,
pub ut_tv: ::timeval,
- pub ut_addr_v6: [::int32_t; 4],
+ pub ut_addr_v6: [i32; 4],
unused: [::c_char; 20],
}
@@ -260,6 +268,31 @@ s_no_extra_traits!{
cfg_if! {
if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for sockaddr_nl {
+ fn eq(&self, other: &sockaddr_nl) -> bool {
+ self.nl_family == other.nl_family &&
+ self.nl_pid == other.nl_pid &&
+ self.nl_groups == other.nl_groups
+ }
+ }
+ impl Eq for sockaddr_nl {}
+ impl ::fmt::Debug for sockaddr_nl {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("sockaddr_nl")
+ .field("nl_family", &self.nl_family)
+ .field("nl_pid", &self.nl_pid)
+ .field("nl_groups", &self.nl_groups)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for sockaddr_nl {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.nl_family.hash(state);
+ self.nl_pid.hash(state);
+ self.nl_groups.hash(state);
+ }
+ }
+
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_ino == other.d_ino
@@ -547,6 +580,10 @@ cfg_if! {
}
}
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MS_NOUSER: ::c_ulong = 0xffffffff80000000;
+pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
+
pub const O_TRUNC: ::c_int = 512;
pub const O_CLOEXEC: ::c_int = 0x80000;
pub const O_PATH: ::c_int = 0o10000000;
@@ -567,11 +604,6 @@ pub const ECOMM: ::c_int = 70;
pub const EPROTO: ::c_int = 71;
pub const EDOTDOT: ::c_int = 73;
-pub const SA_NODEFER: ::c_int = 0x40000000;
-pub const SA_RESETHAND: ::c_int = 0x80000000;
-pub const SA_RESTART: ::c_int = 0x10000000;
-pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
-
pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
pub const EPOLLONESHOT: ::c_int = 0x40000000;
pub const EPOLLRDHUP: ::c_int = 0x00002000;
@@ -581,12 +613,14 @@ pub const EFD_CLOEXEC: ::c_int = 0x80000;
pub const USER_PROCESS: ::c_short = 7;
+pub const FALLOC_FL_COLLAPSE_RANGE: ::c_int = 0x08;
+
pub const BUFSIZ: ::c_uint = 1024;
-pub const FILENAME_MAX: ::c_uint = 1024;
+pub const FILENAME_MAX: ::c_uint = 4096;
pub const FOPEN_MAX: ::c_uint = 20;
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
-pub const L_tmpnam: ::c_uint = 1024;
+pub const L_tmpnam: ::c_uint = 4096;
pub const TMP_MAX: ::c_uint = 308915776;
pub const _PC_LINK_MAX: ::c_int = 1;
pub const _PC_MAX_CANON: ::c_int = 2;
@@ -752,9 +786,6 @@ pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
pub const FIOCLEX: ::c_int = 0x5451;
-pub const SA_ONSTACK: ::c_ulong = 0x08000000;
-pub const SA_SIGINFO: ::c_ulong = 0x00000004;
-pub const SA_NOCLDWAIT: ::c_ulong = 0x00000002;
pub const SIGCHLD: ::c_int = 17;
pub const SIGBUS: ::c_int = 7;
pub const SIGUSR1: ::c_int = 10;
@@ -766,6 +797,10 @@ pub const SIGURG: ::c_int = 23;
pub const SIGIO: ::c_int = 29;
pub const SIGSYS: ::c_int = 31;
pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(
+ since = "0.2.55",
+ note = "Use SIGSYS instead"
+)]
pub const SIGUNUSED: ::c_int = 31;
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;
@@ -917,8 +952,19 @@ pub const SOL_NETROM: ::c_int = 259;
pub const SOL_ROSE: ::c_int = 260;
#[doc(hidden)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
pub const AF_MAX: ::c_int = 43;
#[doc(hidden)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;
/* DCCP socket options */
@@ -1056,11 +1102,21 @@ pub const F_GETOWN: ::c_int = 9;
pub const F_SETOWN: ::c_int = 8;
pub const F_SETLK: ::c_int = 6;
pub const F_SETLKW: ::c_int = 7;
-
pub const F_RDLCK: ::c_int = 0;
pub const F_WRLCK: ::c_int = 1;
pub const F_UNLCK: ::c_int = 2;
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_LOCKS: ::c_int = 10;
+pub const RLIMIT_SIGPENDING: ::c_int = 11;
+pub const RLIMIT_MSGQUEUE: ::c_int = 12;
+pub const RLIMIT_NICE: ::c_int = 13;
+pub const RLIMIT_RTPRIO: ::c_int = 14;
+
pub const TCGETS: ::c_int = 0x5401;
pub const TCSETS: ::c_int = 0x5402;
pub const TCSETSW: ::c_int = 0x5403;
@@ -1126,15 +1182,15 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const CBAUD: ::tcflag_t = 0o0010017;
-pub const TAB1: ::c_int = 0x00000800;
-pub const TAB2: ::c_int = 0x00001000;
-pub const TAB3: ::c_int = 0x00001800;
-pub const CR1: ::c_int = 0x00000200;
-pub const CR2: ::c_int = 0x00000400;
-pub const CR3: ::c_int = 0x00000600;
-pub const FF1: ::c_int = 0x00008000;
-pub const BS1: ::c_int = 0x00002000;
-pub const VT1: ::c_int = 0x00004000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
pub const VWERASE: usize = 14;
pub const VREPRINT: usize = 12;
pub const VSUSP: usize = 10;
@@ -1459,10 +1515,10 @@ pub const NF_IP6_PRI_CONNTRACK_HELPER: ::c_int = 300;
pub const NF_IP6_PRI_LAST: ::c_int = ::INT_MAX;
// linux/netfilter/nf_tables.h
-pub const NFT_TABLE_MAXNAMELEN: ::c_int = 32;
-pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 32;
-pub const NFT_SET_MAXNAMELEN: ::c_int = 32;
-pub const NFT_OBJ_MAXNAMELEN: ::c_int = 32;
+pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
+pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
+pub const NFT_SET_MAXNAMELEN: ::c_int = 256;
+pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256;
pub const NFT_USERDATA_MAXLEN: ::c_int = 256;
pub const NFT_REG_VERDICT: ::c_int = 0;
@@ -1519,7 +1575,7 @@ pub const NFT_MSG_NEWOBJ: ::c_int = 18;
pub const NFT_MSG_GETOBJ: ::c_int = 19;
pub const NFT_MSG_DELOBJ: ::c_int = 20;
pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21;
-pub const NFT_MSG_MAX: ::c_int = 22;
+pub const NFT_MSG_MAX: ::c_int = 25;
pub const NFT_SET_ANONYMOUS: ::c_int = 0x1;
pub const NFT_SET_CONSTANT: ::c_int = 0x2;
@@ -1789,7 +1845,10 @@ pub const SIOCSIFMAP: ::c_ulong = 0x00008971;
pub const MODULE_INIT_IGNORE_MODVERSIONS: ::c_uint = 0x0001;
pub const MODULE_INIT_IGNORE_VERMAGIC: ::c_uint = 0x0002;
-// Similarity to Linux it's not used but defined for compatibility.
+#[deprecated(
+ since = "0.2.55",
+ note = "ENOATTR is not available on Android; use ENODATA instead"
+)]
pub const ENOATTR: ::c_int = ::ENODATA;
// linux/if_alg.h
@@ -1803,33 +1862,33 @@ pub const ALG_OP_DECRYPT: ::c_int = 0;
pub const ALG_OP_ENCRYPT: ::c_int = 1;
// uapi/linux/inotify.h
-pub const IN_ACCESS: ::uint32_t = 0x0000_0001;
-pub const IN_MODIFY: ::uint32_t = 0x0000_0002;
-pub const IN_ATTRIB: ::uint32_t = 0x0000_0004;
-pub const IN_CLOSE_WRITE: ::uint32_t = 0x0000_0008;
-pub const IN_CLOSE_NOWRITE: ::uint32_t = 0x0000_0010;
-pub const IN_CLOSE: ::uint32_t = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
-pub const IN_OPEN: ::uint32_t = 0x0000_0020;
-pub const IN_MOVED_FROM: ::uint32_t = 0x0000_0040;
-pub const IN_MOVED_TO: ::uint32_t = 0x0000_0080;
-pub const IN_MOVE: ::uint32_t = (IN_MOVED_FROM | IN_MOVED_TO);
-pub const IN_CREATE: ::uint32_t = 0x0000_0100;
-pub const IN_DELETE: ::uint32_t = 0x0000_0200;
-pub const IN_DELETE_SELF: ::uint32_t = 0x0000_0400;
-pub const IN_MOVE_SELF: ::uint32_t = 0x0000_0800;
-pub const IN_UNMOUNT: ::uint32_t = 0x0000_2000;
-pub const IN_Q_OVERFLOW: ::uint32_t = 0x0000_4000;
-pub const IN_IGNORED: ::uint32_t = 0x0000_8000;
-pub const IN_ONLYDIR: ::uint32_t = 0x0100_0000;
-pub const IN_DONT_FOLLOW: ::uint32_t = 0x0200_0000;
-// pub const IN_EXCL_UNLINK: ::uint32_t = 0x0400_0000;
-
-// pub const IN_MASK_CREATE: ::uint32_t = 0x1000_0000;
-// pub const IN_MASK_ADD: ::uint32_t = 0x2000_0000;
-pub const IN_ISDIR: ::uint32_t = 0x4000_0000;
-pub const IN_ONESHOT: ::uint32_t = 0x8000_0000;
-
-pub const IN_ALL_EVENTS: ::uint32_t = (
+pub const IN_ACCESS: u32 = 0x0000_0001;
+pub const IN_MODIFY: u32 = 0x0000_0002;
+pub const IN_ATTRIB: u32 = 0x0000_0004;
+pub const IN_CLOSE_WRITE: u32 = 0x0000_0008;
+pub const IN_CLOSE_NOWRITE: u32 = 0x0000_0010;
+pub const IN_CLOSE: u32 = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
+pub const IN_OPEN: u32 = 0x0000_0020;
+pub const IN_MOVED_FROM: u32 = 0x0000_0040;
+pub const IN_MOVED_TO: u32 = 0x0000_0080;
+pub const IN_MOVE: u32 = (IN_MOVED_FROM | IN_MOVED_TO);
+pub const IN_CREATE: u32 = 0x0000_0100;
+pub const IN_DELETE: u32 = 0x0000_0200;
+pub const IN_DELETE_SELF: u32 = 0x0000_0400;
+pub const IN_MOVE_SELF: u32 = 0x0000_0800;
+pub const IN_UNMOUNT: u32 = 0x0000_2000;
+pub const IN_Q_OVERFLOW: u32 = 0x0000_4000;
+pub const IN_IGNORED: u32 = 0x0000_8000;
+pub const IN_ONLYDIR: u32 = 0x0100_0000;
+pub const IN_DONT_FOLLOW: u32 = 0x0200_0000;
+// pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
+
+// pub const IN_MASK_CREATE: u32 = 0x1000_0000;
+// pub const IN_MASK_ADD: u32 = 0x2000_0000;
+pub const IN_ISDIR: u32 = 0x4000_0000;
+pub const IN_ONESHOT: u32 = 0x8000_0000;
+
+pub const IN_ALL_EVENTS: u32 = (
IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |
IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |
@@ -1920,19 +1979,26 @@ f! {
}
extern {
- static mut __progname: *mut ::c_char;
-}
-
-extern {
- pub fn madvise(addr: *const ::c_void, len: ::size_t, advice: ::c_int)
+ pub fn getrlimit64(resource: ::c_int,
+ rlim: *mut rlimit64) -> ::c_int;
+ pub fn setrlimit64(resource: ::c_int,
+ rlim: *const rlimit64) -> ::c_int;
+ pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+ pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char,
+ buflen: ::size_t) -> ::c_int;
+
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::timezone) -> ::c_int;
+ pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
-> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
- pub fn msync(addr: *const ::c_void, len: ::size_t,
+ pub fn msync(addr: *mut ::c_void, len: ::size_t,
flags: ::c_int) -> ::c_int;
- pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
+ pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
-> ::c_int;
pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
- flags: ::c_int, addr: *const ::sockaddr,
+ flags: ::c_int, addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t) -> ::ssize_t;
pub fn getnameinfo(sa: *const ::sockaddr,
salen: ::socklen_t,
@@ -1942,11 +2008,12 @@ extern {
sevlen: ::size_t,
flags: ::c_int) -> ::c_int;
pub fn ptrace(request: ::c_int, ...) -> ::c_long;
- pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
- pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
+ pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
+ pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
pub fn __sched_cpualloc(count: ::size_t) -> *mut ::cpu_set_t;
pub fn __sched_cpufree(set: *mut ::cpu_set_t);
- pub fn __sched_cpucount(setsize: ::size_t, set: *mut cpu_set_t) -> ::c_int;
+ pub fn __sched_cpucount(setsize: ::size_t,
+ set: *const cpu_set_t) -> ::c_int;
pub fn sched_getcpu() -> ::c_int;
pub fn utmpname(name: *const ::c_char) -> ::c_int;
@@ -2009,7 +2076,7 @@ extern {
fstype: *const ::c_char,
flags: ::c_ulong,
data: *const ::c_void) -> ::c_int;
- pub fn personality(persona: ::c_ulong) -> ::c_int;
+ pub fn personality(persona: ::c_uint) -> ::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,
@@ -2061,7 +2128,6 @@ extern {
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,
@@ -2118,7 +2184,7 @@ extern {
f: extern fn(*mut ::c_void) -> *mut ::c_void,
value: *mut ::c_void) -> ::c_int;
pub fn __errno() -> *mut ::c_int;
- pub fn inotify_rm_watch(fd: ::c_int, wd: ::uint32_t) -> ::c_int;
+ pub fn inotify_rm_watch(fd: ::c_int, wd: u32) -> ::c_int;
pub fn sendmmsg(sockfd: ::c_int, msgvec: *const ::mmsghdr, vlen: ::c_uint,
flags: ::c_int) -> ::c_int;
pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint,
@@ -2127,7 +2193,7 @@ extern {
pub fn inotify_init1(flags: ::c_int) -> ::c_int;
pub fn inotify_add_watch(fd: ::c_int,
path: *const ::c_char,
- mask: ::uint32_t) -> ::c_int;
+ mask: u32) -> ::c_int;
}
cfg_if! {
diff --git a/libc/src/unix/notbsd/emscripten/mod.rs b/libc/src/unix/notbsd/emscripten/mod.rs
index 0f8c76e..ba13d8e 100644
--- a/libc/src/unix/notbsd/emscripten/mod.rs
+++ b/libc/src/unix/notbsd/emscripten/mod.rs
@@ -17,6 +17,7 @@ pub type nfds_t = ::c_ulong;
pub type nl_item = ::c_int;
pub type idtype_t = ::c_uint;
pub type loff_t = i32;
+pub type pthread_key_t = ::c_uint;
pub type clock_t = c_long;
pub type time_t = c_long;
@@ -98,54 +99,46 @@ s! {
}
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 dqb_bhardlimit: u64,
+ pub dqb_bsoftlimit: u64,
+ pub dqb_curspace: u64,
+ pub dqb_ihardlimit: u64,
+ pub dqb_isoftlimit: u64,
+ pub dqb_curinodes: u64,
+ pub dqb_btime: u64,
+ pub dqb_itime: u64,
+ pub dqb_valid: u32,
}
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,
- pub ssi_addr_lsb: ::uint16_t,
- _pad2: ::uint16_t,
- pub ssi_syscall: ::int32_t,
- pub ssi_call_addr: ::uint64_t,
- pub ssi_arch: ::uint32_t,
- _pad: [::uint8_t; 28],
+ pub ssi_signo: u32,
+ pub ssi_errno: i32,
+ pub ssi_code: i32,
+ pub ssi_pid: u32,
+ pub ssi_uid: u32,
+ pub ssi_fd: i32,
+ pub ssi_tid: u32,
+ pub ssi_band: u32,
+ pub ssi_overrun: u32,
+ pub ssi_trapno: u32,
+ pub ssi_status: i32,
+ pub ssi_int: i32,
+ pub ssi_ptr: u64,
+ pub ssi_utime: u64,
+ pub ssi_stime: u64,
+ pub ssi_addr: u64,
+ pub ssi_addr_lsb: u16,
+ _pad2: u16,
+ pub ssi_syscall: i32,
+ pub ssi_call_addr: u64,
+ pub ssi_arch: u32,
+ _pad: [u8; 28],
}
pub struct fsid_t {
__val: [::c_int; 2],
}
- pub struct mq_attr {
- pub mq_flags: ::c_long,
- pub mq_maxmsg: ::c_long,
- pub mq_msgsize: ::c_long,
- pub mq_curmsgs: ::c_long,
- pad: [::c_long; 4]
- }
-
pub struct cpu_set_t {
bits: [u32; 32],
}
@@ -435,6 +428,14 @@ s_no_extra_traits! {
pub mem_unit: ::c_uint,
pub __reserved: [::c_char; 256],
}
+
+ pub struct mq_attr {
+ pub mq_flags: ::c_long,
+ pub mq_maxmsg: ::c_long,
+ pub mq_msgsize: ::c_long,
+ pub mq_curmsgs: ::c_long,
+ pad: [::c_long; 4]
+ }
}
cfg_if! {
@@ -570,9 +571,41 @@ cfg_if! {
self.__reserved.hash(state);
}
}
+
+ impl PartialEq for mq_attr {
+ fn eq(&self, other: &mq_attr) -> bool {
+ self.mq_flags == other.mq_flags &&
+ self.mq_maxmsg == other.mq_maxmsg &&
+ self.mq_msgsize == other.mq_msgsize &&
+ self.mq_curmsgs == other.mq_curmsgs
+ }
+ }
+ impl Eq for mq_attr {}
+ impl ::fmt::Debug for mq_attr {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mq_attr")
+ .field("mq_flags", &self.mq_flags)
+ .field("mq_maxmsg", &self.mq_maxmsg)
+ .field("mq_msgsize", &self.mq_msgsize)
+ .field("mq_curmsgs", &self.mq_curmsgs)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for mq_attr {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.mq_flags.hash(state);
+ self.mq_maxmsg.hash(state);
+ self.mq_msgsize.hash(state);
+ self.mq_curmsgs.hash(state);
+ }
+ }
}
}
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MS_NOUSER: ::c_ulong = 0x80000000;
+pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
+
pub const ABDAY_1: ::nl_item = 0x20000;
pub const ABDAY_2: ::nl_item = 0x20001;
pub const ABDAY_3: ::nl_item = 0x20002;
@@ -889,12 +922,23 @@ pub const AF_MPLS: ::c_int = 28;
pub const AF_NFC: ::c_int = 39;
pub const AF_VSOCK: ::c_int = 40;
#[doc(hidden)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
pub const AF_MAX: ::c_int = 42;
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;
#[doc(hidden)]
+#[allow(deprecated)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
pub const PF_MAX: ::c_int = AF_MAX;
// System V IPC
@@ -913,7 +957,6 @@ 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;
pub const SHM_R: ::c_int = 0o400;
pub const SHM_W: ::c_int = 0o200;
@@ -1124,10 +1167,6 @@ pub const _POSIX_VDISABLE: ::cc_t = 0;
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;
// 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,
@@ -1180,12 +1219,10 @@ pub const POSIX_FADV_NOREUSE: ::c_int = 5;
pub const POSIX_MADV_DONTNEED: ::c_int = 0;
pub const RLIM_INFINITY: ::rlim_t = !0;
-pub const RLIMIT_RTTIME: ::c_int = 15;
-pub const RLIMIT_NLIMITS: ::c_int = 16;
+pub const RLIMIT_NLIMITS: ::c_int = 15;
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
-pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
pub const TCP_THIN_DUPACK: ::c_int = 17;
pub const TCP_USER_TIMEOUT: ::c_int = 18;
@@ -1196,6 +1233,11 @@ pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
pub const TCP_FASTOPEN: ::c_int = 23;
pub const TCP_TIMESTAMP: ::c_int = 24;
+#[doc(hidden)]
+#[deprecated(
+ since = "0.2.55",
+ note = "Use SIGSYS instead"
+)]
pub const SIGUNUSED: ::c_int = ::SIGSYS;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
@@ -1368,6 +1410,16 @@ pub const RLIMIT_NOFILE: ::c_int = 7;
pub const RLIMIT_AS: ::c_int = 9;
pub const RLIMIT_NPROC: ::c_int = 6;
pub const RLIMIT_MEMLOCK: ::c_int = 8;
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_LOCKS: ::c_int = 10;
+pub const RLIMIT_SIGPENDING: ::c_int = 11;
+pub const RLIMIT_MSGQUEUE: ::c_int = 12;
+pub const RLIMIT_NICE: ::c_int = 13;
+pub const RLIMIT_RTPRIO: ::c_int = 14;
pub const O_APPEND: ::c_int = 1024;
pub const O_CREAT: ::c_int = 64;
@@ -1683,12 +1735,24 @@ f! {
}
extern {
+ pub fn getrlimit64(resource: ::c_int,
+ rlim: *mut rlimit64) -> ::c_int;
+ pub fn setrlimit64(resource: ::c_int,
+ rlim: *const rlimit64) -> ::c_int;
+ pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
+ pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char,
+ buflen: ::size_t) -> ::c_int;
+
pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
pub fn rand() -> ::c_int;
pub fn srand(seed: ::c_uint);
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::c_void) -> ::c_int;
+
pub fn setpwent();
pub fn endpwent();
pub fn getpwent() -> *mut passwd;
@@ -1777,9 +1841,9 @@ extern {
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 sendmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint,
- flags: ::c_int) -> ::c_int;
+ flags: ::c_uint) -> ::c_int;
pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint,
- flags: ::c_int, timeout: *mut ::timespec) -> ::c_int;
+ flags: ::c_uint, timeout: *mut ::timespec) -> ::c_int;
pub fn sync();
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
diff --git a/libc/src/unix/notbsd/linux/mips/mod.rs b/libc/src/unix/notbsd/linux/mips/mod.rs
index 35534b4..46c49ff 100644
--- a/libc/src/unix/notbsd/linux/mips/mod.rs
+++ b/libc/src/unix/notbsd/linux/mips/mod.rs
@@ -1,3 +1,4 @@
+pub type pthread_t = c_ulong;
pub type shmatt_t = ::c_ulong;
pub type msgqnum_t = ::c_ulong;
pub type msglen_t = ::c_ulong;
@@ -5,6 +6,7 @@ pub type fsblkcnt_t = ::c_ulong;
pub type fsfilcnt_t = ::c_ulong;
pub type rlim_t = c_ulong;
pub type __priority_which_t = ::c_uint;
+pub type __rlimit_resource_t = ::c_uint;
s! {
pub struct glob64_t {
@@ -70,6 +72,8 @@ s! {
}
}
+pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
+
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
@@ -334,6 +338,8 @@ pub const MAP_LOCKED: ::c_int = 0x8000;
pub const MAP_POPULATE: ::c_int = 0x10000;
pub const MAP_NONBLOCK: ::c_int = 0x20000;
pub const MAP_STACK: ::c_int = 0x40000;
+pub const MAP_SHARED_VALIDATE: ::c_int = 0x3;
+pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000;
pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
@@ -591,15 +597,15 @@ pub const MCL_FUTURE: ::c_int = 0x0002;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const CBAUD: ::tcflag_t = 0o0010017;
-pub const TAB1: ::c_int = 0x00000800;
-pub const TAB2: ::c_int = 0x00001000;
-pub const TAB3: ::c_int = 0x00001800;
-pub const CR1: ::c_int = 0x00000200;
-pub const CR2: ::c_int = 0x00000400;
-pub const CR3: ::c_int = 0x00000600;
-pub const FF1: ::c_int = 0x00008000;
-pub const BS1: ::c_int = 0x00002000;
-pub const VT1: ::c_int = 0x00004000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
pub const VWERASE: usize = 14;
pub const VREPRINT: usize = 12;
pub const VSUSP: usize = 10;
@@ -888,9 +894,31 @@ pub const NFT_TRACETYPE_RULE: ::c_int = 3;
pub const NFT_NG_INCREMENTAL: ::c_int = 0;
pub const NFT_NG_RANDOM: ::c_int = 1;
+pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+
#[doc(hidden)]
-pub const AF_MAX: ::c_int = 42;
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+pub const AF_MAX: ::c_int = 45;
#[doc(hidden)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;
f! {
@@ -901,6 +929,26 @@ f! {
#[link(name = "util")]
extern {
+ 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;
+
+ pub fn getrlimit64(resource: ::__rlimit_resource_t,
+ rlim: *mut ::rlimit64) -> ::c_int;
+ pub fn setrlimit64(resource: ::__rlimit_resource_t,
+ rlim: *const ::rlimit64) -> ::c_int;
+ pub fn getrlimit(resource: ::__rlimit_resource_t,
+ rlim: *mut ::rlimit) -> ::c_int;
+ pub fn setrlimit(resource: ::__rlimit_resource_t,
+ rlim: *const ::rlimit) -> ::c_int;
+ pub fn prlimit(pid: ::pid_t,
+ resource: ::__rlimit_resource_t, new_limit: *const ::rlimit,
+ old_limit: *mut ::rlimit) -> ::c_int;
+ pub fn prlimit64(pid: ::pid_t,
+ resource: ::__rlimit_resource_t,
+ new_limit: *const ::rlimit64,
+ old_limit: *mut ::rlimit64) -> ::c_int;
pub fn sysctl(name: *mut ::c_int,
namelen: ::c_int,
oldp: *mut ::c_void,
diff --git a/libc/src/unix/notbsd/linux/mod.rs b/libc/src/unix/notbsd/linux/mod.rs
index 2419a41..3b7bc29 100644
--- a/libc/src/unix/notbsd/linux/mod.rs
+++ b/libc/src/unix/notbsd/linux/mod.rs
@@ -3,7 +3,6 @@
pub type useconds_t = u32;
pub type dev_t = u64;
pub type socklen_t = u32;
-pub type pthread_t = c_ulong;
pub type mode_t = u32;
pub type ino64_t = u64;
pub type off64_t = i64;
@@ -14,6 +13,7 @@ pub type nfds_t = ::c_ulong;
pub type nl_item = ::c_int;
pub type idtype_t = ::c_uint;
pub type loff_t = ::c_longlong;
+pub type pthread_key_t = ::c_uint;
pub type __u8 = ::c_uchar;
pub type __u16 = ::c_ushort;
@@ -85,40 +85,40 @@ s! {
}
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 dqb_bhardlimit: u64,
+ pub dqb_bsoftlimit: u64,
+ pub dqb_curspace: u64,
+ pub dqb_ihardlimit: u64,
+ pub dqb_isoftlimit: u64,
+ pub dqb_curinodes: u64,
+ pub dqb_btime: u64,
+ pub dqb_itime: u64,
+ pub dqb_valid: u32,
}
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,
- pub ssi_addr_lsb: ::uint16_t,
- _pad2: ::uint16_t,
- pub ssi_syscall: ::int32_t,
- pub ssi_call_addr: ::uint64_t,
- pub ssi_arch: ::uint32_t,
- _pad: [::uint8_t; 28],
+ pub ssi_signo: u32,
+ pub ssi_errno: i32,
+ pub ssi_code: i32,
+ pub ssi_pid: u32,
+ pub ssi_uid: u32,
+ pub ssi_fd: i32,
+ pub ssi_tid: u32,
+ pub ssi_band: u32,
+ pub ssi_overrun: u32,
+ pub ssi_trapno: u32,
+ pub ssi_status: i32,
+ pub ssi_int: i32,
+ pub ssi_ptr: u64,
+ pub ssi_utime: u64,
+ pub ssi_stime: u64,
+ pub ssi_addr: u64,
+ pub ssi_addr_lsb: u16,
+ _pad2: u16,
+ pub ssi_syscall: i32,
+ pub ssi_call_addr: u64,
+ pub ssi_arch: u32,
+ _pad: [u8; 28],
}
pub struct itimerspec {
@@ -130,32 +130,6 @@ s! {
__val: [::c_int; 2],
}
- // x32 compatibility
- // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
- pub struct mq_attr {
- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
- pub mq_flags: i64,
- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
- pub mq_maxmsg: i64,
- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
- pub mq_msgsize: i64,
- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
- pub mq_curmsgs: i64,
- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
- pad: [i64; 4],
-
- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
- pub mq_flags: ::c_long,
- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
- pub mq_maxmsg: ::c_long,
- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
- pub mq_msgsize: ::c_long,
- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
- pub mq_curmsgs: ::c_long,
- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
- pad: [::c_long; 4],
- }
-
pub struct packet_mreq {
pub mr_ifindex: ::c_int,
pub mr_type: ::c_ushort,
@@ -496,13 +470,20 @@ s! {
pub struct inotify_event {
pub wd: ::c_int,
- pub mask: ::uint32_t,
- pub cookie: ::uint32_t,
- pub len: ::uint32_t
+ pub mask: u32,
+ pub cookie: u32,
+ pub len: u32
}
}
s_no_extra_traits!{
+ pub struct sockaddr_nl {
+ pub nl_family: ::sa_family_t,
+ nl_pad: ::c_ushort,
+ pub nl_pid: u32,
+ pub nl_groups: u32
+ }
+
pub struct dirent {
pub d_ino: ::ino_t,
pub d_off: ::off_t,
@@ -531,10 +512,61 @@ s_no_extra_traits!{
pub ivlen: u32,
pub iv: [::c_uchar; 0],
}
+
+ // x32 compatibility
+ // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
+ pub struct mq_attr {
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ pub mq_flags: i64,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ pub mq_maxmsg: i64,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ pub mq_msgsize: i64,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ pub mq_curmsgs: i64,
+ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
+ pad: [i64; 4],
+
+ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+ pub mq_flags: ::c_long,
+ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+ pub mq_maxmsg: ::c_long,
+ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+ pub mq_msgsize: ::c_long,
+ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+ pub mq_curmsgs: ::c_long,
+ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
+ pad: [::c_long; 4],
+ }
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for sockaddr_nl {
+ fn eq(&self, other: &sockaddr_nl) -> bool {
+ self.nl_family == other.nl_family &&
+ self.nl_pid == other.nl_pid &&
+ self.nl_groups == other.nl_groups
+ }
+ }
+ impl Eq for sockaddr_nl {}
+ impl ::fmt::Debug for sockaddr_nl {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("sockaddr_nl")
+ .field("nl_family", &self.nl_family)
+ .field("nl_pid", &self.nl_pid)
+ .field("nl_groups", &self.nl_groups)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for sockaddr_nl {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.nl_family.hash(state);
+ self.nl_pid.hash(state);
+ self.nl_groups.hash(state);
+ }
+ }
+
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_ino == other.d_ino
@@ -751,6 +783,34 @@ cfg_if! {
self.as_slice().hash(state);
}
}
+
+ impl PartialEq for mq_attr {
+ fn eq(&self, other: &mq_attr) -> bool {
+ self.mq_flags == other.mq_flags &&
+ self.mq_maxmsg == other.mq_maxmsg &&
+ self.mq_msgsize == other.mq_msgsize &&
+ self.mq_curmsgs == other.mq_curmsgs
+ }
+ }
+ impl Eq for mq_attr {}
+ impl ::fmt::Debug for mq_attr {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("mq_attr")
+ .field("mq_flags", &self.mq_flags)
+ .field("mq_maxmsg", &self.mq_maxmsg)
+ .field("mq_msgsize", &self.mq_msgsize)
+ .field("mq_curmsgs", &self.mq_curmsgs)
+ .finish()
+ }
+ }
+ impl ::hash::Hash for mq_attr {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.mq_flags.hash(state);
+ self.mq_maxmsg.hash(state);
+ self.mq_msgsize.hash(state);
+ self.mq_curmsgs.hash(state);
+ }
+ }
}
}
@@ -849,6 +909,8 @@ 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;
+pub const MS_NOUSER: ::c_ulong = 0xffffffff80000000;
+
pub const _SC_ARG_MAX: ::c_int = 0;
pub const _SC_CHILD_MAX: ::c_int = 1;
pub const _SC_CLK_TCK: ::c_int = 2;
@@ -1020,30 +1082,62 @@ pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
+pub const F_SEAL_FUTURE_WRITE: ::c_int = 0x0010;
+
pub const IFF_LOWER_UP: ::c_int = 0x10000;
pub const IFF_DORMANT: ::c_int = 0x20000;
pub const IFF_ECHO: ::c_int = 0x40000;
+// linux/if_addr.h
+pub const IFA_UNSPEC: ::c_ushort = 0;
+pub const IFA_ADDRESS: ::c_ushort = 1;
+pub const IFA_LOCAL: ::c_ushort = 2;
+pub const IFA_LABEL: ::c_ushort = 3;
+pub const IFA_BROADCAST: ::c_ushort = 4;
+pub const IFA_ANYCAST: ::c_ushort = 5;
+pub const IFA_CACHEINFO: ::c_ushort = 6;
+pub const IFA_MULTICAST: ::c_ushort = 7;
+
+pub const IFA_F_SECONDARY: u32 = 0x01;
+pub const IFA_F_TEMPORARY: u32 = 0x01;
+pub const IFA_F_NODAD: u32 = 0x02;
+pub const IFA_F_OPTIMISTIC: u32 = 0x04;
+pub const IFA_F_DADFAILED: u32 = 0x08;
+pub const IFA_F_HOMEADDRESS: u32 = 0x10;
+pub const IFA_F_DEPRECATED: u32 = 0x20;
+pub const IFA_F_TENTATIVE: u32 = 0x40;
+pub const IFA_F_PERMANENT: u32 = 0x80;
+
+// linux/if_link.h
+pub const IFLA_UNSPEC: ::c_ushort = 0;
+pub const IFLA_ADDRESS: ::c_ushort = 1;
+pub const IFLA_BROADCAST: ::c_ushort = 2;
+pub const IFLA_IFNAME: ::c_ushort = 3;
+pub const IFLA_MTU: ::c_ushort = 4;
+pub const IFLA_LINK: ::c_ushort = 5;
+pub const IFLA_QDISC: ::c_ushort = 6;
+pub const IFLA_STATS: ::c_ushort = 7;
+
// linux/if_tun.h
-pub const IFF_TUN: ::c_short = 0x0001;
-pub const IFF_TAP: ::c_short = 0x0002;
-pub const IFF_NO_PI: ::c_short = 0x1000;
+pub const IFF_TUN: ::c_int = 0x0001;
+pub const IFF_TAP: ::c_int = 0x0002;
+pub const IFF_NO_PI: ::c_int = 0x1000;
// Read queue size
pub const TUN_READQ_SIZE: ::c_short = 500;
// TUN device type flags: deprecated. Use IFF_TUN/IFF_TAP instead.
-pub const TUN_TUN_DEV: ::c_short = ::IFF_TUN;
-pub const TUN_TAP_DEV: ::c_short = ::IFF_TAP;
+pub const TUN_TUN_DEV: ::c_short = ::IFF_TUN as ::c_short;
+pub const TUN_TAP_DEV: ::c_short = ::IFF_TAP as ::c_short;
pub const TUN_TYPE_MASK: ::c_short = 0x000f;
// This flag has no real effect
-pub const IFF_ONE_QUEUE: ::c_short = 0x2000;
-pub const IFF_VNET_HDR: ::c_short = 0x4000;
-pub const IFF_TUN_EXCL: ::c_short = 0x8000;
-pub const IFF_MULTI_QUEUE: ::c_short = 0x0100;
-pub const IFF_ATTACH_QUEUE: ::c_short = 0x0200;
-pub const IFF_DETACH_QUEUE: ::c_short = 0x0400;
+pub const IFF_ONE_QUEUE: ::c_int = 0x2000;
+pub const IFF_VNET_HDR: ::c_int = 0x4000;
+pub const IFF_TUN_EXCL: ::c_int = 0x8000;
+pub const IFF_MULTI_QUEUE: ::c_int = 0x0100;
+pub const IFF_ATTACH_QUEUE: ::c_int = 0x0200;
+pub const IFF_DETACH_QUEUE: ::c_int = 0x0400;
// read-only flag
-pub const IFF_PERSIST: ::c_short = 0x0800;
-pub const IFF_NOFILTER: ::c_short = 0x1000;
+pub const IFF_PERSIST: ::c_int = 0x0800;
+pub const IFF_NOFILTER: ::c_int = 0x1000;
pub const ST_RDONLY: ::c_ulong = 1;
pub const ST_NOSUID: ::c_ulong = 2;
@@ -1406,9 +1500,10 @@ 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;
-// 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.
+#[deprecated(
+ since = "0.2.55",
+ note = "ENOATTR is not available on Linux; use ENODATA instead"
+)]
pub const ENOATTR: ::c_int = ::ENODATA;
pub const SO_ORIGINAL_DST: ::c_int = 80;
@@ -1767,6 +1862,99 @@ pub const RT_CLASS_MAIN: u8 = 254;
pub const RT_CLASS_LOCAL: u8 = 255;
pub const RT_CLASS_MAX: u8 = 255;
+// linux/neighbor.h
+pub const NUD_NONE: u16 = 0x00;
+pub const NUD_INCOMPLETE: u16 = 0x01;
+pub const NUD_REACHABLE: u16 = 0x02;
+pub const NUD_STALE: u16 = 0x04;
+pub const NUD_DELAY: u16 = 0x08;
+pub const NUD_PROBE: u16 = 0x10;
+pub const NUD_FAILED: u16 = 0x20;
+pub const NUD_NOARP: u16 = 0x40;
+pub const NUD_PERMANENT: u16 = 0x80;
+
+pub const NTF_USE: u8 = 0x01;
+pub const NTF_SELF: u8 = 0x02;
+pub const NTF_MASTER: u8 = 0x04;
+pub const NTF_PROXY: u8 = 0x08;
+pub const NTF_ROUTER: u8 = 0x80;
+
+pub const NDA_UNSPEC: ::c_ushort = 0;
+pub const NDA_DST: ::c_ushort = 1;
+pub const NDA_LLADDR: ::c_ushort = 2;
+pub const NDA_CACHEINFO: ::c_ushort = 3;
+pub const NDA_PROBES: ::c_ushort = 4;
+pub const NDA_VLAN: ::c_ushort = 5;
+pub const NDA_PORT: ::c_ushort = 6;
+pub const NDA_VNI: ::c_ushort = 7;
+pub const NDA_IFINDEX: ::c_ushort = 8;
+
+// linux/rtnetlink.h
+pub const TCA_UNSPEC: ::c_ushort = 0;
+pub const TCA_KIND: ::c_ushort = 1;
+pub const TCA_OPTIONS: ::c_ushort = 2;
+pub const TCA_STATS: ::c_ushort = 3;
+pub const TCA_XSTATS: ::c_ushort = 4;
+pub const TCA_RATE: ::c_ushort = 5;
+pub const TCA_FCNT: ::c_ushort = 6;
+pub const TCA_STATS2: ::c_ushort = 7;
+pub const TCA_STAB: ::c_ushort = 8;
+
+pub const RTM_F_NOTIFY: ::c_uint = 0x100;
+pub const RTM_F_CLONED: ::c_uint = 0x200;
+pub const RTM_F_EQUALIZE: ::c_uint = 0x400;
+pub const RTM_F_PREFIX: ::c_uint = 0x800;
+
+pub const RTA_UNSPEC: ::c_ushort = 0;
+pub const RTA_DST: ::c_ushort = 1;
+pub const RTA_SRC: ::c_ushort = 2;
+pub const RTA_IIF: ::c_ushort = 3;
+pub const RTA_OIF: ::c_ushort = 4;
+pub const RTA_GATEWAY: ::c_ushort = 5;
+pub const RTA_PRIORITY: ::c_ushort = 6;
+pub const RTA_PREFSRC: ::c_ushort = 7;
+pub const RTA_METRICS: ::c_ushort = 8;
+pub const RTA_MULTIPATH: ::c_ushort = 9;
+pub const RTA_PROTOINFO: ::c_ushort = 10; // No longer used
+pub const RTA_FLOW: ::c_ushort = 11;
+pub const RTA_CACHEINFO: ::c_ushort = 12;
+pub const RTA_SESSION: ::c_ushort = 13; // No longer used
+pub const RTA_MP_ALGO: ::c_ushort = 14; // No longer used
+pub const RTA_TABLE: ::c_ushort = 15;
+pub const RTA_MARK: ::c_ushort = 16;
+pub const RTA_MFC_STATS: ::c_ushort = 17;
+
+pub const RTN_UNSPEC: ::c_uchar = 0;
+pub const RTN_UNICAST: ::c_uchar = 1;
+pub const RTN_LOCAL: ::c_uchar = 2;
+pub const RTN_BROADCAST: ::c_uchar = 3;
+pub const RTN_ANYCAST: ::c_uchar = 4;
+pub const RTN_MULTICAST: ::c_uchar = 5;
+pub const RTN_BLACKHOLE: ::c_uchar = 6;
+pub const RTN_UNREACHABLE: ::c_uchar = 7;
+pub const RTN_PROHIBIT: ::c_uchar = 8;
+pub const RTN_THROW: ::c_uchar = 9;
+pub const RTN_NAT: ::c_uchar = 10;
+pub const RTN_XRESOLVE: ::c_uchar = 11;
+
+pub const RTPROT_UNSPEC: ::c_uchar = 0;
+pub const RTPROT_REDIRECT: ::c_uchar = 1;
+pub const RTPROT_KERNEL: ::c_uchar = 2;
+pub const RTPROT_BOOT: ::c_uchar = 3;
+pub const RTPROT_STATIC: ::c_uchar = 4;
+
+pub const RT_SCOPE_UNIVERSE: ::c_uchar = 0;
+pub const RT_SCOPE_SITE: ::c_uchar = 200;
+pub const RT_SCOPE_LINK: ::c_uchar = 253;
+pub const RT_SCOPE_HOST: ::c_uchar = 254;
+pub const RT_SCOPE_NOWHERE: ::c_uchar = 255;
+
+pub const RT_TABLE_UNSPEC: ::c_uchar = 0;
+pub const RT_TABLE_COMPAT: ::c_uchar = 252;
+pub const RT_TABLE_DEFAULT: ::c_uchar = 253;
+pub const RT_TABLE_MAIN: ::c_uchar = 254;
+pub const RT_TABLE_LOCAL: ::c_uchar = 255;
+
pub const RTMSG_OVERRUN: u32 = ::NLMSG_OVERRUN as u32;
pub const RTMSG_NEWDEVICE: u32 = 0x11;
pub const RTMSG_DELDEVICE: u32 = 0x12;
@@ -1813,33 +2001,33 @@ pub const ALG_OP_DECRYPT: ::c_int = 0;
pub const ALG_OP_ENCRYPT: ::c_int = 1;
// uapi/linux/inotify.h
-pub const IN_ACCESS: ::uint32_t = 0x0000_0001;
-pub const IN_MODIFY: ::uint32_t = 0x0000_0002;
-pub const IN_ATTRIB: ::uint32_t = 0x0000_0004;
-pub const IN_CLOSE_WRITE: ::uint32_t = 0x0000_0008;
-pub const IN_CLOSE_NOWRITE: ::uint32_t = 0x0000_0010;
-pub const IN_CLOSE: ::uint32_t = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
-pub const IN_OPEN: ::uint32_t = 0x0000_0020;
-pub const IN_MOVED_FROM: ::uint32_t = 0x0000_0040;
-pub const IN_MOVED_TO: ::uint32_t = 0x0000_0080;
-pub const IN_MOVE: ::uint32_t = (IN_MOVED_FROM | IN_MOVED_TO);
-pub const IN_CREATE: ::uint32_t = 0x0000_0100;
-pub const IN_DELETE: ::uint32_t = 0x0000_0200;
-pub const IN_DELETE_SELF: ::uint32_t = 0x0000_0400;
-pub const IN_MOVE_SELF: ::uint32_t = 0x0000_0800;
-pub const IN_UNMOUNT: ::uint32_t = 0x0000_2000;
-pub const IN_Q_OVERFLOW: ::uint32_t = 0x0000_4000;
-pub const IN_IGNORED: ::uint32_t = 0x0000_8000;
-pub const IN_ONLYDIR: ::uint32_t = 0x0100_0000;
-pub const IN_DONT_FOLLOW: ::uint32_t = 0x0200_0000;
-// pub const IN_EXCL_UNLINK: ::uint32_t = 0x0400_0000;
-
-// pub const IN_MASK_CREATE: ::uint32_t = 0x1000_0000;
-// pub const IN_MASK_ADD: ::uint32_t = 0x2000_0000;
-pub const IN_ISDIR: ::uint32_t = 0x4000_0000;
-pub const IN_ONESHOT: ::uint32_t = 0x8000_0000;
-
-pub const IN_ALL_EVENTS: ::uint32_t = (
+pub const IN_ACCESS: u32 = 0x0000_0001;
+pub const IN_MODIFY: u32 = 0x0000_0002;
+pub const IN_ATTRIB: u32 = 0x0000_0004;
+pub const IN_CLOSE_WRITE: u32 = 0x0000_0008;
+pub const IN_CLOSE_NOWRITE: u32 = 0x0000_0010;
+pub const IN_CLOSE: u32 = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
+pub const IN_OPEN: u32 = 0x0000_0020;
+pub const IN_MOVED_FROM: u32 = 0x0000_0040;
+pub const IN_MOVED_TO: u32 = 0x0000_0080;
+pub const IN_MOVE: u32 = (IN_MOVED_FROM | IN_MOVED_TO);
+pub const IN_CREATE: u32 = 0x0000_0100;
+pub const IN_DELETE: u32 = 0x0000_0200;
+pub const IN_DELETE_SELF: u32 = 0x0000_0400;
+pub const IN_MOVE_SELF: u32 = 0x0000_0800;
+pub const IN_UNMOUNT: u32 = 0x0000_2000;
+pub const IN_Q_OVERFLOW: u32 = 0x0000_4000;
+pub const IN_IGNORED: u32 = 0x0000_8000;
+pub const IN_ONLYDIR: u32 = 0x0100_0000;
+pub const IN_DONT_FOLLOW: u32 = 0x0200_0000;
+// pub const IN_EXCL_UNLINK: u32 = 0x0400_0000;
+
+// pub const IN_MASK_CREATE: u32 = 0x1000_0000;
+// pub const IN_MASK_ADD: u32 = 0x2000_0000;
+pub const IN_ISDIR: u32 = 0x4000_0000;
+pub const IN_ONESHOT: u32 = 0x8000_0000;
+
+pub const IN_ALL_EVENTS: u32 = (
IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |
IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |
@@ -1967,6 +2155,11 @@ f! {
}
extern {
+ #[cfg_attr(not(target_env = "musl"),
+ link_name = "__xpg_strerror_r")]
+ pub fn strerror_r(errnum: ::c_int, buf: *mut c_char,
+ buflen: ::size_t) -> ::c_int;
+
pub fn abs(i: ::c_int) -> ::c_int;
pub fn atof(s: *const ::c_char) -> ::c_double;
pub fn labs(i: ::c_long) -> ::c_long;
@@ -2134,12 +2327,6 @@ extern {
flags: ::c_int) -> ::c_int;
pub fn pthread_setschedprio(native: ::pthread_t,
priority: ::c_int) -> ::c_int;
- 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;
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
pub fn process_vm_readv(pid: ::pid_t,
local_iov: *const ::iovec,
@@ -2201,10 +2388,6 @@ extern {
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;
- 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;
pub fn sync();
pub fn syscall(num: ::c_long, ...) -> ::c_long;
pub fn sched_getaffinity(pid: ::pid_t,
@@ -2457,7 +2640,7 @@ extern {
pub fn inotify_init1(flags: ::c_int) -> ::c_int;
pub fn inotify_add_watch(fd: ::c_int,
path: *const ::c_char,
- mask: ::uint32_t) -> ::c_int;
+ mask: u32) -> ::c_int;
}
cfg_if! {
diff --git a/libc/src/unix/notbsd/linux/musl/b32/arm.rs b/libc/src/unix/notbsd/linux/musl/b32/arm.rs
index 88d8798..7162fdf 100644
--- a/libc/src/unix/notbsd/linux/musl/b32/arm.rs
+++ b/libc/src/unix/notbsd/linux/musl/b32/arm.rs
@@ -150,17 +150,6 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
-
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 19],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
}
pub const SIGSTKSZ: ::size_t = 8192;
@@ -180,8 +169,9 @@ pub const RLIMIT_NOFILE: ::c_int = 7;
pub const RLIMIT_AS: ::c_int = 9;
pub const RLIMIT_NPROC: ::c_int = 6;
pub const RLIMIT_MEMLOCK: ::c_int = 8;
-pub const RLIMIT_NLIMITS: ::c_int = 16;
+pub const RLIMIT_NLIMITS: ::c_int = 15;
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const CBAUD: ::tcflag_t = 0o0010017;
@@ -838,6 +828,17 @@ pub const SYS_pkey_alloc: ::c_long = 395;
pub const SYS_pkey_free: ::c_long = 396;
#[doc(hidden)]
-pub const AF_MAX: ::c_int = 43;
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+pub const AF_MAX: ::c_int = 45;
#[doc(hidden)]
+#[allow(deprecated)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
pub const PF_MAX: ::c_int = AF_MAX;
diff --git a/libc/src/unix/notbsd/linux/musl/b32/mips.rs b/libc/src/unix/notbsd/linux/musl/b32/mips.rs
index 37430af..fbecb49 100644
--- a/libc/src/unix/notbsd/linux/musl/b32/mips.rs
+++ b/libc/src/unix/notbsd/linux/musl/b32/mips.rs
@@ -161,17 +161,6 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
-
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 23],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
}
pub const SIGSTKSZ: ::size_t = 8192;
@@ -191,7 +180,7 @@ pub const RLIMIT_NOFILE: ::c_int = 5;
pub const RLIMIT_AS: ::c_int = 6;
pub const RLIMIT_NPROC: ::c_int = 8;
pub const RLIMIT_MEMLOCK: ::c_int = 9;
-pub const RLIMIT_NLIMITS: ::c_int = 16;
+pub const RLIMIT_NLIMITS: ::c_int = 15;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
@@ -848,6 +837,17 @@ pub const SYS_preadv2: ::c_long = 4000 + 361;
pub const SYS_pwritev2: ::c_long = 4000 + 362;
#[doc(hidden)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
pub const AF_MAX: ::c_int = 42;
#[doc(hidden)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;
diff --git a/libc/src/unix/notbsd/linux/musl/b32/powerpc.rs b/libc/src/unix/notbsd/linux/musl/b32/powerpc.rs
index d0f2d68..eafd7a6 100644
--- a/libc/src/unix/notbsd/linux/musl/b32/powerpc.rs
+++ b/libc/src/unix/notbsd/linux/musl/b32/powerpc.rs
@@ -153,19 +153,9 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
-
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_cc: [::cc_t; 19],
- pub c_line: ::cc_t,
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
}
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const SIGSTKSZ: ::size_t = 10240;
pub const MINSIGSTKSZ: ::size_t = 4096;
@@ -864,6 +854,17 @@ pub const SYS_pkey_free: ::c_long = 385;
pub const SYS_pkey_mprotect: ::c_long = 386;
#[doc(hidden)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
pub const AF_MAX: ::c_int = 43;
#[doc(hidden)]
+#[allow(deprecated)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
pub const PF_MAX: ::c_int = AF_MAX;
diff --git a/libc/src/unix/notbsd/linux/musl/b32/x86.rs b/libc/src/unix/notbsd/linux/musl/b32/x86.rs
index 8bfb60b..3e8579a 100644
--- a/libc/src/unix/notbsd/linux/musl/b32/x86.rs
+++ b/libc/src/unix/notbsd/linux/musl/b32/x86.rs
@@ -154,17 +154,6 @@ s! {
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
-
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 19],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
}
s_no_extra_traits!{
@@ -240,8 +229,9 @@ pub const RLIMIT_NOFILE: ::c_int = 7;
pub const RLIMIT_AS: ::c_int = 9;
pub const RLIMIT_NPROC: ::c_int = 6;
pub const RLIMIT_MEMLOCK: ::c_int = 8;
-pub const RLIMIT_NLIMITS: ::c_int = 16;
+pub const RLIMIT_NLIMITS: ::c_int = 15;
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const CBAUD: ::tcflag_t = 0o0010017;
@@ -946,6 +936,17 @@ pub const UESP: ::c_int = 15;
pub const SS: ::c_int = 16;
#[doc(hidden)]
-pub const AF_MAX: ::c_int = 42;
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+pub const AF_MAX: ::c_int = 45;
#[doc(hidden)]
+#[allow(deprecated)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
pub const PF_MAX: ::c_int = AF_MAX;
diff --git a/libc/src/unix/notbsd/linux/musl/b64/aarch64.rs b/libc/src/unix/notbsd/linux/musl/b64/aarch64.rs
index f01a5c4..16cb46d 100644
--- a/libc/src/unix/notbsd/linux/musl/b64/aarch64.rs
+++ b/libc/src/unix/notbsd/linux/musl/b64/aarch64.rs
@@ -71,10 +71,22 @@ pub const MINSIGSTKSZ: ::size_t = 6144;
pub const SIGSTKSZ: ::size_t = 12288;
#[doc(hidden)]
-pub const PF_MAX: ::c_int = 43;
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+pub const PF_MAX: ::c_int = 45;
#[doc(hidden)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+#[allow(deprecated)]
pub const AF_MAX: ::c_int = PF_MAX;
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const SYS_io_setup: ::c_long = 0;
pub const SYS_io_destroy: ::c_long = 1;
pub const SYS_io_submit: ::c_long = 2;
@@ -340,7 +352,7 @@ pub const SYS_pkey_mprotect: ::c_long = 288;
pub const SYS_pkey_alloc: ::c_long = 289;
pub const SYS_pkey_free: ::c_long = 290;
-pub const RLIMIT_NLIMITS: ::c_int = 16;
+pub const RLIMIT_NLIMITS: ::c_int = 15;
pub const TIOCINQ: ::c_int = ::FIONREAD;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
diff --git a/libc/src/unix/notbsd/linux/musl/b64/mod.rs b/libc/src/unix/notbsd/linux/musl/b64/mod.rs
index 043ca8d..34b3766 100644
--- a/libc/src/unix/notbsd/linux/musl/b64/mod.rs
+++ b/libc/src/unix/notbsd/linux/musl/b64/mod.rs
@@ -127,17 +127,6 @@ s! {
pub _pad: [::c_int; 29],
_align: [usize; 0],
}
-
- pub struct termios2 {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
- pub c_cflag: ::tcflag_t,
- pub c_lflag: ::tcflag_t,
- pub c_line: ::cc_t,
- pub c_cc: [::cc_t; 19],
- pub c_ispeed: ::speed_t,
- pub c_ospeed: ::speed_t,
- }
}
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
diff --git a/libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs b/libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs
index 04eba48..4a8df27 100644
--- a/libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs
+++ b/libc/src/unix/notbsd/linux/musl/b64/powerpc64.rs
@@ -60,6 +60,7 @@ s! {
}
}
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MAP_32BIT: ::c_int = 0x0040;
pub const O_DIRECT: ::c_int = 0x20000;
pub const O_DIRECTORY: ::c_int = 0x4000;
@@ -70,8 +71,19 @@ pub const SIGSTKSZ: ::size_t = 10240;
pub const MINSIGSTKSZ: ::size_t = 4096;
#[doc(hidden)]
-pub const AF_MAX: ::c_int = 43;
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+pub const AF_MAX: ::c_int = 45;
#[doc(hidden)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;
// Syscall table
diff --git a/libc/src/unix/notbsd/linux/musl/b64/x86_64.rs b/libc/src/unix/notbsd/linux/musl/b64/x86_64.rs
index 94c5d88..df0ce40 100644
--- a/libc/src/unix/notbsd/linux/musl/b64/x86_64.rs
+++ b/libc/src/unix/notbsd/linux/musl/b64/x86_64.rs
@@ -483,21 +483,36 @@ pub const ES: ::c_int = 24;
pub const FS: ::c_int = 25;
pub const GS: ::c_int = 26;
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MAP_32BIT: ::c_int = 0x0040;
pub const O_DIRECT: ::c_int = 0x4000;
pub const O_DIRECTORY: ::c_int = 0x10000;
pub const O_LARGEFILE: ::c_int = 0;
pub const O_NOFOLLOW: ::c_int = 0x20000;
+pub const TIOCGRS485: ::c_int = 0x542E;
+pub const TIOCSRS485: ::c_int = 0x542F;
+
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
#[doc(hidden)]
-pub const AF_MAX: ::c_int = 42;
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+pub const AF_MAX: ::c_int = 45;
#[doc(hidden)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;
-pub const RLIMIT_NLIMITS: ::c_int = 16;
+pub const RLIMIT_NLIMITS: ::c_int = 15;
pub const TIOCINQ: ::c_int = ::FIONREAD;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
diff --git a/libc/src/unix/notbsd/linux/musl/mod.rs b/libc/src/unix/notbsd/linux/musl/mod.rs
index 4f4a3d8..99d3ed8 100644
--- a/libc/src/unix/notbsd/linux/musl/mod.rs
+++ b/libc/src/unix/notbsd/linux/musl/mod.rs
@@ -1,3 +1,4 @@
+pub type pthread_t = *mut ::c_void;
pub type clock_t = c_long;
pub type time_t = c_long;
pub type suseconds_t = c_long;
@@ -168,6 +169,8 @@ cfg_if! {
}
}
+pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
+
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
@@ -239,6 +242,10 @@ pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
pub const TCP_FASTOPEN: ::c_int = 23;
pub const TCP_TIMESTAMP: ::c_int = 24;
+#[deprecated(
+ since = "0.2.55",
+ note = "Use SIGSYS instead"
+)]
pub const SIGUNUSED: ::c_int = ::SIGSYS;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
@@ -279,6 +286,9 @@ pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
pub const EPOLLWAKEUP: ::c_int = 0x20000000;
+pub const SEEK_DATA: ::c_int = 3;
+pub const SEEK_HOLE: ::c_int = 4;
+
pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
@@ -321,7 +331,41 @@ pub const SO_RXQ_OVFL: ::c_int = 40;
pub const SO_PEEK_OFF: ::c_int = 42;
pub const SO_BUSY_POLL: ::c_int = 46;
+pub const RLIMIT_CPU: ::c_int = 0;
+pub const RLIMIT_FSIZE: ::c_int = 1;
+pub const RLIMIT_DATA: ::c_int = 2;
+pub const RLIMIT_STACK: ::c_int = 3;
+pub const RLIMIT_CORE: ::c_int = 4;
+pub const RLIMIT_LOCKS: ::c_int = 10;
+pub const RLIMIT_SIGPENDING: ::c_int = 11;
+pub const RLIMIT_MSGQUEUE: ::c_int = 12;
+pub const RLIMIT_NICE: ::c_int = 13;
+pub const RLIMIT_RTPRIO: ::c_int = 14;
+
extern {
+ pub fn sendmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint,
+ flags: ::c_uint) -> ::c_int;
+ pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint,
+ flags: ::c_uint, timeout: *mut ::timespec) -> ::c_int;
+
+ pub fn getrlimit64(resource: ::c_int,
+ rlim: *mut ::rlimit64) -> ::c_int;
+ pub fn setrlimit64(resource: ::c_int,
+ rlim: *const ::rlimit64) -> ::c_int;
+ pub fn getrlimit(resource: ::c_int,
+ rlim: *mut ::rlimit) -> ::c_int;
+ pub fn setrlimit(resource: ::c_int,
+ rlim: *const ::rlimit) -> ::c_int;
+ 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;
+
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::c_void) -> ::c_int;
pub fn ptrace(request: ::c_int, ...) -> ::c_long;
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
diff --git a/libc/src/unix/notbsd/linux/other/b32/arm.rs b/libc/src/unix/notbsd/linux/other/b32/arm.rs
index 7f00d9a..a2d190d 100644
--- a/libc/src/unix/notbsd/linux/other/b32/arm.rs
+++ b/libc/src/unix/notbsd/linux/other/b32/arm.rs
@@ -142,15 +142,15 @@ pub const MCL_FUTURE: ::c_int = 0x0002;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const CBAUD: ::tcflag_t = 0o0010017;
-pub const TAB1: ::c_int = 0x00000800;
-pub const TAB2: ::c_int = 0x00001000;
-pub const TAB3: ::c_int = 0x00001800;
-pub const CR1: ::c_int = 0x00000200;
-pub const CR2: ::c_int = 0x00000400;
-pub const CR3: ::c_int = 0x00000600;
-pub const FF1: ::c_int = 0x00008000;
-pub const BS1: ::c_int = 0x00002000;
-pub const VT1: ::c_int = 0x00004000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
pub const VWERASE: usize = 14;
pub const VREPRINT: usize = 12;
pub const VSUSP: usize = 10;
@@ -252,6 +252,8 @@ pub const TIOCSPGRP: ::c_ulong = 0x5410;
pub const TIOCOUTQ: ::c_ulong = 0x5411;
pub const TIOCGWINSZ: ::c_ulong = 0x5413;
pub const TIOCSWINSZ: ::c_ulong = 0x5414;
+pub const TIOCGRS485: ::c_int = 0x542E;
+pub const TIOCSRS485: ::c_int = 0x542F;
pub const FIONREAD: ::c_ulong = 0x541B;
// Syscall table
@@ -607,3 +609,4 @@ pub const SYS_pwritev2: ::c_long = 393;
pub const SYS_pkey_mprotect: ::c_long = 394;
pub const SYS_pkey_alloc: ::c_long = 395;
pub const SYS_pkey_free: ::c_long = 396;
+pub const SYS_statx: ::c_long = 397;
diff --git a/libc/src/unix/notbsd/linux/other/b32/mod.rs b/libc/src/unix/notbsd/linux/other/b32/mod.rs
index d078f75..32e510e 100644
--- a/libc/src/unix/notbsd/linux/other/b32/mod.rs
+++ b/libc/src/unix/notbsd/linux/other/b32/mod.rs
@@ -228,6 +228,10 @@ pub const SIGURG: ::c_int = 23;
pub const SIGIO: ::c_int = 29;
pub const SIGSYS: ::c_int = 31;
pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(
+ since = "0.2.55",
+ note = "Use SIGSYS instead"
+)]
pub const SIGUNUSED: ::c_int = 31;
pub const SIGPOLL: ::c_int = 29;
pub const SIGPWR: ::c_int = 30;
diff --git a/libc/src/unix/notbsd/linux/other/b32/powerpc.rs b/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
index 0ea9034..a64f075 100644
--- a/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
+++ b/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
@@ -9,10 +9,10 @@ s! {
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::mode_t,
- __seq: ::uint32_t,
- __pad1: ::uint32_t,
- __glibc_reserved1: ::uint64_t,
- __glibc_reserved2: ::uint64_t,
+ __seq: u32,
+ __pad1: u32,
+ __glibc_reserved1: u64,
+ __glibc_reserved2: u64,
}
pub struct stat64 {
@@ -132,15 +132,15 @@ pub const MCL_FUTURE: ::c_int = 0x4000;
pub const SIGSTKSZ: ::size_t = 0x4000;
pub const MINSIGSTKSZ: ::size_t = 4096;
pub const CBAUD: ::tcflag_t = 0xff;
-pub const TAB1: ::c_int = 0x400;
-pub const TAB2: ::c_int = 0x800;
-pub const TAB3: ::c_int = 0xc00;
-pub const CR1: ::c_int = 0x1000;
-pub const CR2: ::c_int = 0x2000;
-pub const CR3: ::c_int = 0x3000;
-pub const FF1: ::c_int = 0x4000;
-pub const BS1: ::c_int = 0x8000;
-pub const VT1: ::c_int = 0x10000;
+pub const TAB1: ::tcflag_t = 0x400;
+pub const TAB2: ::tcflag_t = 0x800;
+pub const TAB3: ::tcflag_t = 0xc00;
+pub const CR1: ::tcflag_t = 0x1000;
+pub const CR2: ::tcflag_t = 0x2000;
+pub const CR3: ::tcflag_t = 0x3000;
+pub const FF1: ::tcflag_t = 0x4000;
+pub const BS1: ::tcflag_t = 0x8000;
+pub const VT1: ::tcflag_t = 0x10000;
pub const VWERASE: usize = 0xa;
pub const VREPRINT: usize = 0xb;
pub const VSUSP: usize = 0xc;
@@ -241,6 +241,8 @@ pub const TIOCSPGRP: ::c_ulong = 0x80047476;
pub const TIOCOUTQ: ::c_ulong = 0x40047473;
pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
+pub const TIOCGRS485: ::c_int = 0x542e;
+pub const TIOCSRS485: ::c_int = 0x542f;
pub const FIONREAD: ::c_ulong = 0x4004667f;
pub const SYS_restart_syscall: ::c_long = 0;
@@ -612,3 +614,4 @@ pub const SYS_copy_file_range: ::c_long = 379;
pub const SYS_preadv2: ::c_long = 380;
pub const SYS_pwritev2: ::c_long = 381;
pub const SYS_kexec_file_load: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
diff --git a/libc/src/unix/notbsd/linux/other/b32/x86.rs b/libc/src/unix/notbsd/linux/other/b32/x86.rs
index e7c3b9a..00f1f1a 100644
--- a/libc/src/unix/notbsd/linux/other/b32/x86.rs
+++ b/libc/src/unix/notbsd/linux/other/b32/x86.rs
@@ -348,15 +348,15 @@ pub const MCL_FUTURE: ::c_int = 0x0002;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const CBAUD: ::tcflag_t = 0o0010017;
-pub const TAB1: ::c_int = 0x00000800;
-pub const TAB2: ::c_int = 0x00001000;
-pub const TAB3: ::c_int = 0x00001800;
-pub const CR1: ::c_int = 0x00000200;
-pub const CR2: ::c_int = 0x00000400;
-pub const CR3: ::c_int = 0x00000600;
-pub const FF1: ::c_int = 0x00008000;
-pub const BS1: ::c_int = 0x00002000;
-pub const VT1: ::c_int = 0x00004000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
pub const VWERASE: usize = 14;
pub const VREPRINT: usize = 12;
pub const VSUSP: usize = 10;
@@ -458,6 +458,8 @@ pub const TIOCSPGRP: ::c_ulong = 0x5410;
pub const TIOCOUTQ: ::c_ulong = 0x5411;
pub const TIOCGWINSZ: ::c_ulong = 0x5413;
pub const TIOCSWINSZ: ::c_ulong = 0x5414;
+pub const TIOCGRS485: ::c_int = 0x542E;
+pub const TIOCSRS485: ::c_int = 0x542F;
pub const FIONREAD: ::c_ulong = 0x541B;
// Syscall table
@@ -840,6 +842,7 @@ pub const SYS_pwritev2: ::c_long = 379;
pub const SYS_pkey_mprotect: ::c_long = 380;
pub const SYS_pkey_alloc: ::c_long = 381;
pub const SYS_pkey_free: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
// offsets in user_regs_structs, from sys/reg.h
pub const EBX: ::c_int = 0;
diff --git a/libc/src/unix/notbsd/linux/other/b64/aarch64.rs b/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
index 3bd2e02..090f893 100644
--- a/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
@@ -147,6 +147,8 @@ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
+pub const TIOCGRS485: ::c_int = 0x542E;
+pub const TIOCSRS485: ::c_int = 0x542F;
pub const RLIMIT_NOFILE: ::c_int = 7;
pub const RLIMIT_NPROC: ::c_int = 6;
@@ -315,6 +317,10 @@ pub const SIGURG: ::c_int = 23;
pub const SIGIO: ::c_int = 29;
pub const SIGSYS: ::c_int = 31;
pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(
+ since = "0.2.55",
+ note = "Use SIGSYS instead"
+)]
pub const SIGUNUSED: ::c_int = 31;
pub const SIGPOLL: ::c_int = 29;
pub const SIGPWR: ::c_int = 30;
@@ -435,15 +441,15 @@ pub const MCL_FUTURE: ::c_int = 0x0002;
pub const SIGSTKSZ: ::size_t = 16384;
pub const MINSIGSTKSZ: ::size_t = 5120;
pub const CBAUD: ::tcflag_t = 0o0010017;
-pub const TAB1: ::c_int = 0x00000800;
-pub const TAB2: ::c_int = 0x00001000;
-pub const TAB3: ::c_int = 0x00001800;
-pub const CR1: ::c_int = 0x00000200;
-pub const CR2: ::c_int = 0x00000400;
-pub const CR3: ::c_int = 0x00000600;
-pub const FF1: ::c_int = 0x00008000;
-pub const BS1: ::c_int = 0x00002000;
-pub const VT1: ::c_int = 0x00004000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
pub const VWERASE: usize = 14;
pub const VREPRINT: usize = 12;
pub const VSUSP: usize = 10;
diff --git a/libc/src/unix/notbsd/linux/other/b64/not_x32.rs b/libc/src/unix/notbsd/linux/other/b64/not_x32.rs
index e3e4498..97e21f2 100644
--- a/libc/src/unix/notbsd/linux/other/b64/not_x32.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/not_x32.rs
@@ -408,6 +408,7 @@ pub const SYS_pwritev2: ::c_long = 328;
pub const SYS_pkey_mprotect: ::c_long = 329;
pub const SYS_pkey_alloc: ::c_long = 330;
pub const SYS_pkey_free: ::c_long = 331;
+pub const SYS_statx: ::c_long = 332;
#[link(name = "util")]
extern {
diff --git a/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs b/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs
index bc5b01c..b31248b 100644
--- a/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs
@@ -110,9 +110,9 @@ s! {
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::mode_t,
- pub __seq: ::uint32_t,
- __pad1: ::uint32_t,
- __unused1: ::uint64_t,
+ pub __seq: u32,
+ __pad1: u32,
+ __unused1: u64,
__unused2: ::c_ulong,
}
@@ -302,6 +302,10 @@ pub const SIGURG: ::c_int = 23;
pub const SIGIO: ::c_int = 29;
pub const SIGSYS: ::c_int = 31;
pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(
+ since = "0.2.55",
+ note = "Use SIGSYS instead"
+)]
pub const SIGUNUSED: ::c_int = 31;
pub const SIGPOLL: ::c_int = 29;
pub const SIGPWR: ::c_int = 30;
@@ -340,6 +344,8 @@ pub const TIOCMBIS: ::c_ulong = 0x5416;
pub const TIOCMBIC: ::c_ulong = 0x5417;
pub const TIOCMSET: ::c_ulong = 0x5418;
pub const TIOCCONS: ::c_ulong = 0x541D;
+pub const TIOCGRS485: ::c_int = 0x542E;
+pub const TIOCSRS485: ::c_int = 0x542F;
pub const SFD_CLOEXEC: ::c_int = 0x080000;
@@ -446,15 +452,15 @@ pub const MCL_FUTURE: ::c_int = 0x4000;
pub const SIGSTKSZ: ::size_t = 0x4000;
pub const MINSIGSTKSZ: ::size_t = 4096;
pub const CBAUD: ::tcflag_t = 0xff;
-pub const TAB1: ::c_int = 0x400;
-pub const TAB2: ::c_int = 0x800;
-pub const TAB3: ::c_int = 0xc00;
-pub const CR1: ::c_int = 0x1000;
-pub const CR2: ::c_int = 0x2000;
-pub const CR3: ::c_int = 0x3000;
-pub const FF1: ::c_int = 0x4000;
-pub const BS1: ::c_int = 0x8000;
-pub const VT1: ::c_int = 0x10000;
+pub const TAB1: ::tcflag_t = 0x400;
+pub const TAB2: ::tcflag_t = 0x800;
+pub const TAB3: ::tcflag_t = 0xc00;
+pub const CR1: ::tcflag_t = 0x1000;
+pub const CR2: ::tcflag_t = 0x2000;
+pub const CR3: ::tcflag_t = 0x3000;
+pub const FF1: ::tcflag_t = 0x4000;
+pub const BS1: ::tcflag_t = 0x8000;
+pub const VT1: ::tcflag_t = 0x10000;
pub const VWERASE: usize = 0xa;
pub const VREPRINT: usize = 0xb;
pub const VSUSP: usize = 0xc;
@@ -917,6 +923,7 @@ pub const SYS_copy_file_range: ::c_long = 379;
pub const SYS_preadv2: ::c_long = 380;
pub const SYS_pwritev2: ::c_long = 381;
pub const SYS_kexec_file_load: ::c_long = 382;
+pub const SYS_statx: ::c_long = 383;
#[link(name = "util")]
extern {
diff --git a/libc/src/unix/notbsd/linux/other/b64/sparc64.rs b/libc/src/unix/notbsd/linux/other/b64/sparc64.rs
index 5d26865..f54504a 100644
--- a/libc/src/unix/notbsd/linux/other/b64/sparc64.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/sparc64.rs
@@ -404,15 +404,15 @@ pub const MCL_FUTURE: ::c_int = 0x4000;
pub const SIGSTKSZ: ::size_t = 16384;
pub const MINSIGSTKSZ: ::size_t = 4096;
pub const CBAUD: ::tcflag_t = 0x0000100f;
-pub const TAB1: ::c_int = 0x800;
-pub const TAB2: ::c_int = 0x1000;
-pub const TAB3: ::c_int = 0x1800;
-pub const CR1: ::c_int = 0x200;
-pub const CR2: ::c_int = 0x400;
-pub const CR3: ::c_int = 0x600;
-pub const FF1: ::c_int = 0x8000;
-pub const BS1: ::c_int = 0x2000;
-pub const VT1: ::c_int = 0x4000;
+pub const TAB1: ::tcflag_t = 0x800;
+pub const TAB2: ::tcflag_t = 0x1000;
+pub const TAB3: ::tcflag_t = 0x1800;
+pub const CR1: ::tcflag_t = 0x200;
+pub const CR2: ::tcflag_t = 0x400;
+pub const CR3: ::tcflag_t = 0x600;
+pub const FF1: ::tcflag_t = 0x8000;
+pub const BS1: ::tcflag_t = 0x2000;
+pub const VT1: ::tcflag_t = 0x4000;
pub const VWERASE: usize = 0xe;
pub const VREPRINT: usize = 0xc;
pub const VSUSP: usize = 0xa;
@@ -855,6 +855,7 @@ pub const SYS_mlock2: ::c_long = 356;
pub const SYS_copy_file_range: ::c_long = 357;
pub const SYS_preadv2: ::c_long = 358;
pub const SYS_pwritev2: ::c_long = 359;
+pub const SYS_statx: ::c_long = 360;
#[link(name = "util")]
extern {
diff --git a/libc/src/unix/notbsd/linux/other/b64/x32.rs b/libc/src/unix/notbsd/linux/other/b64/x32.rs
index d88dbaf..3746881 100644
--- a/libc/src/unix/notbsd/linux/other/b64/x32.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/x32.rs
@@ -336,6 +336,7 @@ pub const SYS_copy_file_range: ::c_long = __X32_SYSCALL_BIT + 326;
pub const SYS_pkey_mprotect: ::c_long = __X32_SYSCALL_BIT + 329;
pub const SYS_pkey_alloc: ::c_long = __X32_SYSCALL_BIT + 330;
pub const SYS_pkey_free: ::c_long = __X32_SYSCALL_BIT + 331;
+pub const SYS_statx: ::c_long = __X32_SYSCALL_BIT + 332;
pub const SYS_rt_sigaction: ::c_long = __X32_SYSCALL_BIT + 512;
pub const SYS_rt_sigreturn: ::c_long = __X32_SYSCALL_BIT + 513;
pub const SYS_ioctl: ::c_long = __X32_SYSCALL_BIT + 514;
diff --git a/libc/src/unix/notbsd/linux/other/b64/x86_64.rs b/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
index 79f27e0..fb39bf3 100644
--- a/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
@@ -332,6 +332,8 @@ cfg_if! {
pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;
+pub const TIOCGRS485: ::c_int = 0x542E;
+pub const TIOCSRS485: ::c_int = 0x542F;
pub const RLIMIT_NOFILE: ::c_int = 7;
pub const RLIMIT_NPROC: ::c_int = 6;
@@ -500,6 +502,10 @@ pub const SIGURG: ::c_int = 23;
pub const SIGIO: ::c_int = 29;
pub const SIGSYS: ::c_int = 31;
pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(
+ since = "0.2.55",
+ note = "Use SIGSYS instead"
+)]
pub const SIGUNUSED: ::c_int = 31;
pub const SIGPOLL: ::c_int = 29;
pub const SIGPWR: ::c_int = 30;
@@ -601,15 +607,15 @@ pub const MCL_FUTURE: ::c_int = 0x0002;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
pub const CBAUD: ::tcflag_t = 0o0010017;
-pub const TAB1: ::c_int = 0x00000800;
-pub const TAB2: ::c_int = 0x00001000;
-pub const TAB3: ::c_int = 0x00001800;
-pub const CR1: ::c_int = 0x00000200;
-pub const CR2: ::c_int = 0x00000400;
-pub const CR3: ::c_int = 0x00000600;
-pub const FF1: ::c_int = 0x00008000;
-pub const BS1: ::c_int = 0x00002000;
-pub const VT1: ::c_int = 0x00004000;
+pub const TAB1: ::tcflag_t = 0x00000800;
+pub const TAB2: ::tcflag_t = 0x00001000;
+pub const TAB3: ::tcflag_t = 0x00001800;
+pub const CR1: ::tcflag_t = 0x00000200;
+pub const CR2: ::tcflag_t = 0x00000400;
+pub const CR3: ::tcflag_t = 0x00000600;
+pub const FF1: ::tcflag_t = 0x00008000;
+pub const BS1: ::tcflag_t = 0x00002000;
+pub const VT1: ::tcflag_t = 0x00004000;
pub const VWERASE: usize = 14;
pub const VREPRINT: usize = 12;
pub const VSUSP: usize = 10;
diff --git a/libc/src/unix/notbsd/linux/other/mod.rs b/libc/src/unix/notbsd/linux/other/mod.rs
index 1a97d1c..7ce58ad 100644
--- a/libc/src/unix/notbsd/linux/other/mod.rs
+++ b/libc/src/unix/notbsd/linux/other/mod.rs
@@ -1,6 +1,38 @@
+pub type pthread_t = c_ulong;
pub type __priority_which_t = ::c_uint;
+pub type __rlimit_resource_t = ::c_uint;
s! {
+ pub struct statx {
+ pub stx_mask: u32,
+ pub stx_blksize: u32,
+ pub stx_attributes: u64,
+ pub stx_nlink: u32,
+ pub stx_uid: u32,
+ pub stx_gid: u32,
+ pub stx_mode: u16,
+ pub __statx_pad1: [u16; 1],
+ pub stx_ino: u64,
+ pub stx_size: u64,
+ pub stx_blocks: u64,
+ pub stx_attributes_mask: u64,
+ pub stx_atime: ::statx_timestamp,
+ pub stx_btime: ::statx_timestamp,
+ pub stx_ctime: ::statx_timestamp,
+ pub stx_mtime: ::statx_timestamp,
+ pub stx_rdev_major: u32,
+ pub stx_rdev_minor: u32,
+ pub stx_dev_major: u32,
+ pub stx_dev_minor: u32,
+ pub __statx_pad2: [u64; 14],
+ }
+
+ pub struct statx_timestamp {
+ pub tv_sec: i64,
+ pub tv_nsec: u32,
+ pub __statx_timestamp_pad1: [i32; 1],
+ }
+
pub struct aiocb {
pub aio_fildes: ::c_int,
pub aio_lio_opcode: ::c_int,
@@ -25,8 +57,8 @@ s! {
}
pub struct __timeval {
- pub tv_sec: ::int32_t,
- pub tv_usec: ::int32_t,
+ pub tv_sec: i32,
+ pub tv_usec: i32,
}
pub struct sigaction {
@@ -48,6 +80,7 @@ s! {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
pub si_code: ::c_int,
+ #[doc(hidden)]
#[deprecated(
since="0.2.54",
note="Please leave a comment on \
@@ -236,13 +269,13 @@ s_no_extra_traits! {
#[cfg(not(any(target_arch = "aarch64",
all(target_pointer_width = "32",
not(target_arch = "x86_64")))))]
- pub ut_session: ::int32_t,
+ pub ut_session: i32,
#[cfg(not(any(target_arch = "aarch64",
all(target_pointer_width = "32",
not(target_arch = "x86_64")))))]
pub ut_tv: __timeval,
- pub ut_addr_v6: [::int32_t; 4],
+ pub ut_addr_v6: [i32; 4],
__glibc_reserved: [::c_char; 20],
}
}
@@ -307,6 +340,20 @@ cfg_if! {
}
}
+pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
+
pub const __UT_LINESIZE: usize = 32;
pub const __UT_NAMESIZE: usize = 32;
pub const __UT_HOSTSIZE: usize = 256;
@@ -373,6 +420,8 @@ pub const MAP_EXECUTABLE: ::c_int = 0x01000;
pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_SHARED_VALIDATE: ::c_int = 0x3;
+pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000;
pub const ENOTSUP: ::c_int = EOPNOTSUPP;
pub const EUCLEAN: ::c_int = 117;
@@ -601,6 +650,41 @@ pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
+// linux/rtnetlink.h
+pub const TCA_PAD: ::c_ushort = 9;
+pub const TCA_DUMP_INVISIBLE: ::c_ushort = 10;
+pub const TCA_CHAIN: ::c_ushort = 11;
+pub const TCA_HW_OFFLOAD: ::c_ushort = 12;
+
+pub const RTM_F_LOOKUP_TABLE: ::c_uint = 0x1000;
+pub const RTM_F_FIB_MATCH: ::c_uint = 0x2000;
+
+pub const RTA_VIA: ::c_ushort = 18;
+pub const RTA_NEWDST: ::c_ushort = 19;
+pub const RTA_PREF: ::c_ushort = 20;
+pub const RTA_ENCAP_TYPE: ::c_ushort = 21;
+pub const RTA_ENCAP: ::c_ushort = 22;
+pub const RTA_EXPIRES: ::c_ushort = 23;
+pub const RTA_PAD: ::c_ushort = 24;
+pub const RTA_UID: ::c_ushort = 25;
+pub const RTA_TTL_PROPAGATE: ::c_ushort = 26;
+
+// linux/neighbor.h
+pub const NTF_EXT_LEARNED: u8 = 0x10;
+pub const NTF_OFFLOADED: u8 = 0x20;
+
+pub const NDA_MASTER: ::c_ushort = 9;
+pub const NDA_LINK_NETNSID: ::c_ushort = 10;
+pub const NDA_SRC_VNI: ::c_ushort = 11;
+
+// linux/if_addr.h
+pub const IFA_FLAGS: ::c_ushort = 8;
+
+pub const IFA_F_MANAGETEMPADDR: u32 = 0x100;
+pub const IFA_F_NOPREFIXROUTE: u32 = 0x200;
+pub const IFA_F_MCAUTOJOIN: u32 = 0x400;
+pub const IFA_F_STABLE_PRIVACY: u32 = 0x800;
+
pub const NETLINK_ROUTE: ::c_int = 0;
pub const NETLINK_UNUSED: ::c_int = 1;
pub const NETLINK_USERSOCK: ::c_int = 2;
@@ -884,10 +968,47 @@ pub const M_ARENA_TEST: ::c_int = -7;
pub const M_ARENA_MAX: ::c_int = -8;
#[doc(hidden)]
-pub const AF_MAX: ::c_int = 42;
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+pub const AF_MAX: ::c_int = 45;
#[doc(hidden)]
+#[deprecated(
+ since = "0.2.55",
+ note = "If you are using this report to: \
+ https://github.com/rust-lang/libc/issues/665"
+)]
+#[allow(deprecated)]
pub const PF_MAX: ::c_int = AF_MAX;
+pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000;
+pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000;
+pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000;
+pub const AT_STATX_DONT_SYNC: ::c_int = 0x4000;
+pub const STATX_TYPE: ::c_uint = 0x0001;
+pub const STATX_MODE: ::c_uint = 0x0002;
+pub const STATX_NLINK: ::c_uint = 0x0004;
+pub const STATX_UID: ::c_uint = 0x0008;
+pub const STATX_GID: ::c_uint = 0x0010;
+pub const STATX_ATIME: ::c_uint = 0x0020;
+pub const STATX_MTIME: ::c_uint = 0x0040;
+pub const STATX_CTIME: ::c_uint = 0x0080;
+pub const STATX_INO: ::c_uint = 0x0100;
+pub const STATX_SIZE: ::c_uint = 0x0200;
+pub const STATX_BLOCKS: ::c_uint = 0x0400;
+pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
+pub const STATX_BTIME: ::c_uint = 0x0800;
+pub const STATX_ALL: ::c_uint = 0x0fff;
+pub const STATX__RESERVED: ::c_int = 0x80000000;
+pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;
+pub const STATX_ATTR_IMMUTABLE: ::c_int = 0x0010;
+pub const STATX_ATTR_APPEND: ::c_int = 0x0020;
+pub const STATX_ATTR_NODUMP: ::c_int = 0x0040;
+pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800;
+pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000;
+
cfg_if! {
if #[cfg(any(target_arch = "arm", target_arch = "x86",
target_arch = "x86_64"))] {
@@ -907,6 +1028,26 @@ f! {
}
extern {
+ 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;
+
+ pub fn getrlimit64(resource: ::__rlimit_resource_t,
+ rlim: *mut ::rlimit64) -> ::c_int;
+ pub fn setrlimit64(resource: ::__rlimit_resource_t,
+ rlim: *const ::rlimit64) -> ::c_int;
+ pub fn getrlimit(resource: ::__rlimit_resource_t,
+ rlim: *mut ::rlimit) -> ::c_int;
+ pub fn setrlimit(resource: ::__rlimit_resource_t,
+ rlim: *const ::rlimit) -> ::c_int;
+ pub fn prlimit(pid: ::pid_t,
+ resource: ::__rlimit_resource_t, new_limit: *const ::rlimit,
+ old_limit: *mut ::rlimit) -> ::c_int;
+ pub fn prlimit64(pid: ::pid_t,
+ resource: ::__rlimit_resource_t,
+ new_limit: *const ::rlimit64,
+ old_limit: *mut ::rlimit64) -> ::c_int;
pub fn utmpxname(file: *const ::c_char) -> ::c_int;
pub fn getutxent() -> *mut utmpx;
pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
@@ -916,6 +1057,10 @@ extern {
pub fn endutxent();
pub fn getpt() -> ::c_int;
pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
+ pub fn gettimeofday(tp: *mut ::timeval,
+ tz: *mut ::timezone) -> ::c_int;
+ pub fn statx(dirfd: ::c_int, pathname: *const c_char, flags: ::c_int,
+ mask: ::c_uint, statxbuf: *mut statx) -> ::c_int;
}
#[link(name = "util")]
diff --git a/libc/src/unix/notbsd/linux/s390x/mod.rs b/libc/src/unix/notbsd/linux/s390x/mod.rs
index d4cf956..5572094 100644
--- a/libc/src/unix/notbsd/linux/s390x/mod.rs
+++ b/libc/src/unix/notbsd/linux/s390x/mod.rs
@@ -1,5 +1,7 @@
use ::pthread_mutex_t;
+pub type __rlimit_resource_t = ::c_uint;
+pub type pthread_t = c_ulong;
pub type blkcnt_t = i64;
pub type blksize_t = i64;
pub type c_char = u8;
@@ -352,6 +354,9 @@ cfg_if! {
}
}
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
+pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
+
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
@@ -517,6 +522,8 @@ pub const MAP_NORESERVE: ::c_int = 0x04000;
pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
+pub const MAP_SHARED_VALIDATE: ::c_int = 0x3;
+pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000;
pub const EDEADLOCK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
@@ -636,6 +643,10 @@ pub const SIGURG: ::c_int = 23;
pub const SIGIO: ::c_int = 29;
pub const SIGSYS: ::c_int = 31;
pub const SIGSTKFLT: ::c_int = 16;
+#[deprecated(
+ since = "0.2.55",
+ note = "Use SIGSYS instead"
+)]
pub const SIGUNUSED: ::c_int = 31;
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;
@@ -981,6 +992,17 @@ pub const POLLWRBAND: ::c_short = 0x200;
pub const IXON: ::tcflag_t = 0o002000;
pub const IXOFF: ::tcflag_t = 0o010000;
+pub const RLIMIT_CPU: ::__rlimit_resource_t = 0;
+pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1;
+pub const RLIMIT_DATA: ::__rlimit_resource_t = 2;
+pub const RLIMIT_STACK: ::__rlimit_resource_t = 3;
+pub const RLIMIT_CORE: ::__rlimit_resource_t = 4;
+pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10;
+pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11;
+pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
+pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
+pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
+
pub const SYS_exit: ::c_long = 1;
pub const SYS_fork: ::c_long = 2;
pub const SYS_read: ::c_long = 3;
@@ -1306,6 +1328,27 @@ pub const SYS_newfstatat: ::c_long = 293;
#[link(name = "util")]
extern {
+ 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;
+
+ pub fn getrlimit64(resource: ::__rlimit_resource_t,
+ rlim: *mut ::rlimit64) -> ::c_int;
+ pub fn setrlimit64(resource: ::__rlimit_resource_t,
+ rlim: *const ::rlimit64) -> ::c_int;
+ pub fn getrlimit(resource: ::__rlimit_resource_t,
+ rlim: *mut ::rlimit) -> ::c_int;
+ pub fn setrlimit(resource: ::__rlimit_resource_t,
+ rlim: *const ::rlimit) -> ::c_int;
+ pub fn prlimit(pid: ::pid_t,
+ resource: ::__rlimit_resource_t, new_limit: *const ::rlimit,
+ old_limit: *mut ::rlimit) -> ::c_int;
+ pub fn prlimit64(pid: ::pid_t,
+ resource: ::__rlimit_resource_t,
+ new_limit: *const ::rlimit64,
+ old_limit: *mut ::rlimit64) -> ::c_int;
+
pub fn sysctl(name: *mut ::c_int,
namelen: ::c_int,
oldp: *mut ::c_void,
diff --git a/libc/src/unix/notbsd/mod.rs b/libc/src/unix/notbsd/mod.rs
index d0905e1..2706466 100644
--- a/libc/src/unix/notbsd/mod.rs
+++ b/libc/src/unix/notbsd/mod.rs
@@ -1,5 +1,4 @@
pub type sa_family_t = u16;
-pub type pthread_key_t = ::c_uint;
pub type speed_t = ::c_uint;
pub type tcflag_t = ::c_uint;
pub type clockid_t = ::c_int;
@@ -62,13 +61,6 @@ s! {
pub ai_next: *mut addrinfo,
}
- pub struct sockaddr_nl {
- pub nl_family: ::sa_family_t,
- nl_pad: ::c_ushort,
- pub nl_pid: u32,
- pub nl_groups: u32
- }
-
pub struct sockaddr_ll {
pub sll_family: ::c_ushort,
pub sll_protocol: ::c_ushort,
@@ -224,8 +216,8 @@ s_no_extra_traits!{
target_arch = "x86_64"),
repr(packed))]
pub struct epoll_event {
- pub events: ::uint32_t,
- pub u64: ::uint64_t,
+ pub events: u32,
+ pub u64: u64,
}
pub struct sockaddr_un {
@@ -465,17 +457,6 @@ pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9;
// pub const CLOCK_TAI: ::clockid_t = 11;
pub const TIMER_ABSTIME: ::c_int = 1;
-pub const RLIMIT_CPU: ::c_int = 0;
-pub const RLIMIT_FSIZE: ::c_int = 1;
-pub const RLIMIT_DATA: ::c_int = 2;
-pub const RLIMIT_STACK: ::c_int = 3;
-pub const RLIMIT_CORE: ::c_int = 4;
-pub const RLIMIT_LOCKS: ::c_int = 10;
-pub const RLIMIT_SIGPENDING: ::c_int = 11;
-pub const RLIMIT_MSGQUEUE: ::c_int = 12;
-pub const RLIMIT_NICE: ::c_int = 13;
-pub const RLIMIT_RTPRIO: ::c_int = 14;
-
pub const RUSAGE_SELF: ::c_int = 0;
pub const O_RDONLY: ::c_int = 0;
@@ -580,10 +561,8 @@ pub const MS_KERNMOUNT: ::c_ulong = 0x400000;
pub const MS_I_VERSION: ::c_ulong = 0x800000;
pub const MS_STRICTATIME: ::c_ulong = 0x1000000;
pub const MS_ACTIVE: ::c_ulong = 0x40000000;
-pub const MS_NOUSER: ::c_ulong = 0x80000000;
pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;
pub const MS_MGC_MSK: ::c_ulong = 0xffff0000;
-pub const MS_RMT_MASK: ::c_ulong = 0x800051;
pub const EPERM: ::c_int = 1;
pub const ENOENT: ::c_int = 2;
@@ -645,7 +624,6 @@ pub const MADV_NOHUGEPAGE: ::c_int = 15;
pub const MADV_DONTDUMP: ::c_int = 16;
pub const MADV_DODUMP: ::c_int = 17;
pub const MADV_HWPOISON: ::c_int = 100;
-pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const IFF_UP: ::c_int = 0x1;
pub const IFF_BROADCAST: ::c_int = 0x2;
@@ -866,16 +844,16 @@ pub const MNT_EXPIRE: ::c_int = 0x4;
pub const Q_GETFMT: ::c_int = 0x800004;
pub const Q_GETINFO: ::c_int = 0x800005;
pub const Q_SETINFO: ::c_int = 0x800006;
-pub const QIF_BLIMITS: ::uint32_t = 1;
-pub const QIF_SPACE: ::uint32_t = 2;
-pub const QIF_ILIMITS: ::uint32_t = 4;
-pub const QIF_INODES: ::uint32_t = 8;
-pub const QIF_BTIME: ::uint32_t = 16;
-pub const QIF_ITIME: ::uint32_t = 32;
-pub const QIF_LIMITS: ::uint32_t = 5;
-pub const QIF_USAGE: ::uint32_t = 10;
-pub const QIF_TIMES: ::uint32_t = 48;
-pub const QIF_ALL: ::uint32_t = 63;
+pub const QIF_BLIMITS: u32 = 1;
+pub const QIF_SPACE: u32 = 2;
+pub const QIF_ILIMITS: u32 = 4;
+pub const QIF_INODES: u32 = 8;
+pub const QIF_BTIME: u32 = 16;
+pub const QIF_ITIME: u32 = 32;
+pub const QIF_LIMITS: u32 = 5;
+pub const QIF_USAGE: u32 = 10;
+pub const QIF_TIMES: u32 = 48;
+pub const QIF_ALL: u32 = 63;
pub const MNT_FORCE: ::c_int = 0x1;
@@ -892,13 +870,13 @@ pub const TCOON: ::c_int = 1;
pub const TCIFLUSH: ::c_int = 0;
pub const TCOFLUSH: ::c_int = 1;
pub const TCIOFLUSH: ::c_int = 2;
-pub const NL0: ::c_int = 0x00000000;
-pub const NL1: ::c_int = 0x00000100;
-pub const TAB0: ::c_int = 0x00000000;
-pub const CR0: ::c_int = 0x00000000;
-pub const FF0: ::c_int = 0x00000000;
-pub const BS0: ::c_int = 0x00000000;
-pub const VT0: ::c_int = 0x00000000;
+pub const NL0: ::tcflag_t = 0x00000000;
+pub const NL1: ::tcflag_t = 0x00000100;
+pub const TAB0: ::tcflag_t = 0x00000000;
+pub const CR0: ::tcflag_t = 0x00000000;
+pub const FF0: ::tcflag_t = 0x00000000;
+pub const BS0: ::tcflag_t = 0x00000000;
+pub const VT0: ::tcflag_t = 0x00000000;
pub const VERASE: usize = 2;
pub const VKILL: usize = 3;
pub const VINTR: usize = 0;
@@ -1265,7 +1243,6 @@ extern {
pshared: ::c_int,
value: ::c_uint)
-> ::c_int;
-
pub fn fdatasync(fd: ::c_int) -> ::c_int;
pub fn mincore(addr: *mut ::c_void, len: ::size_t,
vec: *mut ::c_uchar) -> ::c_int;
@@ -1309,7 +1286,6 @@ extern {
pub fn fstatat64(dirfd: ::c_int, pathname: *const c_char,
buf: *mut stat64, flags: ::c_int) -> ::c_int;
pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
- pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
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 mmap64(addr: *mut ::c_void,
@@ -1338,7 +1314,6 @@ extern {
pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64;
pub fn readdir64_r(dirp: *mut ::DIR, entry: *mut ::dirent64,
result: *mut *mut ::dirent64) -> ::c_int;
- pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int;