104 lines
2.5 KiB
Groff
104 lines
2.5 KiB
Groff
'\"! tbl | mmdoc
|
|
'\"macro stdmacro
|
|
.if n .pH g2.uadmin @(#)uadmin 41.4 of 5/26/91
|
|
.nr X
|
|
.if \nX=0 .ds x} uadmin 2 "" "\&"
|
|
.if \nX=1 .ds x} uadmin 2 ""
|
|
.if \nX=2 .ds x} uadmin 2 "" "\&"
|
|
.if \nX=3 .ds x} uadmin "" "" "\&"
|
|
.TH \*(x}
|
|
.SH NAME
|
|
\f4uadmin\f1 \- administrative control
|
|
.SH SYNOPSIS
|
|
\f4#include <sys/uadmin.h>\f1
|
|
.PP
|
|
\f4int uadmin(int cmd, int fcn, int mdep);\f1
|
|
.SH DESCRIPTION
|
|
\f4uadmin\fP
|
|
provides control for basic administrative functions.
|
|
This system call is tightly coupled to the system administrative procedures
|
|
and is not intended for general use.
|
|
The argument
|
|
.I mdep
|
|
is provided for machine-dependent use and is not defined here.
|
|
.PP
|
|
As specified by
|
|
.IR cmd ,
|
|
the following commands are available:
|
|
.PP
|
|
.TP 15
|
|
\f4A_SHUTDOWN\fP
|
|
The system is shut down.
|
|
All user processes are killed, the buffer cache is flushed, and the root
|
|
file system (and no other) is unmounted.
|
|
The action to be taken after the system has been shut down is specified by
|
|
.IR fcn .
|
|
The functions are generic;
|
|
the hardware capabilities vary on
|
|
specific machines.
|
|
.RS 15
|
|
.TP 12
|
|
\f4AD_HALT\fP
|
|
Halt the system.
|
|
.TP
|
|
\f4AD_BOOT\fP
|
|
Reboot the system.
|
|
.TP
|
|
\f4AD_IBOOT\fP
|
|
Interactive reboot; the system goes to firmware mode and
|
|
the user is prompted for bootable program name.
|
|
Not supported; it is treated the same as \f4AD_HALT.
|
|
.TP
|
|
\f4AD_POWEROFF\fP
|
|
Halt the processor and turn off the power with \f4A_REBOOT\fP or
|
|
\f4A_SHUTDOWN\fP. With \f4A_SETFLAG\fP, simply sets the flag so that
|
|
a subsequent \f4A_SHUTDOWN\fP or \f4A_REBOOT\fP also powers off.
|
|
.RE
|
|
.TP 15
|
|
\f4A_REBOOT\fP
|
|
The system stops immediately without any further processing.
|
|
The action to be taken next is specified by
|
|
.I fcn
|
|
as above.
|
|
.TP
|
|
\f4A_REMOUNT\fP
|
|
The root file system is mounted again after having been fixed.
|
|
This should be used only during the startup process.
|
|
.TP
|
|
\f4A_KILLALL\fP
|
|
All processes are killed except those
|
|
belonging to the process group specified by
|
|
.IR fcn .
|
|
They are sent the signal specified by
|
|
.IR mdep .
|
|
.TP
|
|
\f4A_SETFLAG\fP
|
|
Set a flag to control later actions. Currently implemented
|
|
only for \f4AD_POWEROFF\fP.
|
|
.PP
|
|
\f4uadmin\fP
|
|
fails if any of the following are true:
|
|
.TP 15
|
|
\f4EPERM\fP
|
|
The calling process does not have super-user privilege.
|
|
.SH DIAGNOSTICS
|
|
Upon successful completion, the value returned depends on
|
|
.I cmd
|
|
as follows:
|
|
.PP
|
|
.RS
|
|
.TS
|
|
l l.
|
|
\f4A_SHUTDOWN\fP Never returns.
|
|
\f4A_REBOOT\fP Never returns.
|
|
\f4A_REMOUNT\fP 0
|
|
\f4A_KILLALL\fP 0
|
|
.TE
|
|
.RE
|
|
.PP
|
|
Otherwise, a value of \-1 is returned and
|
|
\f4errno\fP
|
|
is set to indicate the error.
|
|
.SH SEE ALSO
|
|
syssgi(2), uadmin(1).
|