Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
Copyright 1989 AT&T
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]
#include <sys/uadmin.h> int uadmin(int cmd, int fcn, uintptr_t mdep);
The uadmin() function provides control for basic administrative functions. This function 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 here. It should be initialized to NULL if not used.
As specified by cmd, the following commands are available: 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(s).
Halt the processor(s) and turn off the power.
Reboot the system, using the kernel file.
Interactive reboot; user is prompted for bootable program name.
Bypass BIOS and boot loader
The system stops immediately without any further processing. The action to be taken next is specified by fcn as above.
The system is forced to panic immediately without any further processing and a crash dump is written to the dump device (see dumpadm(8)). The action to be taken next is specified by fcn, as above.
The root file system is mounted again after having been fixed. This should be used only during the startup process.
Suspend the whole system. The system state is preserved in the state file. The following subcommands, specified by fcn, are available. AD_SUSPEND_TO_DISK
Save the system state to the state file. This subcommand is equivalent to ACPI state S4.
Check if your system supports suspend to disk. Without performing a system suspend/resume, this subcommand checks if this feature is currently available on your system.
Save the system state to memory This subcommand is equivalent to ACPI state S3.
Check if your system supports suspend to memory. Without performing a system suspend/resume, this subcommand checks if this feature is currently available on your system.
Save the system state to the state file with compression of data. This subcommand has been replaced by AD_SUSPEND_TO_DISK, which should be used instead.
Check if your system supports suspend and resume. Without performing a system suspend/resume, this command checks if this feature is currently available on your system. This subcommand has been replaced by AD_CHECK_SUSPEND_TO_DISK, which should be used instead.
Force AD_COMPRESS even when threads of user applications are not suspendable. This subcommand should never be used, as it might result in undefined behavior.
Upon successful completion, the value returned depends on cmd as follows: A_SHUTDOWN
Never returns.
Never returns.
0 upon resume.
0.
Otherwise, -1 is returned and errno is set to indicate the error.
The uadmin() function will fail if: EBUSY
Suspend is already in progress.
The cmd argument is invalid.
Unable to successfully suspend system.
The {PRIV_SYS_CONFIG} privilege is not asserted in the effective set of the calling process.
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Interface Stability See below. |
The A_FREEZE command and its subcommands are Committed.
attributes (7), privileges (7), dumpadm (8), halt (8), kernel (8), reboot (8), uadmin (8)
Shutting down or halting the system by means of uadmin(8) does not update the boot archive. Avoid using this command after
installing new driver binaries or kernel binaries
updating existing driver binaries or kernel binaries.
Use reboot(8) or halt(8) instead.