Skip to content
Snippets Groups Projects
Verified Commit f83ff041 authored by Dan Robertson's avatar Dan Robertson Committed by Dan Robertson
Browse files

Aarch64: Update syscall usage

Don't use syscalls that are non-existent on Aarch64 linux boxes. The
FORK and RMDIR syscalls are no longer present and the CLONE and UNLINKAT
syscalls are used instead.
parent 4da873ae
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ use errno;
use types::*;
const AT_FDCWD: c_int = -100;
const AT_REMOVEDIR: c_int = 0x200;
pub fn e(sys: usize) -> usize {
if (sys as isize) < 0 && (sys as isize) >= -256 {
......@@ -67,7 +68,7 @@ pub fn fcntl(fildes: c_int, cmd: c_int, arg: c_int) -> c_int {
}
pub fn fork() -> pid_t {
e(unsafe { syscall!(FORK) }) as pid_t
e(unsafe { syscall!(CLONE, 17, 0) }) as pid_t
}
pub fn fsync(fildes: c_int) -> c_int {
......@@ -135,7 +136,7 @@ pub fn read(fildes: c_int, buf: &mut [u8]) -> ssize_t {
}
pub fn rmdir(path: *const c_char) -> c_int {
e(unsafe { syscall!(RMDIR, path) }) as c_int
e(unsafe { syscall!(UNLINKAT, AT_FDCWD, path, AT_REMOVEDIR) }) as c_int
}
pub fn write(fildes: c_int, buf: &[u8]) -> ssize_t {
......
......@@ -11,6 +11,7 @@
/dup.out
/error
/fchdir
/fcntl
/fsync
/ftruncate
/ftruncate.out
......
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment