You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/sys/mman.hpp
+23Lines changed: 23 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,20 @@ namespace os::mem {
17
17
Fixed = MAP_FIXED,
18
18
Anonymous = MAP_ANONYMOUS,
19
19
};
20
+
21
+
enumclassPermission : uint8_t { // TODO(mazunki): consider making Permission::{Read,Write,Execute} private or standalone class
22
+
Read = PROT_READ,
23
+
Write = PROT_WRITE,
24
+
Execute = PROT_EXEC,
25
+
26
+
Data = Read | Write,
27
+
Code = Read | Execute,
28
+
29
+
Any = 0, // TODO(mazunki): this should really be R|W|X; but requires some refactoring
30
+
RWX = Read|Write|Execute, // TODO(mazunki): temporary, remove me. references should use Permission::Any
31
+
32
+
// None = 0, // TODO(mazunki): implement this after Any is properly implemented (to avoid confusion with old Access::none which had a different meaning). should block all access (best used for unmapped stuff, potentially tests)
33
+
};
20
34
} // os::mmap
21
35
22
36
@@ -28,3 +42,12 @@ namespace util {
28
42
};
29
43
}
30
44
45
+
inlinenamespacebitops {
46
+
template<>
47
+
structenable_bitmask_ops<os::mem::Permission> {
48
+
using type = typename std::underlying_type<os::mem::Permission>::type;
0 commit comments