1SWAPON(2)                     System Calls Manual                    SWAPON(2)
2
3
4

NAME

6       swapon - add a swap device for interleaved paging/swapping
7

SYNOPSIS

9       swapon(special)
10       char *special;
11

DESCRIPTION

13       Swapon makes the block device special available to the system for allo‐
14       cation for paging and swapping.  The  names  of  potentially  available
15       devices  are  known  to  the system and defined at system configuration
16       time.  The size of the swap area on special is calculated at  the  time
17       the device is first made available for swapping.
18

RETURN VALUE

20       If an error has occurred, a value of -1 is returned and errno is set to
21       indicate the error.
22

ERRORS

24       Swapon succeeds unless:
25
26       [ENOTDIR]      A component of the path prefix is not a directory.
27
28       [EINVAL]       The pathname contains a character  with  the  high-order
29                      bit set.
30
31       [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an
32                      entire path name exceeded 1023 characters.
33
34       [ENOENT]       The named device does not exist.
35
36       [EACCES]       Search permission is denied for a component of the  path
37                      prefix.
38
39       [ELOOP]        Too  many symbolic links were encountered in translating
40                      the pathname.
41
42       [EPERM]        The caller is not the super-user.
43
44       [ENOTBLK]      Special is not a block device.
45
46       [EBUSY]        The device specified by special has  already  been  made
47                      available for swapping
48
49       [EINVAL]       The device configured by special was not configured into
50                      the system as a swap device.
51
52       [ENXIO]        The major device number of special is out of range (this
53                      indicates  no  device  driver  exists for the associated
54                      hardware).
55
56       [EIO]          An I/O error occurred while opening the swap device.
57
58       [EFAULT]       Special points outside the process's  allocated  address
59                      space.
60

SEE ALSO

62       swapon(8), config(8)
63

BUGS

65       There is no way to stop swapping on a disk so that the pack may be dis‐
66       mounted.
67
68       This call will be upgraded in future versions of the system.
69
70
71
724th Berkeley Distribution        March 9, 1986                       SWAPON(2)
Impressum