Overview of the UNIX Fork Process

Every process under UNIX is created using the fork(2) system call. UNIX pioneered this concept of creating two nearly identical processes from one original process. The original process is known as the parent process and the new process is the child process. Figure 19.1 shows how three processes are related in this manner.

Figure 19.1. The parent-child relationship between processes.

In Figure 19.1, the shell process ID 1294 lost its parent process, because it terminated. All orphaned processes are inherited by the init(8) process, and its process ID is always 1. Consequently, the shell's parent becomes process ...

Get Advanced UNIX Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.