MentOS  0.8.0
The Mentoring Operating System
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions
sys.c File Reference

Functions

static void machine_power_off (void)
 Powers off the machine.
 
static void kernel_power_off (void)
 Shutdown everything and perform a clean system power_off.
 
int sys_reboot (int magic1, int magic2, unsigned int cmd, void *arg)
 Reboots the system, or enables/disables the reboot keystroke. More...
 

Detailed Description

Function Documentation

◆ sys_reboot()

int sys_reboot ( int  magic1,
int  magic2,
unsigned int  cmd,
void *  arg 
)

Reboots the system, or enables/disables the reboot keystroke.

Parameters
magic1fails (with the error EINVAL) unless equals LINUX_REBOOT_MAGIC1.
magic2fails (with the error EINVAL) unless equals LINUX_REBOOT_MAGIC2.
cmdThe command to send to the reboot.
argArgument passed with some specific commands.
Returns
For the values of cmd that stop or restart the system, a successful call to reboot() does not return. For the other cmd values, zero is returned on success. In all cases, -1 is returned on failure, and errno is set appropriately.