Parent process

From Wikipedia, the free encyclopedia

A parent process is a computer process that has created one or more child processes.

In UNIX, every process except process 0 (the swapper) is created when another process executes the fork system call. The process that invoked fork is the parent process and the newly-created process is the child process. Every process (except process 0) has one parent process, but can have many child processes.

The kernel identifies each process by its process identifier (PID). Process 0 is a special process that is created when the system boots; after forking a child process (process 1), process 0 becomes the swapper process. Process 1, known as init, is the ancestor of every other process in the system.

When a child process terminates execution, either by calling the exit system call, causing a fatal execution error, or receiving a terminating signal, an exit status is returned to the operating system. This status value can then be retrieved by the parent process and indicates how the child process terminated. If the child process terminated normally, the value also includes the exit code returned by the child program.

This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL.