在C 語言中使用 waitpid 函式監控子程序狀態 在基於 Unix 的系統中,有一個程序的概念,它只是一個程式的執行例項。該程序可以使用 fork 系統呼叫建立其他程序,並執行給定的部分程式碼。需要注意的是,在本專題中,系統呼叫是以 C 式函式的形式提供給使用者的作業系統服務。一般來說,在很多場景下,程式需要監視它...
3.specifies optional actions for the waitpid function. Either of the following option flags may be specified, or they can be combined with a bitwise inclusive OR operator: WNOHANG WUNTRACED WCONTINUED If successful, waitpid returns the process ID of the terminated process whose status was reported....