Page MenuHomeFreeBSD

EVFILT_PROCDESC: support NOTE_FORK
ClosedPublic

Authored by kib on Fri, Jul 17, 5:41 AM.
Tags
None
Referenced Files
F164152108: D58292.id182243.diff
Wed, Jul 29, 4:48 AM
Unknown Object (File)
Mon, Jul 27, 9:44 AM
Unknown Object (File)
Mon, Jul 27, 8:57 AM
Unknown Object (File)
Mon, Jul 27, 7:46 AM
Unknown Object (File)
Sun, Jul 26, 12:12 AM
Unknown Object (File)
Sun, Jul 26, 12:09 AM
Unknown Object (File)
Sat, Jul 25, 7:31 PM
Unknown Object (File)
Sat, Jul 25, 7:27 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Fri, Jul 17, 5:41 AM
lib/libsys/kqueue.2
597
601
602

Also, if the process raises NOTE_EXIT, the last PID will be overwritten (but I think we will return NOTE_FORK | NOTE_EXIT).

605

Perhaps mention ptrace(2) explicitly?

sys/kern/sys_procdesc.c
521

Probably you want to kn->kn_flags &= ~NOTE_FORK here?

kib marked 5 inline comments as done.Fri, Jul 17, 1:57 PM
kib added inline comments.
sys/kern/sys_procdesc.c
521

Hm, no. I will explicitly mention that exit code is returned.

kib marked an inline comment as done.

Update the man page with the review comments.

sys/kern/sys_procdesc.c
521

(I meant kn->kn_fflags above of course.)

kib marked an inline comment as done.Fri, Jul 17, 2:11 PM
kib added inline comments.
sys/kern/sys_procdesc.c
521

I do want (need) to see NOTE_FORK in this situation.

kib marked an inline comment as done.

Report NOTE_FORK for procdesc after the child is attached to the debugger.

In D58292#1337327, @kib wrote:

Report NOTE_FORK for procdesc after the child is attached to the debugger.

I suggest adding a test for this, or at least a comment explaining why it is important.

lib/libsys/kqueue.2
597

since you use it below. Or write, The process identifier (PID) of the ...

605
606
kib marked 3 inline comments as done.Fri, Jul 17, 8:48 PM
In D58292#1337327, @kib wrote:

Report NOTE_FORK for procdesc after the child is attached to the debugger.

I suggest adding a test for this, or at least a comment explaining why it is important.

I added the comment. truss(1) in the cap mode is the practical test.

Add comment for the placement of NOTE_FORK activation.
Edit the man page.

markj added inline comments.
lib/libsys/kqueue.2
629
sys/kern/kern_fork.c
830
832
833
This revision is now accepted and ready to land.Sun, Jul 19, 6:38 PM
kib marked 4 inline comments as done.

Edit comments and the man page update.

This revision now requires review to proceed.Sun, Jul 19, 6:50 PM
This revision was not accepted when it landed; it landed in state Needs Review.Sun, Jul 19, 8:41 PM
This revision was automatically updated to reflect the committed changes.