How to wait for exit of non-children processes

前端 未结 9 2372
生来不讨喜
生来不讨喜 2020-11-27 18:45

For child processes, the wait() and waitpid() functions can be used to suspends execution of the current process until a child has exited. But t

9条回答
  •  感情败类
    2020-11-27 19:43

    On BSDs and OS X, you can use kqueue with EVFILT_PROC+NOTE_EXIT to do exactly that. No polling required. Unfortunately there's no Linux equivalent.

提交回复
热议问题