aboutsummaryrefslogtreecommitdiffstats
path: root/tests/fork-sleep.c
blob: f48c0b156344f864aeb66025ea6fb7edf3e3e45e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <time.h>
#include <unistd.h>

int
main(void)
{
	struct timespec ts = {0, 100000000L};
	switch (fork()) {
	case -1:
		return 2;
	case 0:
		return 0;
	default:
		nanosleep(&ts, NULL);
		return 1;
	}
}