commit f0e41c90d0d19f77603d44c4e51dbe3554d6ac82
parent 28ee2ae5b2e9259a718399e2b25d888fe52c0be0
Author: Drew DeVault <sir@cmpwn.com>
Date: Wed, 24 Feb 2021 08:45:40 -0500
rt: add (f)chdir
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/rt/+linux/syscalls.ha b/rt/+linux/syscalls.ha
@@ -26,6 +26,16 @@ export fn close(fd: int) (void | errno) = {
return;
};
+export fn chdir(path: *const char) (void | errno) = {
+ wrap_return(syscall1(SYS_chdir, path: uintptr: u64))?;
+ return;
+};
+
+export fn fchdir(fd: int) (void | errno) = {
+ wrap_return(syscall1(SYS_fchdir, fd: u64))?;
+ return;
+};
+
export fn execveat(dirfd: int, path: *const char, argv: *[*]nullable *const char,
envp: *[*]nullable *const char, flags: int) errno = {
return match (wrap_return(syscall5(SYS_execveat, dirfd: u64,