I have a Qt 4 GUI where I need to have a option in a drop-down menu that allows the user to choose to restart the computer. I realize this might seem redunant with the ability t
The reboot function is described in the Linux Programmer's Manual. Under glibc, you can pass the RB_AUTOBOOT macro constant to perform the reboot.
reboot
RB_AUTOBOOT
Note that if reboot is not preceded by a call to sync, data may be lost.
sync
Using glibc in Linux:
#include #include sync(); reboot(RB_AUTOBOOT);