reboot

OS/161 Reference Manual

Name

reboot - reboot or halt system

Library

Standard C Library (libc, -lc)

Synopsis

#include <unistd.h>

int
reboot(int code);

Description

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.

Return Values

On success, reboot does not return. On error, -1 is returned, and errno is set according to the error encountered.

Errors

The following error codes should be returned under the conditions given. Other error codes may be returned for other errors not mentioned here.
  
EINVAL code was not a valid value.
EPERM The current process does not have sufficient privilege to halt the system.