diff options
| author | Marcio Giaxa <i@mgxm.me> | 2018-12-20 21:05:31 -0200 |
|---|---|---|
| committer | Marcio Giaxa <i@mgxm.me> | 2018-12-20 21:05:31 -0200 |
| commit | a6f33e3dc56eab57ee148c2ec7592540470d582c (patch) | |
| tree | 0c6a666db735c2a87a66d2f06e0613da96b1640a /std | |
| parent | 46a0f60e4c0c91f840982cb98066d60301624548 (diff) | |
| download | zig-a6f33e3dc56eab57ee148c2ec7592540470d582c.tar.gz zig-a6f33e3dc56eab57ee148c2ec7592540470d582c.zip | |
freebsd: add realpath to freebsd/index.zig
Diffstat (limited to 'std')
| -rw-r--r-- | std/os/freebsd/index.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/std/os/freebsd/index.zig b/std/os/freebsd/index.zig index 1e08afe26d..f1533ec098 100644 --- a/std/os/freebsd/index.zig +++ b/std/os/freebsd/index.zig @@ -580,6 +580,10 @@ pub fn getdirentries(fd: i32, buf_ptr: [*]u8, buf_len: usize, basep: *i64) usize return errnoWrap(@bitCast(isize, c.getdirentries(fd, buf_ptr, buf_len, basep))); } +pub fn realpath(noalias filename: [*]const u8, noalias resolved_name: [*]u8) usize { + return if (c.realpath(filename, resolved_name) == null) @bitCast(usize, -isize(c._errno().*)) else 0; +} + pub fn isatty(fd: i32) bool { return c.isatty(fd) != 0; } |
