[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 2

reboot Subroutine


Restarts the system.


Standard C Library (libc.a)


#include <sys/reboot.h>

void reboot ( HowTo, Argument)
int HowTo;
void *Argument;


The reboot subroutine restarts or re-initial program loads (IPL) the system. The startup is automatic and brings up /unix in the normal, nonmaintenance mode.

The routine may coredump instead of returning EFAULT when an invalid pointer is passed in case of 64-bit application calling 32-bit kernel interface.

The calling process must have root user authority in order to run this subroutine successfully.

Attention: Users of the reboot subroutine are not portable. The reboot subroutine is intended for use only by the halt, reboot, and shutdown commands.


HowTo Specifies one of the following values:
Soft IPL.
Halt operator; turn the power off.
Halt operator; turn the power off. Wait a specified length of time, and then turn the power on.

Argument Specifies the amount of time (in seconds) to wait between turning the power off and turning the power on. This option is not supported on all models. Please consult your hardware technical reference for more details.

Return Values

Upon successful completion, the reboot subroutine does not return a value. If the reboot subroutine fails, a value of -1 is returned and the errno global variable is set to indicate the error.

Error Codes

The reboot subroutine is unsuccessful if any of the following is true:

EPERM The calling process does not have root user authority.
EINVAL The HowTo value is not valid.
EFAULT The Argument value is not a valid address.

Related Information

The halt command, reboot command, shutdown command.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]