summaryrefslogtreecommitdiffstats
path: root/vendor/libc/src/unix/redox/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/libc/src/unix/redox/mod.rs')
-rw-r--r--vendor/libc/src/unix/redox/mod.rs30
1 files changed, 26 insertions, 4 deletions
diff --git a/vendor/libc/src/unix/redox/mod.rs b/vendor/libc/src/unix/redox/mod.rs
index bc46d4942..afba67727 100644
--- a/vendor/libc/src/unix/redox/mod.rs
+++ b/vendor/libc/src/unix/redox/mod.rs
@@ -1,8 +1,20 @@
pub type c_char = i8;
-pub type c_long = i64;
-pub type c_ulong = u64;
pub type wchar_t = i32;
+cfg_if! {
+ if #[cfg(target_pointer_width = "32")] {
+ pub type c_long = i32;
+ pub type c_ulong = u32;
+ }
+}
+
+cfg_if! {
+ if #[cfg(target_pointer_width = "64")] {
+ pub type c_long = i64;
+ pub type c_ulong = u64;
+ }
+}
+
pub type blkcnt_t = ::c_ulong;
pub type blksize_t = ::c_long;
pub type clock_t = ::c_long;
@@ -14,7 +26,7 @@ pub type ino_t = ::c_ulong;
pub type mode_t = ::c_int;
pub type nfds_t = ::c_ulong;
pub type nlink_t = ::c_ulong;
-pub type off_t = ::c_long;
+pub type off_t = ::c_longlong;
pub type pthread_t = *mut ::c_void;
pub type pthread_attr_t = *mut ::c_void;
pub type pthread_cond_t = *mut ::c_void;
@@ -34,7 +46,7 @@ pub type socklen_t = u32;
pub type speed_t = u32;
pub type suseconds_t = ::c_int;
pub type tcflag_t = u32;
-pub type time_t = ::c_long;
+pub type time_t = ::c_longlong;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
@@ -375,6 +387,7 @@ pub const EPROTONOSUPPORT: ::c_int = 93; /* Protocol not supported */
pub const ESOCKTNOSUPPORT: ::c_int = 94; /* Socket type not supported */
/* Operation not supported on transport endpoint */
pub const EOPNOTSUPP: ::c_int = 95;
+pub const ENOTSUP: ::c_int = EOPNOTSUPP;
pub const EPFNOSUPPORT: ::c_int = 96; /* Protocol family not supported */
/* Address family not supported by protocol */
pub const EAFNOSUPPORT: ::c_int = 97;
@@ -615,6 +628,7 @@ pub const EXIT_FAILURE: ::c_int = 1;
// sys/ioctl.h
// FIXME: relibc {
+pub const FIONREAD: ::c_ulong = 0x541B;
pub const FIONBIO: ::c_ulong = 0x5421;
pub const FIOCLEX: ::c_ulong = 0x5451;
// }
@@ -632,6 +646,12 @@ pub const PROT_READ: ::c_int = 0x0004;
pub const PROT_WRITE: ::c_int = 0x0002;
pub const PROT_EXEC: ::c_int = 0x0001;
+pub const MADV_NORMAL: ::c_int = 0;
+pub const MADV_RANDOM: ::c_int = 1;
+pub const MADV_SEQUENTIAL: ::c_int = 2;
+pub const MADV_WILLNEED: ::c_int = 3;
+pub const MADV_DONTNEED: ::c_int = 4;
+
pub const MAP_SHARED: ::c_int = 0x0001;
pub const MAP_PRIVATE: ::c_int = 0x0002;
pub const MAP_ANON: ::c_int = 0x0020;
@@ -661,6 +681,7 @@ pub const MSG_EOR: ::c_int = 128;
pub const MSG_OOB: ::c_int = 1;
pub const MSG_PEEK: ::c_int = 2;
pub const MSG_TRUNC: ::c_int = 32;
+pub const MSG_DONTWAIT: ::c_int = 64;
pub const MSG_WAITALL: ::c_int = 256;
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
@@ -1028,6 +1049,7 @@ extern "C" {
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
// sys/mman.h
+ pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;