aboutsummaryrefslogtreecommitdiff
path: root/libc/src/unix/notbsd/linux
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2017-05-29 14:07:12 -0700
committerDaniel Mueller <deso@posteo.net>2017-05-29 14:07:12 -0700
commit684c4574c09a6f2cc5a208e4505e9306602b4abc (patch)
treedaaac715140748c82f801f2e4047c57780689bc0 /libc/src/unix/notbsd/linux
parent436915453f7474117234aa0cedab6f97b3b3575f (diff)
downloadnitrocli-684c4574c09a6f2cc5a208e4505e9306602b4abc.tar.gz
nitrocli-684c4574c09a6f2cc5a208e4505e9306602b4abc.tar.bz2
Update libc crate to 0.2.23
The 'libc' create got a couple of updates. This change imports the new code and bumps the version to use. Import subrepo libc/:libc at 7db3fd570dfb41a38fb17116e93679307178103a
Diffstat (limited to 'libc/src/unix/notbsd/linux')
-rw-r--r--libc/src/unix/notbsd/linux/mips/mips32.rs2
-rw-r--r--libc/src/unix/notbsd/linux/mips/mips64.rs2
-rw-r--r--libc/src/unix/notbsd/linux/mips/mod.rs3
-rw-r--r--libc/src/unix/notbsd/linux/mod.rs45
-rw-r--r--libc/src/unix/notbsd/linux/musl/mod.rs6
-rw-r--r--libc/src/unix/notbsd/linux/other/b32/arm.rs1
-rw-r--r--libc/src/unix/notbsd/linux/other/b32/powerpc.rs1
-rw-r--r--libc/src/unix/notbsd/linux/other/b32/x86.rs1
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/aarch64.rs1
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/powerpc64.rs1
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/sparc64.rs1
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/x86_64.rs1
-rw-r--r--libc/src/unix/notbsd/linux/other/mod.rs3
-rw-r--r--libc/src/unix/notbsd/linux/s390x.rs4
14 files changed, 64 insertions, 8 deletions
diff --git a/libc/src/unix/notbsd/linux/mips/mips32.rs b/libc/src/unix/notbsd/linux/mips/mips32.rs
index 22bb33b..042495e 100644
--- a/libc/src/unix/notbsd/linux/mips/mips32.rs
+++ b/libc/src/unix/notbsd/linux/mips/mips32.rs
@@ -86,7 +86,7 @@ s! {
pub sa_flags: ::c_int,
pub sa_sigaction: ::sighandler_t,
pub sa_mask: sigset_t,
- _restorer: *mut ::c_void,
+ pub sa_restorer: ::dox::Option<extern fn()>,
_resv: [::c_int; 1],
}
diff --git a/libc/src/unix/notbsd/linux/mips/mips64.rs b/libc/src/unix/notbsd/linux/mips/mips64.rs
index 9478599..5b0484a 100644
--- a/libc/src/unix/notbsd/linux/mips/mips64.rs
+++ b/libc/src/unix/notbsd/linux/mips/mips64.rs
@@ -85,7 +85,7 @@ s! {
pub sa_flags: ::c_int,
pub sa_sigaction: ::sighandler_t,
pub sa_mask: sigset_t,
- _restorer: *mut ::c_void,
+ pub sa_restorer: ::dox::Option<extern fn()>,
}
pub struct stack_t {
diff --git a/libc/src/unix/notbsd/linux/mips/mod.rs b/libc/src/unix/notbsd/linux/mips/mod.rs
index db580c9..7b1c15e 100644
--- a/libc/src/unix/notbsd/linux/mips/mod.rs
+++ b/libc/src/unix/notbsd/linux/mips/mod.rs
@@ -322,7 +322,7 @@ pub const VMIN: usize = 4;
pub const IEXTEN: ::tcflag_t = 0x00000100;
pub const TOSTOP: ::tcflag_t = 0x00008000;
pub const FLUSHO: ::tcflag_t = 0x00002000;
-pub const IUTF8: ::tcflag_t = 0x00004000;
+pub const EXTPROC: ::tcflag_t = 0o200000;
pub const TCSANOW: ::c_int = 0x540e;
pub const TCSADRAIN: ::c_int = 0x540f;
pub const TCSAFLUSH: ::c_int = 0x5410;
@@ -420,6 +420,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
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;
diff --git a/libc/src/unix/notbsd/linux/mod.rs b/libc/src/unix/notbsd/linux/mod.rs
index 9774f93..b9375a3 100644
--- a/libc/src/unix/notbsd/linux/mod.rs
+++ b/libc/src/unix/notbsd/linux/mod.rs
@@ -220,6 +220,11 @@ s! {
pub msgtql: ::c_int,
pub msgseg: ::c_ushort,
}
+
+ pub struct mmsghdr {
+ pub msg_hdr: ::msghdr,
+ pub msg_len: ::c_uint,
+ }
}
pub const ABDAY_1: ::nl_item = 0x20000;
@@ -692,6 +697,14 @@ pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2;
pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3;
pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
+pub const XATTR_CREATE: ::c_int = 0x1;
+pub const XATTR_REPLACE: ::c_int = 0x2;
+
+// On Linux, libc doesn't define this constant, libattr does instead.
+// We still define it for Linux as it's defined by libc on other platforms,
+// and it's mentioned in the man pages for getxattr and setxattr.
+pub const ENOATTR: ::c_int = ::ENODATA;
+
f! {
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
for slot in cpuset.bits.iter_mut() {
@@ -722,6 +735,31 @@ f! {
pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
set1.bits == set2.bits
}
+
+ pub fn major(dev: ::dev_t) -> ::c_uint {
+ let mut major = 0;
+ major |= (dev & 0x00000000000fff00) >> 8;
+ major |= (dev & 0xfffff00000000000) >> 32;
+ major as ::c_uint
+ }
+
+ pub fn minor(dev: ::dev_t) -> ::c_uint {
+ let mut minor = 0;
+ minor |= (dev & 0xfffff00000000000) >> 0;
+ minor |= (dev & 0x00000ffffff00000) >> 12;
+ minor as ::c_uint
+ }
+
+ pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
+ let major = major as ::dev_t;
+ let minor = minor as ::dev_t;
+ let mut dev = 0;
+ dev |= (major & 0x00000fff) << 8;
+ dev |= (major & 0xfffff000) << 32;
+ dev |= (minor & 0x000000ff) << 0;
+ dev |= (minor & 0xffffff00) << 12;
+ dev
+ }
}
extern {
@@ -958,6 +996,13 @@ extern {
-> ::ssize_t;
}
+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;
+}
+
cfg_if! {
if #[cfg(any(target_env = "musl",
target_os = "fuchsia",
diff --git a/libc/src/unix/notbsd/linux/musl/mod.rs b/libc/src/unix/notbsd/linux/musl/mod.rs
index 2bf13f9..b365028 100644
--- a/libc/src/unix/notbsd/linux/musl/mod.rs
+++ b/libc/src/unix/notbsd/linux/musl/mod.rs
@@ -35,7 +35,7 @@ s! {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
- _restorer: *mut ::c_void,
+ pub sa_restorer: ::dox::Option<extern fn()>,
}
pub struct ipc_perm {
@@ -124,6 +124,9 @@ pub const EFD_CLOEXEC: ::c_int = 0x80000;
pub const BUFSIZ: ::c_uint = 1024;
pub const TMP_MAX: ::c_uint = 10000;
pub const FOPEN_MAX: ::c_uint = 1000;
+pub const O_PATH: ::c_int = 0o10000000;
+pub const O_EXEC: ::c_int = 0o10000000;
+pub const O_SEARCH: ::c_int = 0o10000000;
pub const O_ACCMODE: ::c_int = 0o10000003;
pub const O_NDELAY: ::c_int = O_NONBLOCK;
pub const NI_MAXHOST: ::socklen_t = 255;
@@ -236,6 +239,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
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;
diff --git a/libc/src/unix/notbsd/linux/other/b32/arm.rs b/libc/src/unix/notbsd/linux/other/b32/arm.rs
index cbd9e40..ee6d674 100644
--- a/libc/src/unix/notbsd/linux/other/b32/arm.rs
+++ b/libc/src/unix/notbsd/linux/other/b32/arm.rs
@@ -100,6 +100,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
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;
diff --git a/libc/src/unix/notbsd/linux/other/b32/powerpc.rs b/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
index 13e9d36..035bfe1 100644
--- a/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
+++ b/libc/src/unix/notbsd/linux/other/b32/powerpc.rs
@@ -103,6 +103,7 @@ pub const MCL_CURRENT: ::c_int = 0x2000;
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;
diff --git a/libc/src/unix/notbsd/linux/other/b32/x86.rs b/libc/src/unix/notbsd/linux/other/b32/x86.rs
index 68218ff..263e140 100644
--- a/libc/src/unix/notbsd/linux/other/b32/x86.rs
+++ b/libc/src/unix/notbsd/linux/other/b32/x86.rs
@@ -141,6 +141,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
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;
diff --git a/libc/src/unix/notbsd/linux/other/b64/aarch64.rs b/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
index 26898c5..77cee3d 100644
--- a/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/aarch64.rs
@@ -344,6 +344,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
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;
diff --git a/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs b/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs
index 1257023..8c19b07 100644
--- a/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/powerpc64.rs
@@ -342,6 +342,7 @@ pub const MCL_CURRENT: ::c_int = 0x2000;
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;
diff --git a/libc/src/unix/notbsd/linux/other/b64/sparc64.rs b/libc/src/unix/notbsd/linux/other/b64/sparc64.rs
index a1ac4f5..12598e0 100644
--- a/libc/src/unix/notbsd/linux/other/b64/sparc64.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/sparc64.rs
@@ -301,6 +301,7 @@ pub const MCL_CURRENT: ::c_int = 0x2000;
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;
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 b5f2a82..b39ccb3 100644
--- a/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
@@ -402,6 +402,7 @@ pub const MCL_CURRENT: ::c_int = 0x0001;
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;
diff --git a/libc/src/unix/notbsd/linux/other/mod.rs b/libc/src/unix/notbsd/linux/other/mod.rs
index ad5cc69..b7a11a8 100644
--- a/libc/src/unix/notbsd/linux/other/mod.rs
+++ b/libc/src/unix/notbsd/linux/other/mod.rs
@@ -70,7 +70,7 @@ s! {
#[cfg(target_arch = "sparc64")]
__reserved0: ::c_int,
pub sa_flags: ::c_int,
- _restorer: *mut ::c_void,
+ pub sa_restorer: ::dox::Option<extern fn()>,
}
pub struct stack_t {
@@ -314,7 +314,6 @@ pub const TMPFS_MAGIC: ::c_long = 0x01021994;
pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2;
pub const VEOF: usize = 4;
-pub const IUTF8: ::tcflag_t = 0x00004000;
pub const CPU_SETSIZE: ::c_int = 0x400;
diff --git a/libc/src/unix/notbsd/linux/s390x.rs b/libc/src/unix/notbsd/linux/s390x.rs
index b646647..1c0cd56 100644
--- a/libc/src/unix/notbsd/linux/s390x.rs
+++ b/libc/src/unix/notbsd/linux/s390x.rs
@@ -86,7 +86,7 @@ s! {
pub sa_sigaction: ::sighandler_t,
__glibc_reserved0: ::c_int,
pub sa_flags: ::c_int,
- _restorer: *mut ::c_void,
+ pub sa_restorer: ::dox::Option<extern fn()>,
pub sa_mask: sigset_t,
}
@@ -339,6 +339,7 @@ pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_SIGINFO: ::c_int = 4;
pub const SIGBUS: ::c_int = 7;
pub const SIGSTKSZ: ::size_t = 0x2000;
+pub const MINSIGSTKSZ: ::size_t = 2048;
pub const SIG_SETMASK: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_STREAM: ::c_int = 1;
@@ -576,7 +577,6 @@ pub const VMIN: usize = 6;
pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
-pub const IUTF8: ::tcflag_t = 0x00004000;
pub const CPU_SETSIZE: ::c_int = 0x400;