1uadmin(2)                        System Calls                        uadmin(2)
2
3
4

NAME

6       uadmin - administrative control
7

SYNOPSIS

9       #include <sys/uadmin.h>
10
11       int uadmin(int cmd, int fcn, uintptr_t mdep);
12
13

DESCRIPTION

15       The  uadmin()  function provides control for basic administrative func‐
16       tions. This function is tightly coupled to  the  system  administrative
17       procedures  and  is  not intended for general use. The argument mdep is
18       provided for machine-dependent use and is not defined here.  It  should
19       be initialized to NULL if not used.
20
21
22       As specified by cmd, the following commands are available:
23
24       A_SHUTDOWN    The  system  is shut down. All user processes are killed,
25                     the buffer cache is flushed, and the root file system  is
26                     unmounted.  The  action  to be taken after the system has
27                     been shut down is specified by  fcn.  The  functions  are
28                     generic;  the  hardware  capabilities  vary  on  specific
29                     machines.
30
31                     AD_HALT          Halt the processor(s).
32
33
34                     AD_POWEROFF      Halt the processor(s) and turn  off  the
35                                      power.
36
37
38                     AD_BOOT          Reboot  the  system,  using  the  kernel
39                                      file.
40
41
42                     AD_IBOOT         Interactive reboot; user is prompted for
43                                      bootable program name.
44
45
46                     AD_FASTREBOOT    Bypass BIOS and boot loader
47
48
49
50       A_REBOOT      The system stops immediately without any further process‐
51                     ing. The action to be taken next is specified by  fcn  as
52                     above.
53
54
55       A_DUMP        The  system  is  forced  to panic immediately without any
56                     further processing and a crash dump  is  written  to  the
57                     dump  device  (see  dumpadm(1M)).  The action to be taken
58                     next is specified by fcn, as above.
59
60
61       A_REMOUNT     The root file system is mounted again after  having  been
62                     fixed.  This  should  be  used  only  during  the startup
63                     process.
64
65
66       A_FREEZE      Suspend the whole system.  The system state is  preserved
67                     in  the  state file. The following subcommands, specified
68                     by fcn, are available.
69
70                     AD_SUSPEND_TO_DISK
71
72                         Save the system state to the state file. This subcom‐
73                         mand is equivalent to ACPI state S4.
74
75
76                     AD_CHECK_SUSPEND_TO_DISK
77
78                         Check  if your system supports suspend to disk. With‐
79                         out performing a system suspend/resume, this  subcom‐
80                         mand checks if this feature is currently available on
81                         your system.
82
83
84                     AD_SUSPEND_TO_RAM
85
86                         Save the system state to memory  This  subcommand  is
87                         equivalent to ACPI state S3.
88
89
90                     AD_CHECK_SUSPEND_TO_RAM
91
92                         Check  if  your  system  supports  suspend to memory.
93                         Without performing a system suspend/resume, this sub‐
94                         command checks if this feature is currently available
95                         on your system.
96
97                     The following subcommands, specified by fcn, are obsolete
98                     and might be removed in a subsequent release:
99
100                     AD_COMPRESS
101
102                         Save the system state to the state file with compres‐
103                         sion of data. This subcommand has  been  replaced  by
104                         AD_SUSPEND_TO_DISK, which should be used instead.
105
106
107                     AD_CHECK
108
109                         Check  if  your  system  supports suspend and resume.
110                         Without performing  a   system  suspend/resume,  this
111                         command checks if this feature is currently available
112                         on your system. This subcommand has been replaced  by
113                         AD_CHECK_SUSPEND_TO_DISK,   which   should   be  used
114                         instead.
115
116
117                     AD_FORCE
118
119                         Force AD_COMPRESS even when threads of user  applica‐
120                         tions  are  not  suspendable.  This subcommand should
121                         never be used, as it might result in undefined behav‐
122                         ior.
123
124
125

RETURN VALUES

127       Upon  successful  completion, the value returned depends on cmd as fol‐
128       lows:
129
130       A_SHUTDOWN    Never returns.
131
132
133       A_REBOOT      Never returns.
134
135
136       A_FREEZE      0 upon resume.
137
138
139       A_REMOUNT     0.
140
141
142
143       Otherwise, −1 is returned and errno is set to indicate the error.
144

ERRORS

146       The uadmin() function will fail if:
147
148       EBUSY      Suspend is already in progress.
149
150
151       EINVAL     The cmd argument is invalid.
152
153
154       ENOMEM     Suspend/resume ran out of physical memory.
155
156
157       ENOSPC     Suspend/resume could not allocate enough space on  the  root
158                  file system to store system information.
159
160
161       ENOTSUP    Suspend/resume is not supported on this platform or the com‐
162                  mand specified by cmd is not allowed.
163
164
165       ENXIO      Unable to successfully suspend system.
166
167
168       EPERM      The {PRIV_SYS_CONFIG}  privilege  is  not  asserted  in  the
169                  effective set of the calling process.
170
171

ATTRIBUTES

173       See attributes(5) for descriptions of the following attributes:
174
175
176
177
178       ┌─────────────────────────────┬─────────────────────────────┐
179       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
180       ├─────────────────────────────┼─────────────────────────────┤
181       │Interface Stability          │See below.                   │
182       └─────────────────────────────┴─────────────────────────────┘
183
184
185       The A_FREEZE command and its subcommands are Committed.
186

SEE ALSO

188       dumpadm(1M),     halt(1M),    kernel(1M),    reboot(1M),    uadmin(1M),
189       attributes(5), privileges(5)
190

WARNINGS

192       Shutting down or halting the system by means  of  uadmin(1M)  does  not
193       update the  boot  archive.  Avoid  using  this command after
194
195           o      editing of files such as /etc/system
196
197           o      installing new driver binaries or kernel binaries
198
199           o      updating existing driver binaries or kernel binaries.
200
201
202       Use reboot(1M) or halt(1M) instead.
203
204
205
206SunOS 5.11                        25 Mar 2009                        uadmin(2)
Impressum