On Thursday, March 26, 2015 01:54:45 AM Sibananda Sahu wrote:
> My requirement is to know the exact reason of shutdown, whether is it a
> power-off or a reboot call.
>
> And I can get the information from the “howto” variable that is passed to
> the kern_reboot() function call, but this variable is local to
> kern_reboot() only.
It is passed to the shutdown_* eventhandlers. So if you register an
eventhandler
you can get the howto argument that way. ACPI uses this to power off the
machine
for a power off request for example:
static void
acpi_shutdown_final(void *arg, int howto)
{
...
if ((howto & RB_POWEROFF) != 0) {
status = AcpiEnterSleepStatePrep(ACPI_STATE_S5);
}
--
John Baldwin
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"