mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-06 05:41:37 +00:00
28 lines
414 B
C
28 lines
414 B
C
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include <sys/wait.h>
|
|
|
|
int main(int argc, char ** argv)
|
|
{
|
|
int times = 0, i;
|
|
pid_t pid;
|
|
|
|
if (argc > 1)
|
|
times = atoi(argv[1]);
|
|
|
|
for (i = 0 ; i < times ; i++) {
|
|
pid = fork();
|
|
|
|
if (pid < 0)
|
|
exit(1);
|
|
|
|
if (pid > 0) {
|
|
waitpid(pid, NULL, 0);
|
|
exit(0);
|
|
}
|
|
}
|
|
|
|
sleep(1);
|
|
return 0;
|
|
}
|