How does parent process get the termination status through wait from a child process which calls _exit

前端 未结 4 472
滥情空心
滥情空心 2021-01-15 16:31

I have read the following statement.

The status argument given to _exit() defines the termination status of the process, which is available to the p

4条回答
  •  猫巷女王i
    2021-01-15 16:44

    _exit() doesn't return means that when a process calls _exit(), that call never returns from it (in this case, because the process terminates).

    _exit() is a system call, and takes an argument. The kernel saves that argument in an internal structure. The kernel has a lightweight structure for processes that have already exited but have not yet been waited-for (zombies). When a process waits for its children via wait() (another system call), the kernel retrieves that value, and forgets about the zombie.

提交回复
热议问题