Re: How to tell if system shutdown is in process
Re: How to tell if system shutdown is in process
- Subject: Re: How to tell if system shutdown is in process
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Thu, 24 Mar 2011 09:14:05 +0000
On 24 Mar 2011, at 04:55, Brian Bergstrand wrote:
> Use IOKit, specifically, IORegisterForSystemPower(). In the callback you provide check for kIOMessageSystemWillPowerOff and kIOMessageSystemWillRestart.
In general IORegisterForSystemPower is fine. However, the header docs for these two events contain the text "Never delivered to user space notification clients.", leading me to believe that they won't work for a daemon. Probably worth a try though. QA1340 has code that you can easily adapt to create a simple test program.
<http://developer.apple.com/library/mac/#qa/qa1340/_index.html>
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
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