authorgravatar for enfipy@gmail.comDavid <enfipy@gmail.com> 2026-10-04 10:39:43+04:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-04 18:21:32+02:00
logf842de18455550280a99a0128623fdd6311518da
tree5d830f8ecff3ad94d8e74169a0dd65d5723bc691
parent6171a2be743e466edc53eccf600253adccd7599b
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.process: match can_spawn and can_replace to Apple SDK availability


2 files changed, 6 insertions(+), 6 deletions(-)

lib/std/Io/Threaded.zig+4-4
...@@ -354,7 +354,7 @@ pub const NullFile = switch (native_os) {...@@ -354,7 +354,7 @@ pub const NullFile = switch (native_os) {
354 }354 }
355 }355 }
356 },356 },
357 .wasi, .ios, .tvos, .visionos, .watchos => struct {357 .wasi, .tvos, .watchos => struct {
358 fn deinit(this: @This()) void {358 fn deinit(this: @This()) void {
359 _ = this;359 _ = this;
360 }360 }
...@@ -15214,7 +15214,7 @@ fn processReplace(userdata: ?*anyopaque, options: process.ReplaceOptions) proces...@@ -15214,7 +15214,7 @@ fn processReplace(userdata: ?*anyopaque, options: process.ReplaceOptions) proces
15214 });15214 });
15215 };15215 };
1521615216
15217 if (is_darwin and process.can_spawn) if (t.spawnDarwin(15217 if (is_darwin) if (t.spawnDarwin(
15218 .replace,15218 .replace,
15219 options.exe,15219 options.exe,
15220 argv_buf.ptr,15220 argv_buf.ptr,
...@@ -15259,9 +15259,9 @@ fn processReplace(userdata: ?*anyopaque, options: process.ReplaceOptions) proces...@@ -15259,9 +15259,9 @@ fn processReplace(userdata: ?*anyopaque, options: process.ReplaceOptions) proces
15259}15259}
1526015260
15261const processSpawn = switch (native_os) {15261const processSpawn = switch (native_os) {
15262 .wasi, .emscripten, .ios, .tvos, .visionos, .watchos => processSpawnUnsupported,15262 .wasi, .emscripten, .tvos, .watchos => processSpawnUnsupported,
15263 .windows => processSpawnWindows,15263 .windows => processSpawnWindows,
15264 .driverkit, .maccatalyst, .macos => processSpawnDarwin,15264 .driverkit, .ios, .maccatalyst, .macos, .visionos => processSpawnDarwin,
15265 else => processSpawnPosix,15265 else => processSpawnPosix,
15266};15266};
1526715267
lib/std/process.zig+2-2
...@@ -254,13 +254,13 @@ pub fn getBaseAddress() usize {...@@ -254,13 +254,13 @@ pub fn getBaseAddress() usize {
254/// process image. If this is `false` then calling `replace` or `replaceFile`254/// process image. If this is `false` then calling `replace` or `replaceFile`
255/// functions will return `error.OperationUnsupported`.255/// functions will return `error.OperationUnsupported`.
256pub const can_replace = switch (native_os) {256pub const can_replace = switch (native_os) {
257 .windows, .haiku, .wasi => false,257 .windows, .haiku, .wasi, .tvos, .watchos => false,
258 else => true,258 else => true,
259};259};
260260
261/// Tells whether spawning child processes is supported.261/// Tells whether spawning child processes is supported.
262pub const can_spawn = switch (native_os) {262pub const can_spawn = switch (native_os) {
263 .wasi, .ios, .tvos, .visionos, .watchos => false,263 .wasi, .tvos, .watchos => false,
264 else => true,264 else => true,
265};265};
266266