main.cpp - #include #include #include #include <iostream>...

This preview shows page 1 out of 1 page.

#include <iostream>#include <unistd.h>#include <sys/types.h>#include <sys/wait.h>int main(){pid_t pid;std::cout << "I am the parent process" << std::endl;for(int i=0;i<3;i++){pid = fork();if (pid == 0){std::cout << "I am the child process " << i << std::endl;
End of preview. Want to read the entire page?

Upload your study docs or become a

Course Hero member to access this document

Term
Summer
Professor
N/A
Tags
Exit, Parent process, Child process

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture