Page MenuHomeFreeBSD

Document wait and process descriptor behavior.
ClosedPublic

Authored by oshogbo on Apr 23 2016, 11:26 PM.
Referenced Files
Unknown Object (File)
Sat, Apr 27, 6:21 PM
Unknown Object (File)
Sat, Apr 27, 6:02 PM
Unknown Object (File)
Jan 8 2024, 3:04 PM
Unknown Object (File)
Dec 26 2023, 6:36 PM
Unknown Object (File)
Dec 20 2023, 12:09 AM
Unknown Object (File)
Dec 16 2023, 7:37 AM
Unknown Object (File)
Dec 11 2023, 11:10 PM
Unknown Object (File)
Nov 30 2023, 10:58 PM
Subscribers

Details

Summary

Document wait and process descriptor behavior introduced in r286698.
When the wait*(2) syscalls wait for any process (P_ALL), they should ignore processes created with the pdfork(2) syscall.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

oshogbo retitled this revision from to Document wait and process descriptor behavior..
oshogbo updated this object.
oshogbo edited the test plan for this revision. (Show Details)
oshogbo added a reviewer: glebius.
oshogbo set the repository for this revision to rS FreeBSD src repository - subversion.
oshogbo added a project: manpages.
wblock added inline comments.
lib/libc/sys/wait.2
602 ↗(On Diff #15548)

This sentence looks not quite right, and it's hard to tell what it is saying. Maybe:

.Fn wait
waits for child processes, but ignores a child with process descriptors (see
.Xr pdfork 2 ) .
605 ↗(On Diff #15548)

Maybe

Process descriptors can still be waited on using the process ID or descriptor (see
lib/libc/sys/wait.2
602 ↗(On Diff #15548)

Thanks for help I'm not good at it ;( So what I was trying to say is that if we gave -1 as wait argument which means "wait for any child process" the process descriptors (which are still the child of the process) will be ignored. But you can still wait for process using it ID. If we write like you proposed I'm not sure if it will be understood that we mean only situation where we wait for any process..

lib/libc/sys/wait.2
602 ↗(On Diff #15548)

Still not quite clear on the explanation, but let me try again:

.Fn wait
called with -1 to wait for any child process will ignore child process descriptors (see
.Xr pdfork 2 ) .
Specific processes can still be waited on by specifying the process ID (see
.Xr pdwait 2 ).

Should that be pdwait4 ?

oshogbo edited edge metadata.
oshogbo removed rS FreeBSD src repository - subversion as the repository for this revision.
lib/libc/sys/wait.2
602 ↗(On Diff #15548)

Ok I changed it almost as you requested.
I also add sentence "or descriptor" the wait functions are used for waiting for process by pid, pdwiat will be (because it still not implemented, but already documented) used to wait for process using descriptor.

So basically process descriptors are process which have been created using pdfork. Such process not only have pid but also process descriptor (which is similar to file descriptor). The wait function can still be used with such process but you need to give him the PID of process. If you will gave -1 which means "wait for any" wait will ignore status of process descriptors. There is also plan to implement pdwait which will be similar to wait but instead of using PIDs you will use process descriptors.

lib/libc/sys/wait.2
600 ↗(On Diff #15612)

Please remove this leading "The" so it doesn't say "The wait() called ...".

602 ↗(On Diff #15548)

Please change

called with -1 to wait for any child process will ignore child with a process

to

called with -1 to wait for any child process will ignore a child with process
bjk added inline comments.
lib/libc/sys/wait.2
601 ↗(On Diff #15729)

Is the case in question when there is a process descriptor that is a handle for the child, or when the child holds process descriptors that are handles for grandchildren processes? The current text is a bit unclear.

oshogbo added inline comments.
lib/libc/sys/wait.2
601 ↗(On Diff #15729)

Sorry. For keep you waiting
When parent hold the process descriptor to child.
If you pdfork then wait(-1) will ignore it, if you pass the descriptor to the other process the child will be still ignored.

lib/libc/sys/wait.2
601 ↗(On Diff #15729)

Okay. How about "will ignore a child that is referenced by a process descriptor"?

oshogbo added inline comments.
lib/libc/sys/wait.2
605 ↗(On Diff #15548)

This sound better for me.

lib/libc/sys/wait.2
601 ↗(On Diff #15729)

Repeated word: "will will"

Every time when I'm in rush I make mistake...

wblock added a reviewer: wblock.

textproc/igor will locate repeated words and other mistakes. Just saying. :)

This revision is now accepted and ready to land.May 12 2016, 5:35 PM
This revision was automatically updated to reflect the committed changes.