diff --git a/src/platform/src/linux/mod.rs b/src/platform/src/linux/mod.rs index 9044494470a74ede995efd3b2e6b8b624f90ba72..aa7eef7c00bdd2bdd4f323eb190e28a757fb3be6 100644 --- a/src/platform/src/linux/mod.rs +++ b/src/platform/src/linux/mod.rs @@ -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 { diff --git a/tests/.gitignore b/tests/.gitignore index 073101f0f5089583872a235efe4d63df7993d5e7..d25e2d6249151b770c07da07716c81b88b9649f4 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -11,6 +11,7 @@ /dup.out /error /fchdir +/fcntl /fsync /ftruncate /ftruncate.out diff --git a/tests/fcntl b/tests/fcntl deleted file mode 100755 index 4499cb1482f3157fa2e77cac3c4a42fcd72fedf3..0000000000000000000000000000000000000000 Binary files a/tests/fcntl and /dev/null differ