ShutDown Function for All Operating Systems

Hi, I'am Writing an App in C++/Qt to Plan ShutDown (or Reboot, Sleep, PowerOff..) in specific Time or Condition
the problem i get is that i didn't find a function that shutdown the PC in Mac OS X or X Window Systems (Linux, FreeBSD), i just have the Windows Function
please does anyone have a Library or some code that may help me,
in thanks for your attention
Can't you just do a shutdown or something from a terminal in Linux? Pretty sure your app needs root privileges though.

Apart from that I have no idea how to do it. =x
i 've already searched sth like this, but i 've found that each OS has it's own terminal Function, so it's surely won't help me(I need a unique Function)..
and thx for your help
The shutdown function is indeed different for each OS. I suggest you create your own and use #ifdef to do the right thing on each platform.
Topic archived. No new replies allowed.