DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

uadmin(S)


uadmin -- administrative control

Synopsis

   #include <sys/uadmin.h>
   

int uadmin(int cmd, int fcn, int mdep);

Description

uadmin 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 calling process must have the P_SYSOPS privilege.

The argument mdep is provided for machine-dependent use; for example, see A_SETCONFIG, below.

cmd can take on one of the following values:


A_SHUTDOWN
The system is shut down. All user processes are killed, the buffer cache is flushed, and the root file system is unmounted. The action to be taken after the system has been shut down is specified by fcn. The functions are generic; the hardware capabilities vary on specific machines.

AD_HALT
Halt the processor and turn off the power.

AD_BOOT
Reboot the system, using /stand/unix.

AD_IBOOT
Interactive reboot; the system goes to firmware mode and, if the user strikes any key while the system logo is displayed, the system prompts for a bootable program name. If fcn is not supplied or is invalid, AD_IBOOT is used as the default.

A_REBOOT
The system stops immediately without any further processing. The action to be taken next is specified by fcn as above.

A_REMOUNT
The root file system is mounted again after having been fixed. This should be used only during the startup process.

A_CLOCK
The argument fcn is the number of seconds to adjust the clock.

A_SETCONFIG
Currently this command supports the single function AD_PANICBOOT, which determines the system's behavior following a system panic. If mdep is 1, the system will automatically reboot following a panic; if mdep is 0, the system will remain in firmware mode following a panic.

Return values

If uadmin succeeds, it returns a value that depends on cmd as follows:

A_SHUTDOWN Never returns.
A_REBOOT Never returns.
A_REMOUNT 0
A_CLOCK 0
A_SETCONFIG 0

 A_SHUTDOWN    Never returns.
 A_REBOOT      Never returns.
 A_REMOUNT     0
 A_CLOCK       0
 A_SETCONFIG   0

If uadmin fails, it returns -1 and sets errno to identify the error.

Errors

uadmin fails if any of the following are true:

EPERM
The calling process does not have the P_SYSOPS privilege.

References

sysi86(S)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005