reboot - reboot or halt system
Standard C Library (libc, -lc)
#include <unistd.h>
int
reboot(int code);
reboot reboots or shuts down the system. The specific action depends on the code passed:
RB_REBOOT | The system is rebooted. | |
RB_HALT | The system is halted. | |
RB_POWEROFF | The system is powered off. |
On success, reboot does not return. On error, -1 is returned, and errno is set according to the error encountered.
The following error codes should be returned under the conditions given. Other error codes may be returned for other cases not mentioned here.
EINVAL | code was not a valid value. | |
EPERM | The current process does not have sufficient privilege to halt the system. |