std.c.darwin.posix_spawn: fix signature

And change corresponding signature in `DarwinPosixSpawn`.
This commit is contained in:
mlugg 2024-12-16 14:52:45 +00:00
parent 3e9810266b
commit 512cb22d83
No known key found for this signature in database
GPG Key ID: 3F5B7DCCBF4AF02E
2 changed files with 8 additions and 8 deletions

View File

@ -1232,16 +1232,16 @@ pub extern "c" fn posix_spawn(
path: [*:0]const u8, path: [*:0]const u8,
actions: ?*const posix_spawn_file_actions_t, actions: ?*const posix_spawn_file_actions_t,
attr: ?*const posix_spawnattr_t, attr: ?*const posix_spawnattr_t,
argv: [*:null]?[*:0]const u8, argv: [*:null]const ?[*:0]const u8,
env: [*:null]?[*:0]const u8, env: [*:null]const ?[*:0]const u8,
) c_int; ) c_int;
pub extern "c" fn posix_spawnp( pub extern "c" fn posix_spawnp(
pid: *pid_t, pid: *pid_t,
path: [*:0]const u8, path: [*:0]const u8,
actions: ?*const posix_spawn_file_actions_t, actions: ?*const posix_spawn_file_actions_t,
attr: ?*const posix_spawnattr_t, attr: ?*const posix_spawnattr_t,
argv: [*:null]?[*:0]const u8, argv: [*:null]const ?[*:0]const u8,
env: [*:null]?[*:0]const u8, env: [*:null]const ?[*:0]const u8,
) c_int; ) c_int;
pub const E = enum(u16) { pub const E = enum(u16) {

View File

@ -161,8 +161,8 @@ pub fn spawn(
path: []const u8, path: []const u8,
actions: ?Actions, actions: ?Actions,
attr: ?Attr, attr: ?Attr,
argv: [*:null]?[*:0]const u8, argv: [*:null]const ?[*:0]const u8,
envp: [*:null]?[*:0]const u8, envp: [*:null]const ?[*:0]const u8,
) Error!std.c.pid_t { ) Error!std.c.pid_t {
const posix_path = try std.posix.toPosixPath(path); const posix_path = try std.posix.toPosixPath(path);
return spawnZ(&posix_path, actions, attr, argv, envp); return spawnZ(&posix_path, actions, attr, argv, envp);
@ -172,8 +172,8 @@ pub fn spawnZ(
path: [*:0]const u8, path: [*:0]const u8,
actions: ?Actions, actions: ?Actions,
attr: ?Attr, attr: ?Attr,
argv: [*:null]?[*:0]const u8, argv: [*:null]const ?[*:0]const u8,
envp: [*:null]?[*:0]const u8, envp: [*:null]const ?[*:0]const u8,
) Error!std.c.pid_t { ) Error!std.c.pid_t {
var pid: std.c.pid_t = undefined; var pid: std.c.pid_t = undefined;
switch (errno(std.c.posix_spawn( switch (errno(std.c.posix_spawn(