Verified Commit 081db21c authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Add sys/mman constants and functions

parent 4f11029a
......@@ -548,6 +548,25 @@ pub const EPOLLWAKEUP: ::c_int = 0;
pub const EPOLLONESHOT: ::c_int = 0;
pub const EPOLLET: ::c_int = 0;
// sys/mman.h
pub const MAP_FILE: ::c_int = 0x0000;
pub const MAP_SHARED: ::c_int = 0x0001;
pub const MAP_PRIVATE: ::c_int = 0x0002;
pub const MAP_FIXED: ::c_int = 0x0010;
pub const MAP_ANON: ::c_int = 0x0020;
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
pub const MS_ASYNC: ::c_int = 0x0001;
pub const MS_INVALIDATE: ::c_int = 0x0002;
pub const MS_SYNC: ::c_int = 0x0004;
pub const PROT_NONE: ::c_int = 0;
pub const PROT_READ: ::c_int = 1;
pub const PROT_WRITE: ::c_int = 2;
pub const PROT_EXEC: ::c_int = 4;
// sys/stat.h
pub const S_IFMT: ::c_int = 0o0_170_000;
pub const S_IFDIR: ::c_int = 0o040_000;
......@@ -908,6 +927,18 @@ extern "C" {
// sys/ioctl.h
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
// sys/mman.h
pub fn mprotect(
addr: *mut ::c_void,
len: ::size_t,
prot: ::c_int
) -> ::c_int;
pub fn msync(
addr: *mut ::c_void,
len: ::size_t,
flags: ::c_int
) -> ::c_int;
// sys/resource.h
pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment