#include #include #include #include #include #include #include pid_t Fork(void) { pid_t pid; if ((pid = fork()) < 0) { fprintf(stderr, "Fork Error: %s\n", strerror(errno)); exit(1); } return pid; } int main() { pid_t pid; int x = 1; pid = Fork(); if (pid == 0) { // Child printf("Child: x = %d\n", ++x); //getchar(); exit(0); } //wait(NULL); No Wait => Topo Sort printf("Parent: x = %d\n", ++x); getchar(); exit(0); }