- Mastering Linux Kernel Development
- Raghu Bharadwaj
- 127字
- 2021-07-08 09:47:20
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.
推薦閱讀
- Flask Web全棧開(kāi)發(fā)實(shí)戰(zhàn)
- FreeSWITCH 1.8
- SpringMVC+MyBatis快速開(kāi)發(fā)與項(xiàng)目實(shí)戰(zhàn)
- SQL Server 2012數(shù)據(jù)庫(kù)技術(shù)及應(yīng)用(微課版·第5版)
- ASP.NET Core Essentials
- INSTANT Weka How-to
- Android 7編程入門(mén)經(jīng)典:使用Android Studio 2(第4版)
- Learning Unity 2D Game Development by Example
- 機(jī)器學(xué)習(xí)與R語(yǔ)言實(shí)戰(zhàn)
- Creating Stunning Dashboards with QlikView
- 圖數(shù)據(jù)庫(kù)實(shí)戰(zhàn)
- Orleans:構(gòu)建高性能分布式Actor服務(wù)
- 一步一步跟我學(xué)Scratch3.0案例
- PHP與MySQL權(quán)威指南
- Clojure Polymorphism