Remove brk
This commit is contained in:
14
src/call.rs
14
src/call.rs
@@ -12,20 +12,6 @@ extern "C" fn restorer() -> ! {
|
||||
unreachable!();
|
||||
}
|
||||
|
||||
/// Set the end of the process's heap
|
||||
///
|
||||
/// When `addr` is `0`, this function will return the current break.
|
||||
///
|
||||
/// When `addr` is nonzero, this function will attempt to set the end of the process's
|
||||
/// heap to `addr` and return the new program break. The new program break should be
|
||||
/// checked by the allocator, it may not be exactly `addr`, as it may be aligned to a page
|
||||
/// boundary.
|
||||
///
|
||||
/// On error, `Err(ENOMEM)` will be returned indicating that no memory is available
|
||||
pub unsafe fn brk(addr: usize) -> Result<usize> {
|
||||
syscall1(SYS_BRK, addr)
|
||||
}
|
||||
|
||||
/// Change the process's working directory
|
||||
///
|
||||
/// This function will attempt to set the process's working directory to `path`, which can be
|
||||
|
||||
@@ -39,7 +39,6 @@ pub const SYS_FSYNC: usize = SYS_CLASS_FILE | 118;
|
||||
pub const SYS_FTRUNCATE: usize = SYS_CLASS_FILE | 93;
|
||||
pub const SYS_FUTIMENS: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 320;
|
||||
|
||||
pub const SYS_BRK: usize = 45;
|
||||
pub const SYS_CHDIR: usize = 12;
|
||||
pub const SYS_CLOCK_GETTIME: usize = 265;
|
||||
pub const SYS_CLONE: usize = 120;
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
#[test]
|
||||
fn brk() {
|
||||
unsafe {
|
||||
let start = dbg!(crate::brk(0)).unwrap();
|
||||
let end = start + 4 * 1024 * 1024;
|
||||
assert_eq!(dbg!(crate::brk(end)), Ok(end));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn chdir() {
|
||||
use std::str;
|
||||
|
||||
Reference in New Issue
Block a user