From 1928cf4fab2149bc00727ac1b77836a8ed81420e Mon Sep 17 00:00:00 2001
From: David Carlier <devnexen@gmail.com>
Date: Mon, 3 Apr 2023 20:18:04 +0100
Subject: [PATCH] sys_mman add further mmap/madvise flags.

---
 src/header/sys_mman/linux.rs | 8 ++++++++
 src/header/sys_mman/mod.rs   | 1 +
 src/header/sys_mman/redox.rs | 5 +++++
 3 files changed, 14 insertions(+)

diff --git a/src/header/sys_mman/linux.rs b/src/header/sys_mman/linux.rs
index 1a8fb4496..e79571891 100644
--- a/src/header/sys_mman/linux.rs
+++ b/src/header/sys_mman/linux.rs
@@ -7,3 +7,11 @@ pub const PROT_NONE: c_int = 0x0000;
 
 pub const MAP_FIXED: c_int = 0x0010;
 pub const MAP_FIXED_NOREPLACE: c_int = 0x100000;
+pub const MAP_POPULATE: c_int = 0x008000;
+pub const MAP_HUGETLB: c_int = 0x40000;
+pub const MAP_NORESERVE: c_int = 0x4000;
+
+pub const MADV_HUGEPAGE: c_int = 14;
+pub const MADV_NOHUGEPAGE: c_int = 15;
+pub const MADV_DONTDUMP: c_int = 16;
+pub const MADV_DODUMP: c_int = 17;
diff --git a/src/header/sys_mman/mod.rs b/src/header/sys_mman/mod.rs
index 7cca17844..7b6ce5a1f 100644
--- a/src/header/sys_mman/mod.rs
+++ b/src/header/sys_mman/mod.rs
@@ -25,6 +25,7 @@ pub const MAP_PRIVATE: c_int = 0x0002;
 pub const MAP_TYPE: c_int = 0x000F;
 pub const MAP_ANON: c_int = 0x0020;
 pub const MAP_ANONYMOUS: c_int = MAP_ANON;
+pub const MAP_STACK: c_int = 0x20000;
 
 pub const MS_ASYNC: c_int = 0x0001;
 pub const MS_INVALIDATE: c_int = 0x0002;
diff --git a/src/header/sys_mman/redox.rs b/src/header/sys_mman/redox.rs
index 58a3aef05..71f4170cf 100644
--- a/src/header/sys_mman/redox.rs
+++ b/src/header/sys_mman/redox.rs
@@ -7,3 +7,8 @@ pub const PROT_READ: c_int = 0x0004;
 
 pub const MAP_FIXED: c_int = 0x0004;
 pub const MAP_FIXED_NOREPLACE: c_int = 0x000C;
+pub const MAP_POPULATE: c_int = 0x0001F;
+pub const MAP_HUGETLB: c_int = 0x2E;
+
+pub const MADV_DONTDUMP: c_int = 5;
+pub const MADV_DODUMP: c_int = 6;
-- 
GitLab