From 4fcdf2022df38b37365ee5d948005ac08a1f1a83 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Tue, 22 Jan 2019 20:16:05 -0800 Subject: Update libc crate to 0.2.47 This change updates the libc crate to version 0.2.47. Import subrepo libc/:libc at ce1dfcbf81bd74662b5cd02a9214818a0bfbbffa --- libc/Cargo.lock | 47 +++++++---- libc/Cargo.toml | 2 +- libc/libc-test/build.rs | 5 +- libc/src/redox/mod.rs | 110 +++++++++++++++++++++++-- libc/src/unix/bsd/apple/mod.rs | 1 + libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs | 1 + libc/src/unix/bsd/freebsdlike/freebsd/mod.rs | 20 +++++ libc/src/unix/bsd/netbsdlike/mod.rs | 1 + libc/src/unix/bsd/netbsdlike/netbsd/mod.rs | 14 ++++ libc/src/unix/haiku/mod.rs | 1 + libc/src/unix/hermit/mod.rs | 1 + libc/src/unix/mod.rs | 1 - libc/src/unix/newlib/mod.rs | 1 + libc/src/unix/notbsd/linux/other/b32/x86.rs | 21 +++++ libc/src/unix/notbsd/linux/other/b64/x86_64.rs | 25 ++++++ libc/src/unix/notbsd/mod.rs | 1 + libc/src/unix/solaris/mod.rs | 1 + libc/src/unix/uclibc/mod.rs | 1 + 18 files changed, 228 insertions(+), 26 deletions(-) (limited to 'libc') diff --git a/libc/Cargo.lock b/libc/Cargo.lock index c15eee4..fb3c107 100644 --- a/libc/Cargo.lock +++ b/libc/Cargo.lock @@ -33,7 +33,7 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", @@ -69,12 +69,12 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.45" +version = "0.2.46" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.46" +version = "0.2.47" dependencies = [ "rustc-std-workspace-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -84,7 +84,7 @@ name = "libc-test" version = "0.1.0" dependencies = [ "ctest 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.46", + "libc 0.2.47", ] [[package]] @@ -126,14 +126,29 @@ dependencies = [ [[package]] name = "rand" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand_core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rustc-std-workspace-core" version = "1.0.0" @@ -180,12 +195,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -195,7 +210,7 @@ dependencies = [ [[package]] name = "syn" -version = "0.15.23" +version = "0.15.24" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", @@ -208,7 +223,7 @@ name = "syntex_errors" version = "0.59.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_pos 0.59.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -235,7 +250,7 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_errors 0.59.1 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_pos 0.59.1 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -295,13 +310,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum libc 0.2.45 (registry+https://github.com/rust-lang/crates.io-index)" = "2d2857ec59fadc0773853c664d2d18e7198e83883e7060b63c924cb077bd5c74" +"checksum libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)" = "023a4cd09b2ff695f9734c1934145a315594b7986398496841c7031a5a1bbdbd" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" "checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" "checksum proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "77619697826f31a02ae974457af0b29b723e5619e113e9397b8b82c6bd253f09" "checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c" -"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd" +"checksum rand 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dee497e66d8d76bf08ce20c8d36e16f93749ab0bf89975b4f8ae5cee660c2da2" +"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum rustc-std-workspace-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1956f5517128a2b6f23ab2dadf1a976f4f5b27962e7724c2bf3d45e539ec098c" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7" @@ -309,8 +326,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)" = "0e732ed5a5592c17d961555e3b552985baf98d50ce418b7b655f31f6ba7eb1b7" "checksum serde_derive 1.0.84 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d6115a3ca25c224e409185325afc16a0d5aaaabc15c42b09587d6f1ba39a5b" -"checksum serde_json 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)" = "bdf540260cfee6da923831f4776ddc495ada940c30117977c70f1313a6130545" -"checksum syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)" = "9545a6a093a3f0bd59adb472700acc08cad3776f860f16a897dfce8c88721cbc" +"checksum serde_json 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)" = "dfb1277d4d0563e4593e0b8b5d23d744d277b55d2bc0bf1c38d0d8a6589d38aa" +"checksum syn 0.15.24 (registry+https://github.com/rust-lang/crates.io-index)" = "734ecc29cd36e8123850d9bf21dfd62ef8300aaa8f879aabaa899721808be37c" "checksum syntex_errors 0.59.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3133289179676c9f5c5b2845bf5a2e127769f4889fcbada43035ef6bd662605e" "checksum syntex_pos 0.59.1 (registry+https://github.com/rust-lang/crates.io-index)" = "30ab669fa003d208c681f874bbc76d91cc3d32550d16b5d9d2087cf477316470" "checksum syntex_syntax 0.59.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03815b9f04d95828770d9c974aa39c6e1f6ef3114eb77a3ce09008a0d15dd142" diff --git a/libc/Cargo.toml b/libc/Cargo.toml index f7bf9f5..1d61dad 100644 --- a/libc/Cargo.toml +++ b/libc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libc" -version = "0.2.46" +version = "0.2.47" authors = ["The Rust Project Developers"] license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/libc/libc-test/build.rs b/libc/libc-test/build.rs index ffab452..7606800 100644 --- a/libc/libc-test/build.rs +++ b/libc/libc-test/build.rs @@ -341,7 +341,6 @@ fn main() { cfg.header("mqueue.h"); cfg.header("ufs/ufs/quota.h"); cfg.header("pthread_np.h"); - cfg.header("sys/ioctl_compat.h"); cfg.header("sys/rtprio.h"); } @@ -858,6 +857,10 @@ fn main() { // to be removed now "system" | "ptrace" if ios => true, + // Removed in OpenBSD 6.5 + // https://marc.info/?l=openbsd-cvs&m=154723400730318 + "mincore" if openbsd => true, + _ => false, } }); diff --git a/libc/src/redox/mod.rs b/libc/src/redox/mod.rs index 9f68632..8dabd90 100644 --- a/libc/src/redox/mod.rs +++ b/libc/src/redox/mod.rs @@ -1,4 +1,3 @@ - pub type int8_t = i8; pub type int16_t = i16; pub type int32_t = i32; @@ -31,18 +30,66 @@ pub type c_char = i8; pub type c_long = i64; pub type c_ulong = u64; -pub type wchar_t = i16; +pub type wchar_t = i32; +pub type wint_t = u32; +pub type wctype_t = i64; +pub type regoff_t = size_t; pub type off_t = c_long; -pub type mode_t = u16; -pub type time_t = i64; -pub type pid_t = usize; -pub type gid_t = usize; -pub type uid_t = usize; +pub type mode_t = c_int; +pub type time_t = c_long; +pub type pid_t = c_int; +pub type id_t = c_uint; +pub type gid_t = c_int; +pub type uid_t = c_int; +pub type dev_t = c_long; +pub type ino_t = c_ulong; +pub type nlink_t = c_ulong; +pub type blksize_t = c_long; +pub type blkcnt_t = c_ulong; + +pub type fsblkcnt_t = c_ulong; +pub type fsfilcnt_t = c_ulong; + +pub type useconds_t = c_uint; +pub type suseconds_t = c_int; -pub type suseconds_t = i64; +pub type clock_t = c_long; +pub type clockid_t = c_int; +pub type timer_t = *mut c_void; + +pub type nfds_t = c_ulong; s! { + pub struct fd_set { + fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE], + } + + pub struct pollfd { + pub fd: ::c_int, + pub events: ::c_short, + pub revents: ::c_short, + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + + pub st_atime: ::timespec, + pub st_mtime: ::timespec, + pub st_ctime: ::timespec, + + _pad: [c_char; 24], + } + pub struct timeval { pub tv_sec: time_t, pub tv_usec: suseconds_t, @@ -64,6 +111,27 @@ pub const STDERR_FILENO: ::c_int = 2; pub const EXIT_FAILURE: ::c_int = 1; pub const EXIT_SUCCESS: ::c_int = 0; +pub const FD_SETSIZE: usize = 1024; + +pub const MAP_SHARED: ::c_int = 1; +pub const MAP_PRIVATE: ::c_int = 2; +pub const MAP_ANONYMOUS: ::c_int = 4; +pub const MAP_ANON: ::c_int = MAP_ANONYMOUS; + +pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; + +pub const POLLIN: ::c_short = 0x001; +pub const POLLPRI: ::c_short = 0x002; +pub const POLLOUT: ::c_short = 0x004; +pub const POLLERR: ::c_short = 0x008; +pub const POLLHUP: ::c_short = 0x010; +pub const POLLNVAL: ::c_short = 0x020; + +pub const PROT_NONE: ::c_int = 0; +pub const PROT_EXEC: ::c_int = 1; +pub const PROT_WRITE: ::c_int = 2; +pub const PROT_READ: ::c_int = 4; + pub const S_ISUID: ::c_int = 0x800; pub const S_ISGID: ::c_int = 0x400; pub const S_ISVTX: ::c_int = 0x200; @@ -98,6 +166,8 @@ pub const F_SETFD: ::c_int = 2; pub const F_GETFL: ::c_int = 3; pub const F_SETFL: ::c_int = 4; +pub const FD_CLOEXEC: ::c_int = 0x0100_0000; + pub const O_RDONLY: ::c_int = 0x0001_0000; pub const O_WRONLY: ::c_int = 0x0002_0000; pub const O_RDWR: ::c_int = 0x0003_0000; @@ -152,6 +222,17 @@ pub const SIGSYS: ::c_int = 31; pub enum FILE {} pub enum fpos_t {} // TODO: fill this out with a struct +// intentionally not public, only used for fd_set +cfg_if! { + if #[cfg(target_pointer_width = "32")] { + const ULONG_SIZE: usize = 32; + } else if #[cfg(target_pointer_width = "64")] { + const ULONG_SIZE: usize = 64; + } else { + // Unknown target_pointer_width + } +} + extern { pub fn isalnum(c: c_int) -> c_int; pub fn isalpha(c: c_int) -> c_int; @@ -262,9 +343,22 @@ extern { pub fn close(fd: ::c_int) -> ::c_int; pub fn fchown(fd: ::c_int, uid: ::uid_t, gid: ::gid_t) -> ::c_int; pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int; + pub fn fstat(fd: ::c_int, buf: *mut stat) -> ::c_int; + pub fn fsync(fd: ::c_int) -> ::c_int; pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int; pub fn getpid() -> pid_t; pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; + pub fn mmap(addr: *mut ::c_void, + len: ::size_t, + prot: ::c_int, + flags: ::c_int, + fd: ::c_int, + offset: off_t) + -> *mut ::c_void; + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) + -> ::c_int; + pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int; + pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int; pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t; pub fn setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) -> ::c_int; diff --git a/libc/src/unix/bsd/apple/mod.rs b/libc/src/unix/bsd/apple/mod.rs index 3d9dd94..13da82c 100644 --- a/libc/src/unix/bsd/apple/mod.rs +++ b/libc/src/unix/bsd/apple/mod.rs @@ -2659,6 +2659,7 @@ extern { fd: ::c_int, newfd: ::c_int, ) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; } cfg_if! { diff --git a/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 0414380..41b6956 100644 --- a/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -801,4 +801,5 @@ extern { pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; } diff --git a/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs b/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs index 03b19eb..878deea 100644 --- a/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -447,6 +447,19 @@ pub const TIOCSIG: ::c_uint = 0x2004745f; pub const TIOCM_DCD: ::c_int = 0x40; pub const H4DISC: ::c_int = 0x7; +pub const FIONCLEX: ::c_ulong = 0x20006602; +pub const FIONREAD: ::c_ulong = 0x4004667f; +pub const FIOASYNC: ::c_ulong = 0x8004667d; +pub const FIOSETOWN: ::c_ulong = 0x8004667c; +pub const FIOGETOWN: ::c_ulong = 0x4004667b; +pub const FIODTYPE: ::c_ulong = 0x4004667a; +pub const FIOGETLBA: ::c_ulong = 0x40046679; +pub const FIODGNAME: ::c_ulong = 0x80106678; +pub const FIONWRITE: ::c_ulong = 0x40046677; +pub const FIONSPACE: ::c_ulong = 0x40046676; +pub const FIOSEEKDATA: ::c_ulong = 0xc0086661; +pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662; + pub const JAIL_API_VERSION: u32 = 2; pub const JAIL_CREATE: ::c_int = 0x01; pub const JAIL_UPDATE: ::c_int = 0x02; @@ -949,6 +962,12 @@ pub const UF_READONLY: ::c_ulong = 0x00001000; pub const UF_HIDDEN: ::c_ulong = 0x00008000; pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; +f! { + pub fn uname(buf: *mut ::utsname) -> ::c_int { + __xuname(256, buf as *mut ::c_void) + } +} + extern { pub fn __error() -> *mut ::c_int; @@ -1135,6 +1154,7 @@ extern { pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int; + pub fn __xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int; } #[link(name = "util")] diff --git a/libc/src/unix/bsd/netbsdlike/mod.rs b/libc/src/unix/bsd/netbsdlike/mod.rs index abd014c..15f84d9 100644 --- a/libc/src/unix/bsd/netbsdlike/mod.rs +++ b/libc/src/unix/bsd/netbsdlike/mod.rs @@ -676,6 +676,7 @@ extern { -> ::c_int; 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 uname(buf: *mut ::utsname) -> ::c_int; } cfg_if! { diff --git a/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs b/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs index 9c8173f..760582c 100644 --- a/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -987,6 +987,20 @@ pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS | ::CDTRCTS; pub const SOCK_CLOEXEC: ::c_int = 0x10000000; pub const SOCK_NONBLOCK: ::c_int = 0x20000000; +pub const FIONCLEX: ::c_ulong = 0x20006602; +// Uncomment on next NetBSD release +// pub const FIOSEEKDATA: ::c_ulong = 0xc0086661; +// pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662; +pub const FIONREAD: ::c_ulong = 0x4004667f; +pub const FIOASYNC: ::c_ulong = 0x8004667d; +pub const FIOSETOWN: ::c_ulong = 0x8004667c; +pub const FIOGETOWN: ::c_ulong = 0x4004667b; +pub const OFIOGETBMAP: ::c_ulong = 0xc004667a; +pub const FIOGETBMAP: ::c_ulong = 0xc008667a; +pub const FIONWRITE: ::c_ulong = 0x40046679; +pub const FIONSPACE: ::c_ulong = 0x40046678; +pub const FIBMAP: ::c_ulong = 0xc008667a; + pub const SIGSTKSZ : ::size_t = 40960; pub const PT_DUMPCORE: ::c_int = 12; diff --git a/libc/src/unix/haiku/mod.rs b/libc/src/unix/haiku/mod.rs index e65bca7..2aa5d13 100644 --- a/libc/src/unix/haiku/mod.rs +++ b/libc/src/unix/haiku/mod.rs @@ -1242,6 +1242,7 @@ extern { termp: *mut termios, winp: *mut ::winsize) -> ::pid_t; pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; } cfg_if! { diff --git a/libc/src/unix/hermit/mod.rs b/libc/src/unix/hermit/mod.rs index aadfa1c..ba7a90f 100644 --- a/libc/src/unix/hermit/mod.rs +++ b/libc/src/unix/hermit/mod.rs @@ -727,6 +727,7 @@ extern { -> ::c_int; pub fn setgroups(ngroups: ::c_int, grouplist: *const ::gid_t) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; } cfg_if! { diff --git a/libc/src/unix/mod.rs b/libc/src/unix/mod.rs index 370d7f4..88e13c5 100644 --- a/libc/src/unix/mod.rs +++ b/libc/src/unix/mod.rs @@ -972,7 +972,6 @@ extern { #[cfg_attr(target_os = "freebsd", link_name = "mknod@FBSD_1.0")] pub fn mknod(pathname: *const ::c_char, mode: ::mode_t, dev: ::dev_t) -> ::c_int; - pub fn uname(buf: *mut ::utsname) -> ::c_int; pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int; pub fn getservbyname(name: *const ::c_char, proto: *const ::c_char) -> *mut servent; diff --git a/libc/src/unix/newlib/mod.rs b/libc/src/unix/newlib/mod.rs index 77a4eb9..0cc411d 100644 --- a/libc/src/unix/newlib/mod.rs +++ b/libc/src/unix/newlib/mod.rs @@ -728,6 +728,7 @@ extern { link_name = "popen$UNIX2003")] pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn uname(buf: *mut ::utsname) -> ::c_int; } cfg_if! { diff --git a/libc/src/unix/notbsd/linux/other/b32/x86.rs b/libc/src/unix/notbsd/linux/other/b32/x86.rs index 1506aca..6c41718 100644 --- a/libc/src/unix/notbsd/linux/other/b32/x86.rs +++ b/libc/src/unix/notbsd/linux/other/b32/x86.rs @@ -758,6 +758,27 @@ pub const EFL: ::c_int = 14; pub const UESP: ::c_int = 15; pub const SS: ::c_int = 16; +// offsets in mcontext_t.gregs from sys/ucontext.h +pub const REG_GS: ::c_int = 0; +pub const REG_FS: ::c_int = 1; +pub const REG_ES: ::c_int = 2; +pub const REG_DS: ::c_int = 3; +pub const REG_EDI: ::c_int = 4; +pub const REG_ESI: ::c_int = 5; +pub const REG_EBP: ::c_int = 6; +pub const REG_ESP: ::c_int = 7; +pub const REG_EBX: ::c_int = 8; +pub const REG_EDX: ::c_int = 9; +pub const REG_ECX: ::c_int = 10; +pub const REG_EAX: ::c_int = 11; +pub const REG_TRAPNO: ::c_int = 12; +pub const REG_ERR: ::c_int = 13; +pub const REG_EIP: ::c_int = 14; +pub const REG_CS: ::c_int = 15; +pub const REG_EFL: ::c_int = 16; +pub const REG_UESP: ::c_int = 17; +pub const REG_SS: ::c_int = 18; + extern { pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; 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 43b8b9f..0d7137e 100644 --- a/libc/src/unix/notbsd/linux/other/b64/x86_64.rs +++ b/libc/src/unix/notbsd/linux/other/b64/x86_64.rs @@ -644,6 +644,31 @@ pub const ES: ::c_int = 24; pub const FS: ::c_int = 25; pub const GS: ::c_int = 26; +// offsets in mcontext_t.gregs from sys/ucontext.h +pub const REG_R8: ::c_int = 0; +pub const REG_R9: ::c_int = 1; +pub const REG_R10: ::c_int = 2; +pub const REG_R11: ::c_int = 3; +pub const REG_R12: ::c_int = 4; +pub const REG_R13: ::c_int = 5; +pub const REG_R14: ::c_int = 6; +pub const REG_R15: ::c_int = 7; +pub const REG_RDI: ::c_int = 8; +pub const REG_RSI: ::c_int = 9; +pub const REG_RBP: ::c_int = 10; +pub const REG_RBX: ::c_int = 11; +pub const REG_RDX: ::c_int = 12; +pub const REG_RAX: ::c_int = 13; +pub const REG_RCX: ::c_int = 14; +pub const REG_RSP: ::c_int = 15; +pub const REG_RIP: ::c_int = 16; +pub const REG_EFL: ::c_int = 17; +pub const REG_CSGSFS: ::c_int = 18; +pub const REG_ERR: ::c_int = 19; +pub const REG_TRAPNO: ::c_int = 20; +pub const REG_OLDMASK: ::c_int = 21; +pub const REG_CR2: ::c_int = 22; + extern { pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; diff --git a/libc/src/unix/notbsd/mod.rs b/libc/src/unix/notbsd/mod.rs index 6ff0807..668c25f 100644 --- a/libc/src/unix/notbsd/mod.rs +++ b/libc/src/unix/notbsd/mod.rs @@ -1242,6 +1242,7 @@ extern { flags: ::c_int) -> ::ssize_t; pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; + pub fn uname(buf: *mut ::utsname) -> ::c_int; } cfg_if! { diff --git a/libc/src/unix/solaris/mod.rs b/libc/src/unix/solaris/mod.rs index c4ec111..c991e62 100644 --- a/libc/src/unix/solaris/mod.rs +++ b/libc/src/unix/solaris/mod.rs @@ -1466,4 +1466,5 @@ extern { mode: *const c_char) -> *mut ::FILE; pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; } diff --git a/libc/src/unix/uclibc/mod.rs b/libc/src/unix/uclibc/mod.rs index 9d8e97e..c04c22a 100644 --- a/libc/src/unix/uclibc/mod.rs +++ b/libc/src/unix/uclibc/mod.rs @@ -1953,6 +1953,7 @@ extern { link_name = "popen$UNIX2003")] pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn uname(buf: *mut ::utsname) -> ::c_int; } cfg_if! { -- cgit v1.2.3