swapon(2) DG/UX R4.11MU05 swapon(2)
NAME
swapon - add a swap device for demand paging
SYNOPSIS
int swapon(char *special);
where:
special Pathname of the block device to page on
DESCRIPTION
The swapon() function makes the block device special available to the
system to use for paging. The entire device is made available for
use for paging; the previous contents of the storage will be
overwritten.
ACCESS CONTROL
The calling process must have appropriate privilege to successfully
execute this system call. For systems supporting the DG/UX
Capability Option, appropriate privilege is defined as having one or
more specific capabilities enabled in the effective capability set of
the calling process. See capdefaults(5) for the default capability
for this system call.
On systems without the DG/UX Capability Option, appropriate privilege
means that the process has an effective UID of root. See the
appropriateprivilege(5) man page for more information.
RETURN VALUE
Upon successful completion, swapon() returns a value of 0.
Otherwise, it returns the value -1, and sets errno to indicate an
error.
DIAGNOSTICS
Under the following conditions, swapon() fails and sets errno to:
EPERM if the calling process does not have the appropriate
privilege.
ENOSPC if the swap area could not be set up because the system
already has the maximum number of paging areas in use.
ENODEV if the swap area could not be set up because its size is
bigger than the maximum or smaller than the minimum
allowable size for a paging area.
ENOTBLK if the file with the specified pathname is not a block
special file.
EBUSY if the given device is already in use.
ENOENT if there is no file with the specified pathname.
ENOENT if a non-terminal component of the specified pathname
does not exist.
ENOTDIR if a non-terminal component of the specified pathname was
not a directory or symbolic link.
ENAMETOOLONG
if the pathname exceeds the length limit for pathnames.
ENAMETOOLONG
if a component of the pathname exceeds the length limit
for filenames.
ELOOP if the number of symbolic links encountered during
pathname resolution exceeds the system maximum. A
symbolic link cycle is suspected.
EFAULT if the pathname does not completely reside in the
process's address space or the pathname does not
terminate in the process's address space.
SEE ALSO
swapon(1M), appropriateprivilege(5).
capdefaults(5).
Licensed material--property of copyright holder(s)