freebsd: add realpath to freebsd/index.zig

This commit is contained in:
Marcio Giaxa 2018-12-20 21:05:31 -02:00
parent 46a0f60e4c
commit a6f33e3dc5
No known key found for this signature in database
GPG Key ID: 8628FA02F5CFEA9C

View File

@ -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;
}