REBOOT(2) — HP-UX
Series 300, 800 Only
NAME
reboot − boot the system
SYNOPSIS
#include <sys/reboot.h>
int reboot (howto, device_file, filename)
int howto; char *device_file; char *filename;
DESCRIPTION
Reboot causes the system to be rebooted. Howto is a mask of reboot options (see <sys/reboot.h>). Only RB_HALT, RB_AUTOBOOT, RB_NOSYNC, RB_NEWDEVICE, and RB_NEWFILE are recognized options.
The howto options are:
RB_AUTOBOOT
A filesystem sync is performed (unless RB_NOSYNC is set) and the processor is rebooted from the default device and file.
RB_HALT
The processor is simply halted. A sync of the filesystem will be done unless the RB_NOSYNC flag is set. RB_HALT should be used with caution.
RB_NOSYNC
A sync of the filesystem is not to be performed.
RB_NEWDEVICE
The device_file argument to the system call is to be used as the filename of the device from which to reboot.
RB_NEWFILE
The filename argument to the system call is to be used as the name of the file to be rebooted.
Device_file specifies the device from which the reboot is to take place. Device_file must be a block or character special file name and is used only if the RB_NEWDEVICE option is set.
Filename specifies the name of the file to be rebooted (only used if the RB_NEWFILE option is set). This file will be loaded into memory by the bootstrap and control passed to it.
Only the super-user may reboot a machine.
ERRORS
Reboot will fail if the following is true:
[EPERM] The effective user id of the caller is not super-user.
DEPENDENCIES
Series 300 Diskless
On clustered systems, it is necessary to kill all general CSPs (see csp(1M)) as well as user processes before calling reboot(2).
Series 300
All user processes, except the calling process, must be killed before calling the reboot system call or the file system will not be marked clean, causing the system to require an fsck(1M) on reboot. Therefore, either the calling process must be invoked from a shell using exec or the calling process must kill the shell it was called from and send a signal to init(1M) to prevent it from respawning the killed process.
Filename must be one of the files listed by the boot rom at power up.
The default device and file for RB_AUTOBOOT are those from which the system was previously booted.
Series 800
The RB_NEWDEVICE and RB_NEWFILE options and the device_file and filename parameters are ignored.
The default file and device for RB_AUTOBOOT are /hp-ux on the current root device.
RETURN VALUE
If successful, this call never returns. Otherwise, a −1 is returned and an error is returned in the global variable errno.
AUTHOR
Reboot was developed by HP, and the University of California, Berkeley.
SEE ALSO
Hewlett-Packard Company — Version B.1, May 11, 2021