Files
oldlinux-files/Linux-0.98/Yggdrasil-0.98.3/usr/man/man2/swapon.2
2024-02-19 00:21:16 -05:00

51 lines
1.0 KiB
Groff

.TH SWAPON 2
.UC 4
.SH NAME
swapon \- set swap file/device.
.SH SYNOPSIS
.nf
.B #include <unistd.h>
.B int swapon(const char *file);
.fi
.SH DESCRIPTION
.B swapon()
sets the swap area to the file or block device specified by
.I *file.
.PP
.B swapon()
may only be called by the super user,
and may only be called once successfully.
0 is returned on success, and a
.B printk()
(console message)
made telling how much swap space was added.
On failure, a negative value is returned.
.SH ERRORS
.B -EBUSY
is returned when there already is a swap file or swap device.
.PP
.B -EINVAL
is returned if
.I file
exists, but is neither a regular file nor a block device.
.PP
.B -ENOENT
is returned if
.I file
does not exist.
.PP
.B -ENOMEM
is returned if there is insufficient memory to start swapping.
.B -EPERM
is returned if non-root users attempt to call
.B swapon().
.PP
.SH FILES
/usr/include/linux/sys.h
.br
/usr/include/unistd.h
.SH SEE ALSO
.SH BUGS
There is no way to turn off swapping or change devices.
The partition or file must be prepared with mkswap(1).