title: How to restart Linux from inside a C++ program?
body: <p>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 to restart the computer in other ways, but the choice needs to stay there. I've tried using system() to call the following:</p>
  
  <ol>
  <li>a suid-root shell script</li>
  <li>a non-suid shell script</li>
  <li>a suid-root binary program</li>
  </ol>
  
  <p>and all of them just cause <pre>reboot: must be superuser</pre> to be printed. Using system() to call reboot directly does the same thing. I'm not especially attached to using system() to do this, but it seemed like the most direct choice.</p>
  
  <p>How can I reboot the system from the GUI?</p>