#include #include #include using namespace std; int main() { pid_t forkID{fork()}; int status; if (forkID == 0) { cout << "\tI am the child and my pid is " << getpid() << endl; usleep(1000); cout << "\tI am the child and I am exiting" << endl; return 7; } cout << "I am the parent and my pid is " << getpid() << endl; cout << "I am the partent and I am waiting on " << forkID << endl; waitpid(forkID, &status, 0); cout << "I am the parent and the child exited with a " << WEXITSTATUS(status) << endl; cout << "I am the parent and I am exiting" << endl; return 0; }