Re: detecting process termination in kernel?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com -- Terry _______________________________________________ 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... 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. This is probably not useful for you, since wanting to know about processes other than processes with which you've already established a communications channel generally means you don't really want to solve the problem you are trying to solve by monitoring user space processes. Also, proc_find() can return false positives, so you will not want to poll either; there are a finite number of PIDs available, and eventually they get recycled. If you are trying to do something by PID, then you are probably also not doing what you want to do , since having a PID is not necessarily the same as having a unique identifier for a process. This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert