With my lab work at uni I have to replace the pseudo code underlined with a method to solve the task involving to " call the loop method, passing in 2 to represent child", im really unsure on how to start this task.
if( childProcess >= 0 ) {
if( childProcess == 0 ) {
// this is the child process
printf("New process has id %d, parent id %d\n", getpid(), getppid() );
// call the loop method, passing in 2 to represent child
exit(0);
} else {
// this is the parent process
// call the loop method, passing in 1 to represent parent
}
} else printf("Error when trying to create a new process!\n");
return 0;
}