Page MenuHomeFreeBSD

EVFILT_PROCDESC: support NOTE_FORK
ClosedPublic

Authored by kib on Jul 17 2026, 5:41 AM.
Tags
None
Referenced Files
F168083831: D58292.id182152.diff
Wed, Aug 26, 7:29 AM
Unknown Object (File)
Sun, Aug 23, 7:30 AM
Unknown Object (File)
Thu, Aug 20, 4:45 AM
Unknown Object (File)
Fri, Aug 14, 3:35 PM
Unknown Object (File)
Wed, Aug 12, 6:54 PM
Unknown Object (File)
Mon, Aug 10, 9:42 AM
Unknown Object (File)
Mon, Aug 10, 9:41 AM
Unknown Object (File)
Mon, Aug 10, 9:40 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Jul 17 2026, 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.Jul 17 2026, 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.Jul 17 2026, 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.Jul 17 2026, 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.Jul 19 2026, 6:38 PM
kib marked 4 inline comments as done.

Edit comments and the man page update.

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