Remove brk

This commit is contained in:
jD91mZM2
2020-08-15 17:31:23 +02:00
parent 4115e0f435
commit 5d53df836e
3 changed files with 0 additions and 24 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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;