8815 mega_sas: variable set but not used
[unleashed.git] / usr / src / man / man2 / uadmin.2
blob111b962dfdaec199e0b163f422e8cca7d79414eb
1 '\" te
2 .\" Copyright (c) 2009, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" 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.
5 .\"  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
6 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH UADMIN 2 "Mar 25, 2009"
8 .SH NAME
9 uadmin \- administrative control
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/uadmin.h>
15 \fBint\fR \fBuadmin\fR(\fBint\fR \fIcmd\fR, \fBint\fR \fIfcn\fR, \fBuintptr_t\fR \fImdep\fR);
16 .fi
18 .SH DESCRIPTION
19 .sp
20 .LP
21 The \fBuadmin()\fR function provides control for basic administrative
22 functions. This function is tightly coupled to the system administrative
23 procedures and is not intended for general use. The argument \fImdep\fR is
24 provided for machine-dependent use and is not defined here. It should be
25 initialized to \fINULL\fR if not used.
26 .sp
27 .LP
28 As specified by \fIcmd\fR, the following commands are available:
29 .sp
30 .ne 2
31 .na
32 \fB\fBA_SHUTDOWN\fR\fR
33 .ad
34 .RS 14n
35 The system is shut down. All user processes are killed, the buffer cache is
36 flushed, and the root file system is unmounted. The action to be taken after
37 the system has been shut down is specified by \fIfcn\fR. The functions are
38 generic; the hardware capabilities vary on  specific machines.
39 .sp
40 .ne 2
41 .na
42 \fB\fBAD_HALT\fR\fR
43 .ad
44 .RS 17n
45 Halt the processor(s).
46 .RE
48 .sp
49 .ne 2
50 .na
51 \fB\fBAD_POWEROFF\fR\fR
52 .ad
53 .RS 17n
54 Halt the processor(s) and turn off the power.
55 .RE
57 .sp
58 .ne 2
59 .na
60 \fB\fBAD_BOOT\fR\fR
61 .ad
62 .RS 17n
63 Reboot the system, using the kernel file.
64 .RE
66 .sp
67 .ne 2
68 .na
69 \fB\fBAD_IBOOT\fR\fR
70 .ad
71 .RS 17n
72 Interactive reboot; user is prompted for bootable program name.
73 .RE
75 .sp
76 .ne 2
77 .na
78 \fB\fBAD_FASTREBOOT\fR\fR
79 .ad
80 .RS 17n
81 Bypass BIOS and boot loader
82 .RE
84 .RE
86 .sp
87 .ne 2
88 .na
89 \fB\fBA_REBOOT\fR\fR
90 .ad
91 .RS 14n
92 The system stops immediately without any further processing. The action to be
93 taken next is specified by \fIfcn\fR as above.
94 .RE
96 .sp
97 .ne 2
98 .na
99 \fB\fBA_DUMP\fR\fR
101 .RS 14n
102 The system is forced to panic immediately without any further processing and a
103 crash dump is written to the dump device (see \fBdumpadm\fR(1M)).  The action
104 to be taken next is specified by \fIfcn\fR, as above.
108 .ne 2
110 \fB\fBA_REMOUNT\fR\fR
112 .RS 14n
113 The root file system is mounted again after having been fixed. This should be
114 used only during the startup process.
118 .ne 2
120 \fB\fBA_FREEZE\fR\fR
122 .RS 14n
123 Suspend the whole system.  The system state is preserved in the state file. The
124 following subcommands, specified by \fIfcn\fR, are available.
126 .ne 2
128 \fB\fBAD_SUSPEND_TO_DISK\fR\fR
130 .sp .6
131 .RS 4n
132 Save the system state to the state file. This subcommand is equivalent to ACPI
133 state S4.
137 .ne 2
139 \fB\fBAD_CHECK_SUSPEND_TO_DISK\fR\fR
141 .sp .6
142 .RS 4n
143 Check if your system supports suspend to disk. Without performing a system
144 suspend/resume, this subcommand checks if this feature is currently available
145 on your system.
149 .ne 2
151 \fB\fBAD_SUSPEND_TO_RAM\fR\fR
153 .sp .6
154 .RS 4n
155 Save the system state to memory This subcommand is equivalent to ACPI state S3.
159 .ne 2
161 \fB\fBAD_CHECK_SUSPEND_TO_RAM\fR\fR
163 .sp .6
164 .RS 4n
165 Check if your system supports suspend to memory. Without performing a system
166 suspend/resume, this subcommand checks if this feature is currently available
167 on your system.
170 The following subcommands, specified by \fIfcn\fR, are obsolete and might be
171 removed in a subsequent release:
173 .ne 2
175 \fB\fBAD_COMPRESS\fR\fR
177 .sp .6
178 .RS 4n
179 Save the system state to the state file with compression of data. This
180 subcommand has been replaced by \fBAD_SUSPEND_TO_DISK\fR, which should be used
181 instead.
185 .ne 2
187 \fB\fBAD_CHECK\fR\fR
189 .sp .6
190 .RS 4n
191 Check if your system supports suspend and resume.  Without performing a  system
192 suspend/resume, this command checks if this feature is currently available on
193 your system. This subcommand has been replaced by
194 \fBAD_CHECK_SUSPEND_TO_DISK\fR, which should be used instead.
198 .ne 2
200 \fB\fBAD_FORCE\fR\fR
202 .sp .6
203 .RS 4n
204 Force \fBAD_COMPRESS\fR even when threads of user applications are not
205 suspendable. This subcommand should never be used, as it might result in
206 undefined behavior.
211 .SH RETURN VALUES
214 Upon successful completion, the value returned depends on \fIcmd\fR as follows:
216 .ne 2
218 \fB\fBA_SHUTDOWN\fR\fR
220 .RS 14n
221 Never returns.
225 .ne 2
227 \fB\fBA_REBOOT\fR\fR
229 .RS 14n
230 Never returns.
234 .ne 2
236 \fB\fBA_FREEZE\fR\fR
238 .RS 14n
239 \fB0\fR upon resume.
243 .ne 2
245 \fB\fBA_REMOUNT\fR\fR
247 .RS 14n
248 \fB0\fR.
253 Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the
254 error.
255 .SH ERRORS
258 The \fBuadmin()\fR function will fail if:
260 .ne 2
262 \fB\fBEBUSY\fR\fR
264 .RS 11n
265 Suspend is already in progress.
269 .ne 2
271 \fB\fBEINVAL\fR\fR
273 .RS 11n
274 The \fIcmd\fR argument is invalid.
278 .ne 2
280 \fB\fBENOMEM\fR\fR
282 .RS 11n
283 Suspend/resume ran out of physical memory.
287 .ne 2
289 \fB\fBENOSPC\fR\fR
291 .RS 11n
292 Suspend/resume could not allocate enough space on the root file system to store
293 system information.
297 .ne 2
299 \fB\fBENOTSUP\fR\fR
301 .RS 11n
302 Suspend/resume is not supported on this platform or the command specified by
303 \fIcmd\fR is not allowed.
307 .ne 2
309 \fB\fBENXIO\fR\fR
311 .RS 11n
312 Unable to successfully suspend system.
316 .ne 2
318 \fB\fBEPERM\fR\fR
320 .RS 11n
321 The {\fBPRIV_SYS_CONFIG\fR} privilege is not asserted in the effective set of
322 the calling process.
325 .SH ATTRIBUTES
328 See \fBattributes\fR(5) for descriptions of the following attributes:
333 box;
334 c | c
335 l | l .
336 ATTRIBUTE TYPE  ATTRIBUTE VALUE
338 Interface Stability     See below.
343 The \fBA_FREEZE\fR command and its subcommands are Committed.
344 .SH SEE ALSO
347 \fBdumpadm\fR(1M), \fBhalt\fR(1M), \fBkernel\fR(1M), \fBreboot\fR(1M),
348 \fBuadmin\fR(1M), \fBattributes\fR(5), \fBprivileges\fR(5)
349 .SH WARNINGS
352 Shutting down or halting the system by means of \fBuadmin\fR(1M) does not
353 update the  boot  archive.  Avoid  using  this command after
354 .RS +4
356 .ie t \(bu
357 .el o
358 editing of files such as \fB/etc/system\fR
360 .RS +4
362 .ie t \(bu
363 .el o
364 installing new driver binaries or kernel binaries
366 .RS +4
368 .ie t \(bu
369 .el o
370 updating existing driver binaries or kernel binaries.
374 Use \fBreboot\fR(1M) or \fBhalt\fR(1M) instead.