//===================================================== // Matt Kretchmar // A small program to create processes //===================================================== #include /* symbolic constants */ #include /* system data types */ #include /* Errors */ #include /* Input/Output */ #include /* Wait for Process Termination */ #include /* General Utilities */ int main ( void ) { pid_t pid; /* variable to hold process id */ printf("Hello from this program\n"); pid = fork(); /* fork call splits process */ if ( pid == 0 ) { printf("Hello from child (my pid=%d)\n",pid); sleep(3); } else { printf("Hello from parent (with child pid=%d)\n",pid); sleep(5); } printf("Goodbye from this program\n"); return 0; }