官术网_书友最值得收藏!

wait

For processes and threads created by a parent, it might be functionally useful for the parent to know the execution status of the child process/thread. This can be achieved using the wait family of system calls:

#include <sys/types.h>
#include <sys/wait.h>
pid_t wait(int *status);
pid_t waitpid(pid_t pid, int *status, intoptions);
int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options)

These system calls update the calling process with the state change events of a child. The following state change events are notified:

  • Termination of child
  • Stopped by a signal
  • Resumed by a signal

In addition to reporting the status, these APIs allow the parent process to reap a terminated child. A process on termination is put into zombie state until the immediate parent engages the wait call to reap it.

主站蜘蛛池模板: 凭祥市| 定安县| 静宁县| 长子县| 横峰县| 清新县| 石泉县| 湖州市| 岗巴县| 溧水县| 天门市| 肇庆市| 买车| 五大连池市| 敦煌市| 亚东县| 清涧县| 鹤庆县| 揭阳市| 新干县| 淮北市| 乐平市| 明光市| 桃园县| 北海市| 洛宁县| 密云县| 绥德县| 西峡县| 汾西县| 泸定县| 登封市| 玉屏| 元氏县| 西华县| 通渭县| 衢州市| 田阳县| 墨脱县| 安达市| 延安市|