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 /* child process (pid = 0) */
21 printf("Child's pid: %d\n", getpid());
23 /* whatever goes here, will be executed from the
24 parent AND the child process as well