php / php-src

The PHP Interpreter
https://www.php.net
Other
37.87k stars 7.72k forks source link

Add pcntl_waitid, wrapping POSIX waitid #14616

Open vrza opened 2 months ago

vrza commented 2 months ago

Description

To round out the support for the "wait" family of functions, in addition to having pcntl_wait and pcntl_waitpid, we should add pcntl_waitid.

Here's the POSIX reference to waitid:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/waitid.html

The waitid() function shall obtain status information pertaining to termination, stop, and/or continue events in one of the caller's child processes

The status information struct is shared with sigwaitinfo, so code reuse between pcntl_sigwaitinfo and pcntl_waitid might be possible.

vrza commented 1 month ago

Code is merged to master, documentation PR needs more reviewers.