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