/*------------------------------------------------------------------------ | | File: fork02a.c | | Description: Another simple program creating a child process with fork() | and printing the return value from fork(). But if the return is | not 0 the process 'sleeps' for 1 second before printing. | | | Usage: fork02a | | Created: 5 Jan 15 | Author: glancast | Modifications: | +-----------------------------------------------------------------------*/ #include #include #include // for fork int main(int argc, char* argv[]) { int pid1; int pid2; pid1 = fork(); pid2 = fork(); printf("pid = %d\n", pid); return 0; }