Re: detecting process termination in kernel?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com On Tue, 1 Apr 2008, Terry Lambert wrote: For the process related stuff (something NFSv4 calls OpenOwners), I also keep track of the process's creation time, so that recycled pids don't cause grief. (I seem to recall getting the process's creation time isn't a kpi call, so it is one of the places my Kext has to "cheat". It's an open source experimental project, so I'm confortable with that.) rick _______________________________________________ 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... [good stuff snipped] 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 Good point. It works ok for my case because all I want to do is some garbarge collection cleanup after the process is gone, so false positives simply delay that. I just create a kernel thread that loops around, sleeping for a fraction of a second and then does proc_find(), so the false positive won't occur unless the system is creating lots'a'processes anyhow. Obviously not necessarily the case for other Kexts. This email sent to site_archiver@lists.apple.com
participants (1)
-
Rick Macklem