git: 0e3a044e4c4b - stable/15 - kqueue.2: document EVFILT_PROCDESC support for NOTE_FORK
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 16 Aug 2026 02:47:05 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=0e3a044e4c4b0af4f25db6695d9340a7a7e57c2d
commit 0e3a044e4c4b0af4f25db6695d9340a7a7e57c2d
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-07-17 05:38:57 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-08-16 02:41:33 +0000
kqueue.2: document EVFILT_PROCDESC support for NOTE_FORK
(cherry picked from commit 3f88f6b89942a7f3aa6bb682b02b7307d060b52f)
---
lib/libsys/kqueue.2 | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/lib/libsys/kqueue.2 b/lib/libsys/kqueue.2
index 5e0b80280a81..1ac337e78b38 100644
--- a/lib/libsys/kqueue.2
+++ b/lib/libsys/kqueue.2
@@ -598,6 +598,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