fix fork of processes with active async io contexts
[musl.git] / src / process / posix_spawnp.c
blobaad6133b919287daa4219aed26901efb702260e6
1 #include <spawn.h>
2 #include <unistd.h>
4 int posix_spawnp(pid_t *restrict res, const char *restrict file,
5 const posix_spawn_file_actions_t *fa,
6 const posix_spawnattr_t *restrict attr,
7 char *const argv[restrict], char *const envp[restrict])
9 posix_spawnattr_t spawnp_attr = { 0 };
10 if (attr) spawnp_attr = *attr;
11 spawnp_attr.__fn = (void *)__execvpe;
12 return posix_spawn(res, file, fa, &spawnp_attr, argv, envp);