tryposixspawn.c (356B)
1 /* ISC license. */ 2 3 #include <spawn.h> 4 5 int main (void) 6 { 7 pid_t pid ; 8 posix_spawn_file_actions_t actions ; 9 posix_spawnattr_t attr ; 10 char *const argv[2] = { "/bin/true", 0 } ; 11 char *const envp[1] = { 0 } ; 12 posix_spawnattr_setflags(&attr, 0) ; 13 posix_spawn_file_actions_init(&actions) ; 14 return posix_spawn(&pid, argv[0], 0, 0, argv, envp) ; 15 }