diff options
Diffstat (limited to 'tests/vfork-exec.c')
-rw-r--r-- | tests/vfork-exec.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/vfork-exec.c b/tests/vfork-exec.c new file mode 100644 index 0000000..2974ed6 --- /dev/null +++ b/tests/vfork-exec.c @@ -0,0 +1,18 @@ +#include <unistd.h> + +int +main(int argc, char *argv[], char *envp[]) +{ + (void) argc; + argv = (void *)(const char *[]){"/usr/bin/sleep", "1", NULL}; + switch (vfork()) { + case -1: + return -1; + case 0: + execve("", argv, envp); + execve(*argv, argv, envp); + _exit(2); + default: + return 1; + } +} |