[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rebooting from %pre



Digging through the archives I found several people who had tried the same
thing I was trying to do (reboot from %pre), but nobody who had made it work,
so I submit for the archives my solution, to save future searchers from the
hassle...

#include <sys/reboot.h>

int main(int argc, char **argv) {
    reboot(RB_AUTOBOOT);
}

This thing doesn't sync your disks or kill your processes or anything nice
like that, it's the digital equivalent of an ice pick through the brain, so
be careful if you intend to use it in an environment where the data on the
disks matters...

-- 
Jason Kohles                         A witty saying proves nothing.
email jasonkohles com                   -- Voltaire (1694 - 1778)
http://www.jasonkohles.com/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]