aboutsummaryrefslogtreecommitdiff
path: root/lib/std/process.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-02-07 00:31:17 -0500
committerGitHub <noreply@github.com>2022-02-07 00:31:17 -0500
commit21135387fb7c2dbaf70a72f2c97341e9c1307045 (patch)
tree5926ea2d182a76f80429776a5473202738c9b656 /lib/std/process.zig
parent069dd01ce4ced3cb9664e4f1e09be753cb3ed476 (diff)
parent33fa29601921d88097a1ee3c0d92b93047a5186d (diff)
downloadzig-21135387fb7c2dbaf70a72f2c97341e9c1307045.tar.gz
zig-21135387fb7c2dbaf70a72f2c97341e9c1307045.zip
Merge pull request #10782 from topolarity/gate-child-processes
Avoid depending on child process execution when not supported by host OS
Diffstat (limited to 'lib/std/process.zig')
-rw-r--r--lib/std/process.zig8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/std/process.zig b/lib/std/process.zig
index 699c994abf..c0f11b22ce 100644
--- a/lib/std/process.zig
+++ b/lib/std/process.zig
@@ -950,7 +950,13 @@ pub fn getSelfExeSharedLibPaths(allocator: Allocator) error{OutOfMemory}![][:0]u
/// Tells whether calling the `execv` or `execve` functions will be a compile error.
pub const can_execv = switch (builtin.os.tag) {
- .windows, .haiku => false,
+ .windows, .haiku, .wasi => false,
+ else => true,
+};
+
+/// Tells whether spawning child processes is supported (e.g. via ChildProcess)
+pub const can_spawn = switch (builtin.os.tag) {
+ .wasi => false,
else => true,
};