Re: How to tell if system shutdown is in process
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=classicalguitar.net; h= subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s= classicalguitar.net; bh=zKXiCBc8zsiAIEr4cBWBFmbZUsI=; b=aTMnxrS0 4DtjSTfSPB7IyIZjcVuBfSHgjADaURzBNQtUeH0cbXsv5/0LHsWCXrf2kX6SJIcD tRFzrcSwbz3lXJCUZj+w3K9UvSlKekq7md4EP7TdJp6knW4tbXPXKO+txSKc5u+R 91m2VYVDlYQFjMeXUHCpalkIPhMR+2oOY1Y= Domainkey-signature: a=rsa-sha1; c=nofws; d=classicalguitar.net; h=subject :mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; q=dns; s= classicalguitar.net; b=HxGo+NMjCBeBgf7TAKWjX4LfhsUQRFqBGzZawdFf7 mBS4T1MPymUohRizVwp6Uom67N4XhzM619LNWoMpsbQP1bG4OjcDEYrXlg1ckoAE KNonzfxiwW7+hYCABD1TIo3ZSl+UHLzPVTym2sT/HXfjbXrgP6O6OffChaZPR2y2 dU= On Mar 24, 2011, at 4:14 AM, Quinn The Eskimo! wrote:
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.
I don't see that header doc in the 10.6 SDK (checked both the defines and IORegisterForSystemPower() itself). Where are you seeing it? _______________________________________________ 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
participants (1)
-
Brian Bergstrand