3 * gcc fork.c -o fork -Wall -W -Wextra -ansi -pedantic
14 if ((pid
= fork()) < 0) { /* fork error */
19 else if (pid
> 0) /* parent process */
20 printf("Parent's pid: %d\n", getpid());
22 else /* child process (pid = 0) */
23 printf("Child's pid: %d\n", getpid());
26 * Whatever goes here, will be executed from the
27 * parent AND the child process as well.