site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com