Skip to content
Snippets Groups Projects
Commit 14c81251 authored by SamwiseFilmore's avatar SamwiseFilmore
Browse files

Implement fcntl

No tests written yet! See #36
parent dbe73d4b
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ pub extern "C" fn creat(path: *const c_char, mode: mode_t) -> c_int {
#[no_mangle]
pub extern "C" fn fcntl(fildes: c_int, cmd: c_int, arg: c_int) -> c_int {
unimplemented!();
platform::fcntl(fildes, cmd, arg)
}
#[no_mangle]
......
......@@ -62,6 +62,10 @@ pub fn fchdir(fildes: c_int) -> c_int {
e(unsafe { syscall!(FCHDIR, fildes) }) as c_int
}
pub fn fcntl(fildes: c_int, cmd: c_int, arg: c_int) -> c_int {
e(unsafe { syscall!(FCNTL, fildes, cmd, arg) }) as c_int
}
pub fn fork() -> pid_t {
e(unsafe { syscall!(FORK) }) as pid_t
}
......
......@@ -63,6 +63,10 @@ pub fn fchdir(fd: c_int) -> c_int {
}
}
pub fn fcntl(fd: c_int, cmd: c_int, args: c_int) -> c_int {
e(syscall::fcntl(fd, cmd, args)) as c_int
}
pub fn fork() -> pid_t {
e(unsafe { syscall::clone(0) }) as pid_t
}
......
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