#include #include //standard unix system calls #include using namespace std; int main(void) { int i; int status; i = fork(); if(!i) { cout << "I am the child process, fork returned: " << i << endl; return 3; } else { wait(&status); status = WEXITSTATUS(status); cout << "I am the parent. Fork returned " << i << " the child exited with " << status << endl; } return 0; }