Search results
Results from the WOW.Com Content Network
The parent process may then issue a wait system call, which suspends the execution of the parent process while the child executes. When the child process terminates, it returns an exit status to the operating system, which is then returned to the waiting parent process. The parent process then resumes execution.
In Unix-like operating systems, 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.
In Unix and other POSIX-compatible systems, the parent process can retrieve the exit status of a child process using the wait() family of system calls defined in wait.h. [10] Of these, the waitid() [11] call retrieves the full exit status, but the older wait() and waitpid() [12] calls retrieve only the least significant 8 bits of the exit status.
The parent can read the child's exit status by executing the wait system call, whereupon the zombie is removed. The wait call may be executed in sequential code, but it is commonly executed in a handler for the SIGCHLD signal , which the parent receives whenever a child has died.
The wait system call is commonly invoked in the SIGCHLD handler. POSIX.1-2001 allows a parent process to elect for the kernel to automatically reap child processes that terminate by explicitly setting the disposition of SIGCHLD to SIG_IGN (although ignore is the default, automatic reaping only occurs if the disposition is set to ignore ...
The exit status can then be retrieved by the parent process via the wait system call. Most operating systems allow the terminating process to provide a specific exit status to the system, which is made available to the parent process.
Get AOL Mail for FREE! Manage your email like never before with travel, photo & document views. Personalize your inbox with themes & tabs. You've Got Mail!
The underlying program is no longer executing, but the process remains in the process table as a zombie process until its parent process calls the wait system call to read its exit status, at which point the process is removed from the process table, finally ending the process's lifetime.