gcc and llvm linux shutdown function from c code -


linux x86-64 compiling , statically linking gcc have:

#include <sys/reboot.h>  if (str[0] == 'r')   reboot(0x1234567); 

but can't seem find equivalent function call shutdown. i'd know llvm function if different.

from sys/reboot.h :

/* perform hard reset now.  */ #define rb_autoboot     0x01234567  [...]  /* stop system , switch power off if possible.  */ #define rb_power_off    0x4321fedc 

so reboot(0x4321fedc); or reboot(rb_power_off); should work.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -