summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-25 14:28:06 +0000
committerbors <bors@rust-lang.org>2022-10-25 14:28:06 +0000
commit7e8f84c2bbf41d3ac0785e7aa52f1369c4a5e24c (patch)
tree51f111c48a7b98f0a4b677e8f2472190cbdf2a15
parenta8b7b9c592a82fefb3b3080c65354854a5ca3fe8 (diff)
parentf9d1f3ed1dc336a5673688060a9f9c606e279c8c (diff)
downloadrust-libc-7e8f84c2bbf41d3ac0785e7aa52f1369c4a5e24c.tar.gz
Auto merge of #2979 - redox-os:redox-0.2.136, r=JohnTitor
Add MADV constants for Redox Required for `memmap2` crate
-rw-r--r--libc-test/semver/redox.txt5
-rw-r--r--src/unix/redox/mod.rs6
2 files changed, 11 insertions, 0 deletions
diff --git a/libc-test/semver/redox.txt b/libc-test/semver/redox.txt
index 475e96bdd9..4169bb79a2 100644
--- a/libc-test/semver/redox.txt
+++ b/libc-test/semver/redox.txt
@@ -100,6 +100,11 @@ IPV6_ADD_MEMBERSHIP
IPV6_DROP_MEMBERSHIP
IUCLC
IUTF8
+MADV_DONTNEED
+MADV_NORMAL
+MADV_RANDOM
+MADV_SEQUENTIAL
+MADV_WILLNEED
MSG_DONTWAIT
NI_DGRAM
NI_MAXSERV
diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs
index 02beda4312..3bb7b044d0 100644
--- a/src/unix/redox/mod.rs
+++ b/src/unix/redox/mod.rs
@@ -634,6 +634,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;