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

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -