aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vfork-exec.c
blob: 2974ed68dbe3ac1e999f032541f2c0ab653da10d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
	}
}