date and time created 91/03/06 18:09:53 by bostic
[unix-history] / usr / src / lib / libc / sys / swapon.2
CommitLineData
88b3ccf2
KB
1.\" Copyright (c) 1980 The Regents of the University of California.
2.\" All rights reserved.
1f431a5b 3.\"
91cff1e1 4.\" %sccs.include.redist.man%
88b3ccf2 5.\"
91cff1e1 6.\" @(#)swapon.2 6.6 (Berkeley) %G%
1f431a5b 7.\"
2b75c396 8.TH SWAPON 2 ""
1f431a5b
KM
9.UC 4
10.SH NAME
e06acb0b 11swapon \- add a swap device for interleaved paging/swapping
1f431a5b
KM
12.SH SYNOPSIS
13.nf
e06acb0b
KM
14.B swapon(special)
15.B char *special;
1f431a5b
KM
16.fi
17.SH DESCRIPTION
e06acb0b
KM
18.I Swapon
19makes the block device
20.I special
21available to the system for
22allocation for paging and swapping. The names of potentially
23available devices are known to the system and defined at system
24configuration time. The size of the swap area on
25.I special
26is calculated at the time the device is first made available
27for swapping.
0148896a
DS
28.SH "RETURN VALUE
29If an error has occurred, a value of \-1 is returned and
30.I errno
31is set to indicate the error.
b5984ffe
KM
32.SH ERRORS
33.I Swapon
34succeeds unless:
35.TP 15
36[ENOTDIR]
37A component of the path prefix is not a directory.
38.TP 15
39[EINVAL]
40The pathname contains a character with the high-order bit set.
41.TP 15
42[ENAMETOOLONG]
43A component of a pathname exceeded 255 characters,
44or an entire path name exceeded 1023 characters.
45.TP 15
46[ENOENT]
47The named device does not exist.
48.TP 15
49[EACCES]
50Search permission is denied for a component of the path prefix.
51.TP 15
52[ELOOP]
53Too many symbolic links were encountered in translating the pathname.
54.TP 15
55[EPERM]
56The caller is not the super-user.
fd690c8b
KM
57.TP 15
58[ENOTBLK]
59.I Special
60is not a block device.
61.TP 15
62[EBUSY]
63The device specified by \fIspecial\fP has already
64been made available for swapping
65.TP 15
66[EINVAL]
67The device configured by \fIspecial\fP was not
68configured into the system as a swap device.
69.TP 15
70[ENXIO]
71The major device number of
72.I special
73is out of range (this indicates no device driver exists
74for the associated hardware).
75.TP 15
76[EIO]
77An I/O error occurred while opening the swap device.
78.TP 15
79[EFAULT]
80.I Special
81points outside the process's allocated address space.
1f431a5b 82.SH "SEE ALSO"
e06acb0b 83swapon(8), config(8)
1f431a5b
KM
84.SH BUGS
85There is no way to stop swapping on a disk so that the pack may be
86dismounted.
87.PP
e06acb0b 88This call will be upgraded in future versions of the system.