Commit | Line | Data |
---|---|---|
931b8415 | 1 | .\" Copyright (c) 1980, 1991 The Regents of the University of California. |
88b3ccf2 | 2 | .\" All rights reserved. |
1f431a5b | 3 | .\" |
91cff1e1 | 4 | .\" %sccs.include.redist.man% |
88b3ccf2 | 5 | .\" |
931b8415 | 6 | .\" @(#)swapon.2 6.7 (Berkeley) %G% |
1f431a5b | 7 | .\" |
931b8415 CL |
8 | .Dd |
9 | .Dt SWAPON 2 | |
10 | .Os BSD 4 | |
11 | .Sh NAME | |
12 | .Nm swapon | |
13 | .Nd add a swap device for interleaved paging/swapping | |
14 | .Sh SYNOPSIS | |
15 | .Fd #include <unistd.h> | |
16 | .Ft int | |
17 | .Fn swapon "const char *special" | |
18 | .Sh DESCRIPTION | |
19 | .Fn Swapon | |
e06acb0b | 20 | makes the block device |
931b8415 | 21 | .Fa special |
e06acb0b KM |
22 | available to the system for |
23 | allocation for paging and swapping. The names of potentially | |
24 | available devices are known to the system and defined at system | |
25 | configuration time. The size of the swap area on | |
931b8415 | 26 | .Fa special |
e06acb0b KM |
27 | is calculated at the time the device is first made available |
28 | for swapping. | |
931b8415 CL |
29 | .Sh RETURN VALUES |
30 | If an error has occurred, a value of -1 is returned and | |
31 | .Va errno | |
0148896a | 32 | is set to indicate the error. |
931b8415 CL |
33 | .Sh ERRORS |
34 | .Fn Swapon | |
b5984ffe | 35 | succeeds unless: |
931b8415 CL |
36 | .Bl -tag -width ENAMETOOLONG |
37 | .It Bq Er ENOTDIR | |
b5984ffe | 38 | A component of the path prefix is not a directory. |
931b8415 | 39 | .It Bq Er EINVAL |
b5984ffe | 40 | The pathname contains a character with the high-order bit set. |
931b8415 | 41 | .It Bq Er ENAMETOOLONG |
b5984ffe KM |
42 | A component of a pathname exceeded 255 characters, |
43 | or an entire path name exceeded 1023 characters. | |
931b8415 | 44 | .It Bq Er ENOENT |
b5984ffe | 45 | The named device does not exist. |
931b8415 | 46 | .It Bq Er EACCES |
b5984ffe | 47 | Search permission is denied for a component of the path prefix. |
931b8415 | 48 | .It Bq Er ELOOP |
b5984ffe | 49 | Too many symbolic links were encountered in translating the pathname. |
931b8415 | 50 | .It Bq Er EPERM |
b5984ffe | 51 | The caller is not the super-user. |
931b8415 CL |
52 | .It Bq Er ENOTBLK |
53 | .Fa Special | |
fd690c8b | 54 | is not a block device. |
931b8415 CL |
55 | .It Bq Er EBUSY |
56 | The device specified by | |
57 | .Fa special | |
58 | has already | |
fd690c8b | 59 | been made available for swapping |
931b8415 CL |
60 | .It Bq Er EINVAL |
61 | The device configured by | |
62 | .Fa special | |
63 | was not | |
fd690c8b | 64 | configured into the system as a swap device. |
931b8415 | 65 | .It Bq Er ENXIO |
fd690c8b | 66 | The major device number of |
931b8415 | 67 | .Fa special |
fd690c8b KM |
68 | is out of range (this indicates no device driver exists |
69 | for the associated hardware). | |
931b8415 | 70 | .It Bq Er EIO |
fd690c8b | 71 | An I/O error occurred while opening the swap device. |
931b8415 CL |
72 | .It Bq Er EFAULT |
73 | .Fa Special | |
fd690c8b | 74 | points outside the process's allocated address space. |
931b8415 CL |
75 | .Sh SEE ALSO |
76 | .Xr swapon 8 , | |
77 | .Xr config 8 | |
78 | .Sh BUGS | |
1f431a5b KM |
79 | There is no way to stop swapping on a disk so that the pack may be |
80 | dismounted. | |
931b8415 | 81 | .Pp |
e06acb0b | 82 | This call will be upgraded in future versions of the system. |
931b8415 CL |
83 | .Sh HISTORY |
84 | The | |
85 | .Nm | |
86 | function call appeared in | |
87 | .Bx 4.0 . |