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

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.

主站蜘蛛池模板: 抚远县| 多伦县| 珲春市| 广元市| 房山区| 洞口县| 怀远县| 都江堰市| 梁平县| 枝江市| 桦甸市| 田林县| 天长市| 台北市| 内江市| 花莲县| 民权县| 双城市| 岳西县| 南城县| 夏邑县| 大姚县| 屏东市| 广平县| 新巴尔虎右旗| 苏尼特左旗| 光山县| 梁平县| 兰坪| 泸西县| 汨罗市| 九江县| 陈巴尔虎旗| 青海省| 丽江市| 巴中市| 石棉县| 常德市| 射洪县| 南召县| 孟津县|