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

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.

主站蜘蛛池模板: 环江| 海口市| 于都县| 凤庆县| 光山县| 兴城市| 雷波县| 彰武县| 沅江市| 琼中| 砀山县| 江孜县| 平和县| 德昌县| 河北区| 田林县| 新竹县| 勃利县| 汨罗市| 苗栗县| 固原市| 兰坪| 苍南县| 陕西省| 朝阳县| 扎赉特旗| 铜鼓县| 荣成市| 大港区| 工布江达县| 镇安县| 高陵县| 赣州市| 定襄县| 阳原县| 阿拉尔市| 塘沽区| 察雅县| 田东县| 新竹县| 涡阳县|