Skip to content

Commit

Permalink
mold-wrapper: also wrap posix_spawnp
Browse files Browse the repository at this point in the history
Fixes issue 1153.

Signed-off-by: Andreas Schwab <schwab@suse.de>
  • Loading branch information
andreas-schwab committed Nov 22, 2023
1 parent 28b16ee commit 3fd1cec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions elf/mold-wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,14 @@ int posix_spawn(pid_t *pid, const char *path,
typeof(posix_spawn) *real = dlsym(RTLD_NEXT, "posix_spawn");
return real(pid, path, file_actions, attrp, argv, envp);
}

int posix_spawnp(pid_t *pid, const char *file,
const posix_spawn_file_actions_t *file_actions,
const posix_spawnattr_t *attrp,
char *const *argv, char *const *envp) {
debug_print("posix_spawnp %s\n", file);
if (!strcmp(file, "ld") || is_ld(file))
file = get_mold_path();
typeof(posix_spawnp) *real = dlsym(RTLD_NEXT, "posix_spawnp");
return real(pid, file, file_actions, attrp, argv, envp);
}

0 comments on commit 3fd1cec

Please sign in to comment.