Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

WHY?!

Name: Anonymous 2012-06-13 13:02


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

int main(int argc, char **argv){

    int cnt = 0;

    for(int i = 0; i < 10; i++){
        fork();
        cnt++;
    }
    printf("PID:  %d\n", getpid());

    printf("Count:  %d\n", cnt);

    return 0;
}


Copy. Paste. Compile. Run.

I only want 10 childprocess. Why is this?

PS: Yes, I'm new to programming

Name: VIPPER 2012-06-13 14:40

>>9
I install a signal handler for every signal, the handler then restarts the program if one is caught.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List