| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: swapctl.2,v 1.37 2010/05/31 12:16:20 njoly Exp $ | | 1 | .\" $NetBSD: swapctl.2,v 1.38 2011/04/28 11:58:50 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 1997 Matthew R. Green | | 3 | .\" Copyright (c) 1997 Matthew R. Green |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" Redistribution and use in source and binary forms, with or without | | 6 | .\" Redistribution and use in source and binary forms, with or without |
7 | .\" modification, are permitted provided that the following conditions | | 7 | .\" modification, are permitted provided that the following conditions |
8 | .\" are met: | | 8 | .\" are met: |
9 | .\" 1. Redistributions of source code must retain the above copyright | | 9 | .\" 1. Redistributions of source code must retain the above copyright |
10 | .\" notice, this list of conditions and the following disclaimer. | | 10 | .\" notice, this list of conditions and the following disclaimer. |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer in the | | 12 | .\" notice, this list of conditions and the following disclaimer in the |
13 | .\" documentation and/or other materials provided with the distribution. | | 13 | .\" documentation and/or other materials provided with the distribution. |
14 | .\" | | 14 | .\" |
| @@ -202,69 +202,68 @@ or | | | @@ -202,69 +202,68 @@ or |
202 | .Fn swapctl | | 202 | .Fn swapctl |
203 | returns the number of swap devices, if successful. | | 203 | returns the number of swap devices, if successful. |
204 | The | | 204 | The |
205 | .Dv SWAP_NSWAP | | 205 | .Dv SWAP_NSWAP |
206 | command is always successful. | | 206 | command is always successful. |
207 | Otherwise it returns 0 on success and \-1 | | 207 | Otherwise it returns 0 on success and \-1 |
208 | on failure, setting the global variable | | 208 | on failure, setting the global variable |
209 | .Va errno | | 209 | .Va errno |
210 | to indicate the error. | | 210 | to indicate the error. |
211 | .Sh ERRORS | | 211 | .Sh ERRORS |
212 | .Fn swapctl | | 212 | .Fn swapctl |
213 | succeeds unless: | | 213 | succeeds unless: |
214 | .Bl -tag -width Er | | 214 | .Bl -tag -width Er |
215 | .It Bq Er ENOTDIR | | | |
216 | A component of the path prefix is not a directory. | | | |
217 | .It Bq Er ENAMETOOLONG | | | |
218 | A component of a pathname exceeded | | | |
219 | .Brq Dv NAME_MAX | | | |
220 | characters, or an entire path name exceeded | | | |
221 | .Brq Dv PATH_MAX | | | |
222 | characters. | | | |
223 | .It Bq Er ENOENT | | | |
224 | The named device does not exist. | | | |
225 | For the | | | |
226 | .Dv SWAP_CTL | | | |
227 | command, the named device is not currently enabled for swapping. | | | |
228 | .It Bq Er EACCES | | 215 | .It Bq Er EACCES |
229 | Search permission is denied for a component of the path prefix. | | 216 | Search permission is denied for a component of the path prefix. |
230 | .It Bq Er ELOOP | | | |
231 | Too many symbolic links were encountered in translating the pathname. | | | |
232 | .It Bq Er EPERM | | | |
233 | The caller is not the super-user. | | | |
234 | .It Bq Er EBUSY | | 217 | .It Bq Er EBUSY |
235 | The device specified by | | 218 | The device specified by |
236 | .Fa arg | | 219 | .Fa arg |
237 | has already been made available for swapping. | | 220 | has already been made available for swapping. |
| | | 221 | .It Bq Er EFAULT |
| | | 222 | .Fa arg |
| | | 223 | points outside the process' allocated address space. |
238 | .It Bq Er EINVAL | | 224 | .It Bq Er EINVAL |
239 | The device configured by | | 225 | The device configured by |
240 | .Fa arg | | 226 | .Fa arg |
241 | has no associated size, or the | | 227 | has no associated size, or the |
242 | .Fa cmd | | 228 | .Fa cmd |
243 | was unknown. | | 229 | was unknown. |
| | | 230 | .It Bq Er EIO |
| | | 231 | An I/O error occurred while opening the swap device. |
| | | 232 | .It Bq Er ELOOP |
| | | 233 | Too many symbolic links were encountered in translating the pathname. |
| | | 234 | .It Bq Er ENAMETOOLONG |
| | | 235 | A component of a pathname exceeded |
| | | 236 | .Brq Dv NAME_MAX |
| | | 237 | characters, or an entire path name exceeded |
| | | 238 | .Brq Dv PATH_MAX |
| | | 239 | characters. |
| | | 240 | .It Bq Er ENOENT |
| | | 241 | The named device does not exist. |
| | | 242 | For the |
| | | 243 | .Dv SWAP_CTL |
| | | 244 | command, the named device is not currently enabled for swapping. |
| | | 245 | .It Bq Er ENOTDIR |
| | | 246 | A component of the path prefix is not a directory. |
244 | .It Bq Er ENXIO | | 247 | .It Bq Er ENXIO |
245 | The major device number of | | 248 | The major device number of |
246 | .Fa arg | | 249 | .Fa arg |
247 | is out of range (this indicates no device driver exists | | 250 | is out of range (this indicates no device driver exists |
248 | for the associated hardware). | | 251 | for the associated hardware); or |
249 | .It Bq Er ENXIO | | 252 | the block device specified by |
250 | The block device specified by | | | |
251 | .Fa arg | | 253 | .Fa arg |
252 | is not marked as a swap partition in the disklabel. | | 254 | is not marked as a swap partition in the disklabel. |
253 | .It Bq Er EIO | | 255 | .It Bq Er EPERM |
254 | An I/O error occurred while opening the swap device. | | 256 | The caller is not the super-user. |
255 | .It Bq Er EFAULT | | | |
256 | .Fa arg | | | |
257 | points outside the process' allocated address space. | | | |
258 | .El | | 257 | .El |
259 | .Sh SEE ALSO | | 258 | .Sh SEE ALSO |
260 | .Xr swapctl 8 | | 259 | .Xr swapctl 8 |
261 | .Sh HISTORY | | 260 | .Sh HISTORY |
262 | The | | 261 | The |
263 | .Fn swapctl | | 262 | .Fn swapctl |
264 | function call appeared in | | 263 | function call appeared in |
265 | .Nx 1.3 . | | 264 | .Nx 1.3 . |
266 | The | | 265 | The |
267 | .Fa se_path | | 266 | .Fa se_path |
268 | member was added to | | 267 | member was added to |
269 | .Va struct swapent | | 268 | .Va struct swapent |
270 | in | | 269 | in |