#include #include #include int main(int argc, char ** argv) { int pid; int i; char process_symbol; int sleeping_time; int limit = atoi(argv[1]); process_symbol = '#'; sleeping_time = 100; pid = fork(); // returns TWICE! // -> with value 0 in child process // -> with value "child PID" in the parent process // NOT to be confused with CURRENT PID // < 0 means error if (pid < 0) { fprintf(stderr, "Child Process Creation Failed!\n"); exit(EXIT_FAILURE); } // child obtains a *copy* of the parent status (e.g. values of vars) // but has its *own* address space if (pid == 0) { process_symbol = '%'; sleeping_time = 1000; } for (i = 0; i