| ... | @@ -8,6 +8,11 @@ const Dir = @This(); | ... | @@ -8,6 +8,11 @@ const Dir = @This(); |
| 8 | | 8 | |
| 9 | const os = builtin.target.os.tag; | 9 | const os = builtin.target.os.tag; |
| 10 | | 10 | |
| | 11 | const sys = switch (os) { |
| | 12 | .linux => sys_linux, |
| | 13 | else => unreachable, |
| | 14 | }; |
| | 15 | |
| 11 | fd: nfs.Handle, | 16 | fd: nfs.Handle, |
| 12 | | 17 | |
| 13 | // Resource allocation may fail; resource deallocation must succeed. | 18 | // Resource allocation may fail; resource deallocation must succeed. |
| ... | @@ -105,3 +110,7 @@ pub fn makeOpenPath(self: Dir, sub_path: [:0]const u8, flags: OpenDirFlags) !Dir | ... | @@ -105,3 +110,7 @@ pub fn makeOpenPath(self: Dir, sub_path: [:0]const u8, flags: OpenDirFlags) !Dir |
| 105 | else => |e| return e, | 110 | else => |e| return e, |
| 106 | }; | 111 | }; |
| 107 | } | 112 | } |
| | 113 | |
| | 114 | pub fn readlink(self: Dir, noalias sub_path: [:0]const u8, noalias buf: []u8) ![:0]u8 { |
| | 115 | return sys.readlinkat(@intFromEnum(self.fd), sub_path, buf); |
| | 116 | } |