Merge branch 'freebsd-up' of https://github.com/myfreeweb/zig into freebsd2
This commit is contained in:
@@ -1188,6 +1188,15 @@ pub fn realC(out_buffer: *[os.MAX_PATH_BYTES]u8, pathname: [*]const u8) RealErro
|
||||
|
||||
return os.readLinkC(out_buffer, proc_path.ptr);
|
||||
},
|
||||
Os.freebsd => { // XXX requires fdescfs
|
||||
const fd = try os.posixOpenC(pathname, posix.O_PATH | posix.O_NONBLOCK | posix.O_CLOEXEC, 0);
|
||||
defer os.close(fd);
|
||||
|
||||
var buf: ["/dev/fd/-2147483648".len]u8 = undefined;
|
||||
const proc_path = fmt.bufPrint(buf[0..], "/dev/fd/{}\x00", fd) catch unreachable;
|
||||
|
||||
return os.readLinkC(out_buffer, proc_path.ptr);
|
||||
},
|
||||
else => @compileError("TODO implement os.path.real for " ++ @tagName(builtin.os)),
|
||||
}
|
||||
}
|
||||
@@ -1202,7 +1211,7 @@ pub fn real(out_buffer: *[os.MAX_PATH_BYTES]u8, pathname: []const u8) RealError!
|
||||
const pathname_w = try windows_util.sliceToPrefixedFileW(pathname);
|
||||
return realW(out_buffer, &pathname_w);
|
||||
},
|
||||
Os.macosx, Os.ios, Os.linux => {
|
||||
Os.macosx, Os.ios, Os.linux, Os.freebsd => {
|
||||
const pathname_c = try os.toPosixPath(pathname);
|
||||
return realC(out_buffer, &pathname_c);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user