1 #include <spawn.h>
2 #include <unistd.h>
3 #include <unsupported_api.h>
4
posix_spawnp(pid_t * restrict res,const char * restrict file,const posix_spawn_file_actions_t * fa,const posix_spawnattr_t * restrict attr,char * const argv[restrict],char * const envp[restrict])5 int posix_spawnp(pid_t *restrict res, const char *restrict file,
6 const posix_spawn_file_actions_t *fa,
7 const posix_spawnattr_t *restrict attr,
8 char *const argv[restrict], char *const envp[restrict])
9 {
10 posix_spawnattr_t spawnp_attr = { 0 };
11 unsupported_api(__FUNCTION__);
12 if (attr) spawnp_attr = *attr;
13 spawnp_attr.__fn = (void *)__execvpe;
14 return posix_spawn(res, file, fa, &spawnp_attr, argv, envp);
15 }
16