The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3f88f6b89942a7f3aa6bb682b02b7307d060b52f
commit 3f88f6b89942a7f3aa6bb682b02b7307d060b52f Author: Konstantin Belousov <[email protected]> AuthorDate: 2026-07-17 05:38:57 +0000 Commit: Konstantin Belousov <[email protected]> CommitDate: 2026-07-19 20:39:29 +0000 kqueue.2: document EVFILT_PROCDESC support for NOTE_FORK Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58292 --- lib/libsys/kqueue.2 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/lib/libsys/kqueue.2 b/lib/libsys/kqueue.2 index cc46edc0a248..d2c6ed102f29 100644 --- a/lib/libsys/kqueue.2 +++ b/lib/libsys/kqueue.2 @@ -592,6 +592,41 @@ The events to monitor are: The process has exited. The exit status will be stored in .Va data . +.It Dv NOTE_FORK +The process has forked. +The process identifier +.Pq PID +of the most recently forked child is returned in the +.Va data +field. +.Pp +The identifier is advisory; +if several children were spawned before the event is returned, +only one of the PIDs is returned. +Other mechanisms provide reliable reporting of fork events. +For instance, debugging the process with a subscription for relevant +events would serialize forks. +See +.Xr ptrace 2 +and the description of the +.Dv PT_FOLLOW_FORK +request. +.Pp +Unlike the +.Dv EVFILT_PROC +filter, +the +.Dv NOTE_TRACK +pseudo-event is not supported. +.Pp +If both +.Dv NOTE_EXIT +and +.Dv NOTE_FORK +events are reported, then the +.Va data +field contains the exit status of the process, +and the last child's PID is not returned. .It Dv NOTE_PDSIGCHLD Activates on events that are reported through .Xr pdwait 2
