uadmin(S) 6 January 1993 uadmin(S) Name uadmin - administrative control Syntax cc . . . -lc #include <sys/uadmin.h> #include <prototype.h> int uadmin (cmd, fcn, mdep) int cmd, fcn; char *mdep; Description The uadmin system call provides control for basic administrative func- tions. This system call is tightly coupled to the system administrative procedures and is not intended for general use. The argument mdep is provided for machine-dependent use and is not defined except for the AGETDEV command. As specified by cmd, the following commands are available: AGETDEV Gets the major number of a block or character device named in mdep. Set fcn to b for block devices or to c for char- acter devices. mdep is the two- to four-character device driver prefix name. These names are listed in the fourth column of the /etc/conf/cf.d/mdevice file. If mdep is not specified, this message displays: A_GETDEV requires the mdep argument. An example call is: uadmin(AGETDEV, b, hd). This call gets the block major device number for the hard disk de- vice driver. ASHUTDOWN The system is shutdown. 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 ma- chines. ADHALT Halt the processor until a key is entered to reboot the system. ADBOOT Interactive reboot; user is prompted for sys- tem name. ADIBOOT Interactive reboot; user is prompted for sys- tem name. ADPWRDOWN Halt the processor; system remains down with no reboot option given. AREBOOT The system stops immediately without any further pro- cessing. The action to be taken next is specified by fcn as above. AREMOUNT The root file system is mounted again after having been fixed. This should be used only during the startup pro- cess. ASETCONFIG Sets the system configuration. Currently, only the fol- lowing function is available: ADPANICBOOT If mdep is 1, this function causes the machine to reboot automatically after a kernel panic. If mdep is 0, this function causes the machine to wait for user intervention at the console before rebooting after a kernel panic. The uadmin system call fails if any of the following is true: [EPERM] The effective user ID is not super user. Diagnostics Upon successful completion, the value returned depends on cmd as follows: A_GETDEV Major number of specified device A_SHUTDOWN No return value A_REBOOT No return value A_REMOUNT 0 A_SETCONFIG 0 Otherwise, a value of -1 is returned, and errno is set to indicate the error. Standards conformance The uadmin routine is an extension of AT&T System V provided by The Santa Cruz Operation.