From 5d53df836e55ccd039ef11dc267c2387808cb0cc Mon Sep 17 00:00:00 2001 From: jD91mZM2 Date: Sat, 15 Aug 2020 17:31:23 +0200 Subject: [PATCH] Remove brk --- src/call.rs | 14 -------------- src/number.rs | 1 - src/tests.rs | 9 --------- 3 files changed, 24 deletions(-) diff --git a/src/call.rs b/src/call.rs index e4423aa..cde2833 100644 --- a/src/call.rs +++ b/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 { - 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 diff --git a/src/number.rs b/src/number.rs index cc50580..1f037eb 100644 --- a/src/number.rs +++ b/src/number.rs @@ -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; diff --git a/src/tests.rs b/src/tests.rs index 7f87a2b..49a5f1b 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -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;