#include <sys/reboot.h>
int reboot(int howto, char *bootargs);
reboot() reboots the system. howto is an option passed to specify the behaviour of the system while rebooting. The function interface permits only one of RB_HALT, RB_ASKNAME or RB_AUTOBOOT to be passed. RB_AUTOBOOT is the default.
The howto options are:
The interpretation of the bootargs argument is platform dependent.
If successful, this call never returns. Otherwise, a -1 is returned and an error is returned in the global variable errno.
Any other howto argument causes the kernel file to boot.
Only the super-user may reboot() a machine.