#include #include main(int argc, char* argv[]) { int pid ; if( (pid=fork()) == 0) { fprintf(stderr, "I'm the child, my pid is %d\n", getpid()); } else { wait(NULL); fprintf(stderr, "I'm the parent, my pid is %d\n", getpid()); } fprintf(stderr, "I'm %d. My parent is %d\n", getpid(), getppid()); }