2005-05-02 15:01:42 +02:00
|
|
|
.TH REBOOT 2
|
|
|
|
.SH NAME
|
|
|
|
reboot \- close down the system or reboot
|
|
|
|
.SH SYNTAX
|
|
|
|
.ft B
|
|
|
|
.nf
|
2013-02-25 12:48:26 +01:00
|
|
|
#define _NETBSD_SOURCE 1
|
2005-05-02 15:01:42 +02:00
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2012-11-22 17:30:22 +01:00
|
|
|
int reboot(int \fIhow\fP)
|
2005-05-02 15:01:42 +02:00
|
|
|
.fi
|
|
|
|
.ft P
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.B Reboot()
|
|
|
|
is used to close down the system. It allows several ways of shutting
|
|
|
|
down depending on
|
|
|
|
.IR how :
|
|
|
|
.PP
|
|
|
|
.TP 5
|
2012-11-22 17:30:22 +01:00
|
|
|
.BI "reboot(RBT_DEFAULT)"
|
|
|
|
Default shut-down action, the same as used when CTRL+ALT+DEL is pressed
|
|
|
|
on the keyboard.
|
2005-05-02 15:01:42 +02:00
|
|
|
.TP
|
2012-11-22 17:30:22 +01:00
|
|
|
.BI "reboot(RBT_HALT)"
|
|
|
|
Halt the system.
|
2005-05-02 15:01:42 +02:00
|
|
|
.TP
|
|
|
|
.BI "reboot(RBT_PANIC)"
|
|
|
|
Cause a system panic. This is not normally done from user mode, but by
|
|
|
|
servers using the
|
|
|
|
.B sys_abort()
|
|
|
|
kernel call.
|
|
|
|
.TP
|
2012-11-22 17:30:22 +01:00
|
|
|
.BI "reboot(RBT_POWEROFF)"
|
|
|
|
Power off the system if possible, reset otherwise.
|
|
|
|
.TP
|
|
|
|
.BI "reboot(RBT_REBOOT)"
|
|
|
|
Reboot the system with a software reset (currently not supported, so
|
|
|
|
a hardware reset is used).
|
2005-05-02 15:01:42 +02:00
|
|
|
.TP
|
|
|
|
.BI "reboot(RBT_RESET)"
|
|
|
|
Reboot the system with a hardware reset.
|
|
|
|
.PP
|
|
|
|
.B Reboot()
|
|
|
|
may only be executed by the super-user.
|
|
|
|
.SH DIAGNOSTICS
|
|
|
|
If the call succeeds, it never returns. If something went wrong,
|
|
|
|
the return value is -1 and an error is indicated by
|
|
|
|
.BR errno .
|
|
|
|
.SH SEE ALSO
|
|
|
|
.BR shutdown (8),
|
|
|
|
.BR reboot (8),
|
|
|
|
.BR halt (8),
|
|
|
|
.BR sync (2).
|
|
|
|
.SH AUTHOR
|
|
|
|
Edvard Tuinder (v892231@si.hhs.NL)
|