-
Notifications
You must be signed in to change notification settings - Fork 829
pcntl_wait / pcntl_waitpid: Document the rusage parameter (fixes #861) #4917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pcntl_waitid already has the parameter documented. Can you align the explanation: https://www.php.net/manual/en/function.pcntl-waitid.php?
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for the example this LGTM. Perhaps it makes sense to split the example off in another PR?
| print "PARENT pcntl_waitpid: No exited children.\n"; | ||
| } else { | ||
| print "PARENT pcntl_waitpid: Child PID {$deadPid} exited with status: " | ||
| . pcntl_wexitstatus($status) ."\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation for wexitstatus says:
This function is only useful if pcntl_wifexited() returned true.
So, is a wifexited call missing here? Looking more carefully at the example, it uses quite a few functions from the pcntl extension. It might make sense to include it in https://www.php.net/manual/en/pcntl.example.php instead.
| &reftitle.examples; | ||
| <para> | ||
| <example> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useless wrapping para tag
| <varlistentry> | ||
| <term><parameter>resource_usage</parameter></term> | ||
| <listitem> | ||
| <para> | ||
| The <parameter>resource_usage</parameter> parameter is set to an | ||
| associative <type>array</type> containing resource usage statistics | ||
| from the child process. | ||
|
|
||
| This is supported either if the wait6 system call is available | ||
| (e.g. on FreeBSD), or on Linux through the raw waitid system call. For | ||
| information on the contents see <function>getrusage</function>. | ||
| </para> | ||
| </listitem> | ||
| </varlistentry> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering how often this is repeated, an XInclude or XML entity to have consistent wording would be better
No description provided.