Process creation - Example
main () {
int pid;
cout << “ just one process so far”<<endl;
pid = fork();
if (pid == 0)
cout <<“im the child “<< endl;
else if (pid > 0)
cout <<“im the parent”<< endl;
else
cout << “fork failed”<< endl;}
Previous slide
Next slide
Back to first slide
View graphic version