| ... | @@ -74,11 +74,11 @@ pub usingnamespace @import("./AnyReader.zig"); | ... | @@ -74,11 +74,11 @@ pub usingnamespace @import("./AnyReader.zig"); |
| 74 | pub usingnamespace @import("./sum.zig"); | 74 | pub usingnamespace @import("./sum.zig"); |
| 75 | pub usingnamespace @import("./RingBuffer.zig"); | 75 | pub usingnamespace @import("./RingBuffer.zig"); |
| 76 | | 76 | |
| 77 | pub fn fd_realpath(fd: std.posix.fd_t) ![std.fs.MAX_PATH_BYTES:0]u8 { | 77 | pub fn fd_realpath(fd: std.posix.fd_t) ![std.fs.max_path_bytes:0]u8 { |
| 78 | switch (builtin.os.tag) { | 78 | switch (builtin.os.tag) { |
| 79 | .linux => { | 79 | .linux => { |
| 80 | var buf = std.mem.zeroes([64]u8); | 80 | var buf = std.mem.zeroes([64]u8); |
| 81 | var res = std.mem.zeroes([std.fs.MAX_PATH_BYTES:0]u8); | 81 | var res = std.mem.zeroes([std.fs.max_path_bytes:0]u8); |
| 82 | const str = try std.fmt.bufPrint(&buf, "/proc/self/fd/{d}", .{fd}); | 82 | const str = try std.fmt.bufPrint(&buf, "/proc/self/fd/{d}", .{fd}); |
| 83 | _ = try std.posix.readlink(str, &res); | 83 | _ = try std.posix.readlink(str, &res); |
| 84 | return res; | 84 | return res; |
| ... | @@ -86,6 +86,10 @@ pub fn fd_realpath(fd: std.posix.fd_t) ![std.fs.MAX_PATH_BYTES:0]u8 { | ... | @@ -86,6 +86,10 @@ pub fn fd_realpath(fd: std.posix.fd_t) ![std.fs.MAX_PATH_BYTES:0]u8 { |
| 86 | else => @compileError("not implemented!"), | 86 | else => @compileError("not implemented!"), |
| 87 | } | 87 | } |
| 88 | } | 88 | } |
| | 89 | test { |
| | 90 | if (builtin.os.tag != .linux) return; |
| | 91 | _ = &fd_realpath; |
| | 92 | } |
| 89 | | 93 | |
| 90 | pub usingnamespace @import("./rawInt.zig"); | 94 | pub usingnamespace @import("./rawInt.zig"); |
| 91 | pub usingnamespace @import("./expectSimilarType.zig"); | 95 | pub usingnamespace @import("./expectSimilarType.zig"); |