Re: Kqueues and fork

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Mon, 25 Aug 2025 14:59:17 UTC
On 8/21/25 03:45, Konstantin Belousov wrote:
> Process notes should be easier, there mostly the pids need fixing.

This note jumped out at me (and EVFILT_PROC is one of the filters I think has
the potential to not be straightfoward with fork()).  What cases do you
envision rewriting PIDs?  It's not clear to me that there are obvious cases
(other than perhaps self-referential) where the child wants the PID to
change.  I can even imagine cases where an application might not want
self-referential filters to change (e.g. a forking daemon might in the presence
of forking kqueues register an EVFILT_PROC on its own pid in the parent as
part of a "template" kqueue so that all children will get an event if the main
parent process dies).

-- 
John Baldwin