xref: /illumos-gate/usr/src/man/man3c/reboot.3c (revision bbf215553c7233fbab8a0afdf1fac74c44781867)
te
Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
REBOOT 3C "Mar 22, 2004"
NAME
reboot - reboot system or halt processor
SYNOPSIS

#include <sys/reboot.h>

int reboot(int howto, char *bootargs);
DESCRIPTION

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: RB_AUTOBOOT

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

RB_HALT

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

RB_ASKNAME

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

RB_DUMP

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.

ERRORS

The reboot() function will fail if: EPERM

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

SEE ALSO

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