Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
redox-os
syscall
Commits
5d53df83
Verified
Commit
5d53df83
authored
Aug 15, 2020
by
jD91mZM2
Browse files
Remove brk
parent
4115e0f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/call.rs
View file @
5d53df83
...
...
@@ -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
...
...
src/number.rs
View file @
5d53df83
...
...
@@ -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
;
...
...
src/tests.rs
View file @
5d53df83
#[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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment