Page MenuHomeFreeBSD

Document wait and process descriptor behavior.
ClosedPublic

Authored by oshogbo on Apr 23 2016, 11:26 PM.
Referenced Files
F103278880: D6080.diff
Sat, Nov 23, 12:08 AM
Unknown Object (File)
Wed, Nov 20, 3:06 AM
Unknown Object (File)
Tue, Nov 19, 12:09 AM
Unknown Object (File)
Mon, Nov 18, 9:01 PM
Unknown Object (File)
Fri, Nov 15, 7:15 PM
Unknown Object (File)
Mon, Nov 4, 1:55 PM
Unknown Object (File)
Fri, Nov 1, 3:17 PM
Unknown Object (File)
Oct 19 2024, 10:29 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

Lint
Lint Skipped
Unit
Tests Skipped

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

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

Maybe

Process descriptors can still be waited on using the process ID or descriptor (see
lib/libc/sys/wait.2
602

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

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

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

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

602

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

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

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

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

oshogbo added inline comments.
lib/libc/sys/wait.2
605

This sound better for me.

lib/libc/sys/wait.2
601

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.