Large reorganization of headers (WIP)

This commit is contained in:
Jeremy Soller
2018-08-26 08:11:35 -06:00
parent ff32c8cbbd
commit c20ce5ffed
261 changed files with 236 additions and 1672 deletions
+8
View File
@@ -0,0 +1,8 @@
sys_includes = ["stdint.h", "sys/types.h"]
include_guard = "_SYS_MMAN_H"
trailer = "#include <bits/sys/mman.h>"
language = "C"
style = "Tag"
[enum]
prefix_with_name = true
+11
View File
@@ -0,0 +1,11 @@
use platform::types::*;
pub const PROT_READ: c_int = 0x1;
pub const PROT_WRITE: c_int = 0x2;
pub const PROT_EXEC: c_int = 0x4;
pub const PROT_NONE: c_int = 0x0;
pub const MAP_SHARED: c_int = 0x1;
pub const MAP_PRIVATE: c_int = 0x2;
pub const MAP_ANON: c_int = 0x20;
pub const MAP_ANONYMOUS: c_int = MAP_ANON;
+70
View File
@@ -0,0 +1,70 @@
use platform;
use platform::{Pal, Sys};
use platform::types::*;
pub use sys::*;
#[cfg(target_os = "linux")]
#[path = "linux.rs"]
pub mod sys;
#[cfg(target_os = "redox")]
#[path = "redox.rs"]
pub mod sys;
// #[no_mangle]
pub extern "C" fn mlock(addr: *const c_void, len: usize) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn mlockall(flags: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub unsafe extern "C" fn mmap(
addr: *mut c_void,
len: usize,
prot: c_int,
flags: c_int,
fildes: c_int,
off: off_t,
) -> *mut c_void {
Sys::mmap(addr, len, prot, flags, fildes, off)
}
// #[no_mangle]
pub extern "C" fn mprotect(addr: *mut c_void, len: usize, prot: c_int) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn msync(addr: *mut c_void, len: usize, flags: c_int) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn munlock(addr: *const c_void, len: usize) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn munlockall() -> c_int {
unimplemented!();
}
#[no_mangle]
pub unsafe extern "C" fn munmap(addr: *mut c_void, len: usize) -> c_int {
Sys::munmap(addr, len)
}
// #[no_mangle]
pub extern "C" fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int {
unimplemented!();
}
// #[no_mangle]
pub extern "C" fn shm_unlink(name: *const c_char) -> c_int {
unimplemented!();
}
+11
View File
@@ -0,0 +1,11 @@
use platform::types::*;
pub const PROT_READ: c_int = 0;
pub const PROT_WRITE: c_int = 0;
pub const PROT_EXEC: c_int = 0;
pub const PROT_NONE: c_int = 0;
pub const MAP_SHARED: c_int = 0;
pub const MAP_PRIVATE: c_int = 0;
pub const MAP_ANON: c_int = 1;
pub const MAP_ANONYMOUS: c_int = MAP_ANON;