I need to find out if my daemon was launched after a restart or
during the normal install. Basically I need to now if a machine was
restarted.
I thought IORegisterForSystemPower would do this but I do not get the
kIOMessageSystemWillRestart message.
Here is my code that registers for the notification.
gRootPort=IORegisterForSystemPower
(0,¬ify,SystemPowerChangedCallback,&anIterator);
if (gRootPort) CFRunLoopAddSource(CFRunLoopGetCurrent
(),IONotificationPortGetRunLoopSource(notify),kCFRunLoopDefaultMode);
I do get kIOMessageCanSystemSleep when the system is put to sleep.
It could be that my daemon gets killed before I get the
kIOMessageSystemWillRestart message.
Is there a better way to find out if the machine is restarted?
Thanks,
Martin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden