forked from M-Labs/libfringe
don't re-export os::unix internals
This commit is contained in:
parent
cf33440503
commit
8dd3044da5
|
@ -1,8 +1,8 @@
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
use core::prelude::*;
|
use core::prelude::*;
|
||||||
pub use self::libc::{c_void, c_int, size_t};
|
use self::libc::{c_void, c_int, size_t};
|
||||||
pub use self::libc::{mmap, mprotect, munmap};
|
use self::libc::{mmap, mprotect, munmap};
|
||||||
pub use self::libc::MAP_FAILED;
|
use self::libc::MAP_FAILED;
|
||||||
|
|
||||||
use core::ptr;
|
use core::ptr;
|
||||||
|
|
||||||
|
@ -12,12 +12,12 @@ pub fn page_size() -> usize {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const GUARD_PROT: c_int = libc::PROT_NONE;
|
const GUARD_PROT: c_int = libc::PROT_NONE;
|
||||||
pub const STACK_PROT: c_int = libc::PROT_READ
|
const STACK_PROT: c_int = libc::PROT_READ
|
||||||
| libc::PROT_WRITE;
|
| libc::PROT_WRITE;
|
||||||
pub const STACK_FLAGS: c_int = libc::MAP_STACK
|
const STACK_FLAGS: c_int = libc::MAP_STACK
|
||||||
| libc::MAP_PRIVATE
|
| libc::MAP_PRIVATE
|
||||||
| libc::MAP_ANON;
|
| libc::MAP_ANON;
|
||||||
|
|
||||||
pub unsafe fn map_stack(len: usize) -> Option<*mut u8> {
|
pub unsafe fn map_stack(len: usize) -> Option<*mut u8> {
|
||||||
let ptr = mmap(ptr::null_mut(), len as size_t,
|
let ptr = mmap(ptr::null_mut(), len as size_t,
|
||||||
|
|
Loading…
Reference in New Issue