diff options
| author | daurnimator <quae@daurnimator.com> | 2020-01-15 18:11:54 +1000 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-03-03 13:25:43 -0500 |
| commit | 627618a38d291d9cc76c8e30e33cad60dc26cf11 (patch) | |
| tree | 147fb6c132985cb88461abb58fcf1d18a36ce5eb /lib/std/os/linux.zig | |
| parent | dfb420e6d779b9b6d60a277401aadba2800e3572 (diff) | |
| download | zig-627618a38d291d9cc76c8e30e33cad60dc26cf11.tar.gz zig-627618a38d291d9cc76c8e30e33cad60dc26cf11.zip | |
std: add Dir.changeDir as wrapper around fchdir
Diffstat (limited to 'lib/std/os/linux.zig')
| -rw-r--r-- | lib/std/os/linux.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index de2ff5871b..719e541846 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -76,6 +76,10 @@ pub fn chdir(path: [*:0]const u8) usize { return syscall1(SYS_chdir, @ptrToInt(path)); } +pub fn fchdir(fd: fd_t) usize { + return syscall1(SYS_fchdir, @bitCast(usize, @as(isize, fd))); +} + pub fn chroot(path: [*:0]const u8) usize { return syscall1(SYS_chroot, @ptrToInt(path)); } |
