#include #include #include #include int main() { pid_t pid = getpid(); pid_t fpid = fork(); printf("own: %d\nfork: %d\n", pid, fpid); if (fpid == 0) { printf("parent: %d\n", getppid()); } else if (fpid > 0) { int childStatus; wait(&childStatus); printf("child exit status: %d\n", childStatus); } }