Commit 405964e4 authored by Jeremy Soller's avatar Jeremy Soller

Merge branch 'remove-brk' into 'master'

Remove brk

See merge request !59
parents 4115e0f4 5d53df83
Pipeline #8336 failed with stages
in 45 seconds
......@@ -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;
......
#[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;
......
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