Go to main content

man pages section 3: Basic Library Functions

Exit Print View

Updated: Wednesday, July 27, 2022



reboot - reboot system or halt processor


#include <sys/reboot.h>

int reboot(int howto, char *bootargs);


The reboot() function reboots the system. The howto argument specifies the behavior of the system while rebooting and is a mask constructed by a bitwise-inclusive-OR of flags from the following list:


The machine is rebooted from the root filesystem on the default boot device. This is the default behavior. See boot(8) and kernel(8).


The processor is simply halted; no reboot takes place. This option should be used with caution.


Interpreted by the bootstrap program and kernel, causing the user to be asked for pathnames during the bootstrap.


The system is forced to panic immediately without any further processing and a crash dump is written to the dump device (see dumpadm(8)) before rebooting.

Any other howto argument causes the kernel file to boot.

The interpretation of the bootargs argument is platform-dependent.

Return Values

Upon successful completion, reboot() never returns. Otherwise, −1 is returned and errno is set to indicate the error.


The reboot() function will fail if:


The {PRIV_SYS_CONFIG} privilege is not asserted in the effective set of the calling process.

See Also

uadmin(2), boot(8), dumpadm(8), halt(8), init(8), Intro(8), kernel(8), reboot(8)