aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorMichael Dusan <michael.dusan@gmail.com>2023-08-15 17:20:05 -0400
committerMichael Dusan <michael.dusan@gmail.com>2023-08-15 17:29:35 -0400
commitc685b675e547f61c81c5fb63159bc12b26405100 (patch)
tree7e66d80fa84be3641d508c1e31a0645611947927 /lib/std/debug.zig
parent3eedaab731d9a31ed1039dddc9eb52d8d7002c55 (diff)
downloadzig-c685b675e547f61c81c5fb63159bc12b26405100.tar.gz
zig-c685b675e547f61c81c5fb63159bc12b26405100.zip
std.debug: avoid os.getFdPath
Commit ea9917d9bd921f9fc14028a8dbf9e3f0f2579120 introduced usage of fs.Dir.realpath which eventually calls os.getFdpath which is forbidden to be used by the compiler. It causes building zig to fail on OpenBsd, NetBSD and older versions of FreeBSD and DragonFly. This patch substitutes with os.realpath on libc targets and eventually calls c.realpath and allows zig to build. Any use of realpath is not desired but this is the lesser evil.
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index db9b93dff6..0657d667c2 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -1228,7 +1228,7 @@ pub fn readElfDebugInfo(
}
var cwd_buf: [fs.MAX_PATH_BYTES]u8 = undefined;
- const cwd_path = fs.cwd().realpath("", &cwd_buf) catch break :blk;
+ const cwd_path = os.realpath(".", &cwd_buf) catch break :blk;
// <global debug directory>/<absolute folder of current binary>/<gnu_debuglink>
for (global_debug_directories) |global_directory| {