aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2026-07-17 05:38:57 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2026-07-19 20:39:29 +0000
commit3f88f6b89942a7f3aa6bb682b02b7307d060b52f (patch)
treef130d6c368889bd3cf868f78868712ce1174fd26
parente8d4d754e1c73b01c89580a26c22f982415c694a (diff)
-rw-r--r--lib/libsys/kqueue.235
1 files changed, 35 insertions, 0 deletions
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