• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Process exit notifcation in a kext
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Process exit notifcation in a kext


  • Subject: Re: Process exit notifcation in a kext
  • From: Michael Smith <email@hidden>
  • Date: Thu, 17 Jun 2010 08:57:40 -0700


On Jun 17, 2010, at 4:05 AM, Bogdan Harjoc wrote:

On Thu, Jun 17, 2010 at 12:55 AM, Terry Lambert <email@hidden> wrote:
On Jun 16, 2010, at 2:22 AM, Bogdan Harjoc wrote:
Generally speaking, the kernel, including any KEXTs you write, exists to
provide services for processes.  Processes do not exist to provide
notifications or events to the kernel.

Makes sense. Since the KEXT already depends on a daemon to filter the
events, collecting the events using kqueue would require little extra
effort, if it were reliable. But as Wade suggested, I'll just submit
an enhancement request for process startup/exit notifications.

You should build a system that isn't dependent on this.

In the mean time, I'd like to ask is this approach is correct: call
proc_find(pid) which takes a reference to the proc_t, and then
proc_rele(pid) when the exit notification from kqueue comes. This
avoids the race, but will the process exit while I am holding a
reference to it ?

You should not hold a long-term reference on the process.

Your design will probably be better if you avoid state; keep a cache of recent activity hashed by PID, then periodically push the cache to your daemon.  This lets you consolidate information so that your user/kernel communications are effective, but moves the responsibility of tracking PIDs out to userspace.

The daemon separately can track process lifecycles using kqueue, and associate cache entries from the kext with its own record of PID activity.

 = Mike

--
True terror is to wake up one morning and discover that your high school class is running the country. -- Kurt Vonnegut







 _______________________________________________
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

References: 
 >Process exit notifcation in a kext (From: Bogdan Harjoc <email@hidden>)
 >Re: Process exit notifcation in a kext (From: Terry Lambert <email@hidden>)
 >Re: Process exit notifcation in a kext (From: Bogdan Harjoc <email@hidden>)

  • Prev by Date: Re: Process exit notifcation in a kext
  • Next by Date: Re: Process exit notifcation in a kext
  • Previous by thread: Re: Process exit notifcation in a kext
  • Next by thread: Re: Process exit notifcation in a kext
  • Index(es):
    • Date
    • Thread