Re: Shutdown from a KEXT
Re: Shutdown from a KEXT
- Subject: Re: Shutdown from a KEXT
- From: Eric Gouriou <email@hidden>
- Date: Thu, 29 Apr 2010 23:29:14 -0700
On Apr 29, 2010, at 9:05 PM, Terry Lambert wrote:
> On Apr 29, 2010, at 7:51 PM, Andrew James wrote:
>> Hi Guys,
>>
>> I'm trying to initiate a forced shutdown from inside a KEXT, this is
>> to meet certain requirements of a piece of hardware.
>>
>> The only solutions I've found was to pass a signal to a application
>> which then uses APIs not available to KEXTs.
>>
>> Does anyone have a better solutions? I would prefer it to be
>> integrated into a single KEXT
>
> You can not do this. launchd is responsible for the orderly shutdown of they system.
It's even worse than that. launchd is only capable of performing orderly shutdown of the "Unix-y side" of the world. Cocoa/Carbon/Java/... Applications are not expected to or typically coded to handle a SIGTERM. loginwindow takes care of performing application terminations, then tells launchd to proceed.
Hence while invoking shutdown / reboot might work, there is a good chance that data loss will occur at the upper levels.
Eric
>
> For a disorderly shutdown, there's always:
>
> panic("I can't shut down the system from a KEXT, so I am calling panic instead");
>
> 8-)
>
> -- Terry
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden