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

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.

主站蜘蛛池模板: 海安县| 利辛县| 五大连池市| 厦门市| 洱源县| 神池县| 抚远县| 泗阳县| 仙游县| 集贤县| 晋城| 岢岚县| 新平| 城市| 达孜县| 会东县| 湖南省| 泽库县| 喜德县| 四川省| 响水县| 康马县| 桂林市| 广宗县| 天水市| 那坡县| 尚志市| 兴隆县| 册亨县| 穆棱市| 新泰市| 九龙城区| 湾仔区| 固镇县| 江门市| 共和县| 晋州市| 长阳| 延边| 平顶山市| 贡觉县|