diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-02-25 16:00:00 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-25 16:00:00 -0800 |
| commit | 7edb204edfa41e11776ac009da5a20fb1c907f5f (patch) | |
| tree | 9c6eae297ebc492c0a1a94a4d3d25fc3bcd07bd9 /lib/std/process.zig | |
| parent | 297eabd4accbcae42bfe821078a79e4af06a2dde (diff) | |
| parent | 37a1d08de2ce263439713180f57741d16fb27e23 (diff) | |
| download | zig-7edb204edfa41e11776ac009da5a20fb1c907f5f.tar.gz zig-7edb204edfa41e11776ac009da5a20fb1c907f5f.zip | |
Merge pull request #7546 from hoanga/haiku-support
initial support for haiku
Diffstat (limited to 'lib/std/process.zig')
| -rw-r--r-- | lib/std/process.zig | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/std/process.zig b/lib/std/process.zig index 3529bf52cb..3ad73db420 100644 --- a/lib/std/process.zig +++ b/lib/std/process.zig @@ -609,7 +609,7 @@ pub const UserInfo = struct { /// POSIX function which gets a uid from username. pub fn getUserInfo(name: []const u8) !UserInfo { return switch (builtin.os.tag) { - .linux, .macos, .watchos, .tvos, .ios, .freebsd, .netbsd, .openbsd => posixGetUserInfo(name), + .linux, .macos, .watchos, .tvos, .ios, .freebsd, .netbsd, .openbsd, .haiku => posixGetUserInfo(name), else => @compileError("Unsupported OS"), }; } @@ -777,6 +777,24 @@ pub fn getSelfExeSharedLibPaths(allocator: *Allocator) error{OutOfMemory}![][:0] } return paths.toOwnedSlice(); }, + // revisit if Haiku implements dl_iterat_phdr (https://dev.haiku-os.org/ticket/15743) + .haiku => { + var paths = List.init(allocator); + errdefer { + const slice = paths.toOwnedSlice(); + for (slice) |item| { + allocator.free(item); + } + allocator.free(slice); + } + + var b = "/boot/system/runtime_loader"; + const item = try allocator.dupeZ(u8, mem.spanZ(b)); + errdefer allocator.free(item); + try paths.append(item); + + return paths.toOwnedSlice(); + }, else => @compileError("getSelfExeSharedLibPaths unimplemented for this target"), } } |
