Hello all, I would like to know if there is any kernel mechanism to change the runlevel of my machine. I am working on a -sort of- watchdog module and would like to be able to nicely reboot my machine if any process does not refresh it (as if I gave a "shutdown -r now" command). Is there such a way? I have tried machine_restart(NULL), but it does a "hard" reboot. Also, I am very interested on being able to retreive current system time in a human-readable form (YY/MM/DD hh:mm:ss). Is is possible to do so within kernel space? If not, maybe someone could give some hint on how to do it using "gettimeofday and friends" functions. That is all. Thanks in advance for the help, Miguel -- ---------------------------------- | Miguel Garcia Lopez | | Research and Development | |----------------------------------| | Visual Tools S.A. | | Isla Graciosa, 1 | | 28034 Madrid | | SPAIN | | Tel: +34 91 7294844 (Ext. 205) | | Fax: +34 91 3585236 | |----------------------------------| | email: miguelgl@visual-tools.com | | http://www.visual-tools.com/ | ---------------------------------- -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ IRC Channel: irc.openprojects.net / #kernelnewbies Web Page: http://www.kernelnewbies.org/