Project

General

Profile

Bug #2349 » zombifier.c

test case – run and check "ps axl | fgrep zombifier" - matthiasr, 04/17/2012 01:11 PM

 
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>

int main(int argc, char **argv) {
int pid = 0;
int i;
for( i = 300; i>0; i-- ) {
signal(SIGCHLD, SIG_IGN);
pid = fork();
switch(pid) {
case -1:
exit(1);
case 0:
exit(2);
default:
sleep(1);
}
}
exit(0);
}
(1-1/2)