Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/TSCBasic/Process/Process.swift
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ public final class Process {
}
let argv = CStringArray(resolvedArgs)
let env = CStringArray(environment.map({ "\($0.0)=\($0.1)" }))
let rv = posix_spawnp(&processID, argv.cArray[0]!, &fileActions, &attributes, argv.cArray, env.cArray)
let rv = SPM_posix_spawnp(&processID, argv.cArray[0]!, &fileActions, &attributes, argv.cArray, env.cArray)

guard rv == 0 else {
throw SystemError.posix_spawn(rv, arguments)
Expand Down
2 changes: 2 additions & 0 deletions Sources/TSCclibc/include/process.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ int SPM_posix_spawn_file_actions_addchdir_np(posix_spawn_file_actions_t *restric
// Runtime check for the availability of posix_spawn_file_actions_addchdir_np. Returns 0 if the method is available, -1 if not.
bool SPM_posix_spawn_file_actions_addchdir_np_supported();

int SPM_posix_spawnp(pid_t *pid, const char *file, const posix_spawn_file_actions_t *actions, const posix_spawnattr_t *attr, char *const argv[], char *const env[]);

#ifdef TSC_API_UNAVAILABLE_DEFINED
#undef TSC_API_UNAVAILABLE_DEFINED
#undef __API_UNAVAILABLE
Expand Down
4 changes: 4 additions & 0 deletions Sources/TSCclibc/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,8 @@ bool SPM_posix_spawn_file_actions_addchdir_np_supported() {
#endif
}

int SPM_posix_spawnp(pid_t *pid, const char *file, const posix_spawn_file_actions_t *actions, const posix_spawnattr_t *attr, char *const argv[], char *const env[]) {
return posix_spawnp(pid, file, actions, attr, argv, env);
}

#endif