Re: detecting process termination in kernel?
Re: detecting process termination in kernel?
- Subject: Re: detecting process termination in kernel?
- From: Andrew Gallatin <email@hidden>
- Date: Wed, 2 Apr 2008 08:03:10 -0400 (EDT)
Terry Lambert writes:
> On Mar 30, 2008, at 8:24 PM, Greg wrote:
> > Hi, given several process IDs, what are the different ways of
> > finding out (being notified, etc), of when a specific PID
> > terminates? I know that kqueues can be used in userland (with
> > EVFILT PROC), can they be used as well from a KEXT?
>
> If you are a KEXT, you typically export a device node and have the
> process open it. When the process terminates, the resource tracking
> close for the device node will be triggered as part of the process
> exit, which will notify you that it has gone away.
Except, of course, on some versions of MacOSX if you have wired
("prepared") any memory on behalf of the process via a cdevsw ioctl,
and it exits with the memory still wired. Then it will be stuck in a
zombie state where the cdevsw close is not called, but the process has
been removed from the process table, and pfind()/proc_find() can't
find it.
Drew
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden