suckless-quark/minibomb.c
Armin Friedl 422a403d7c
Some checks failed
continuous-integration/drone/push Build is failing
Add minibomb for demonstration
2020-08-17 21:01:17 +02:00

22 lines
381 B
C

#include <stdio.h>
#include <unistd.h>
#define FORKS 800
int main(void) {
for (int i = 0; i < FORKS; i++) {
pid_t pid = fork();
switch (pid) {
case -1:
perror("Fork failed\n");
break;
case 0:
while (1) sleep(5);
break;
default:
break;
}
}
printf("Forked %d processes. Letting someone else clean up. Bye.\n", FORKS);
}