How to wait for exit of non-children processes

前端 未结 9 2422
生来不讨喜
生来不讨喜 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:26

    Since linux kernel 5.3 there is a pidfd_open syscall, which creates an fd for a given pid, which can be polled to get notification when pid has exited.

提交回复
热议问题