2 gcc fork.c -o fork -Wall -W -Wextra -ansi -pedantic */
12 if ((pid
= fork()) < 0) { /* fork error */
17 else if (pid
> 0) /* parent process */
18 printf("Parent's pid: %d\n", getpid());
20 else if (pid
== 0) /* child process */
21 printf("Child's pid: %d\n", getpid());