2011-03-30 13:49:47 +00:00
|
|
|
.TH SWAP 8
|
|
|
|
.SH NAME
|
|
|
|
swap \- establish a swap file
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B swap
|
|
|
|
.I file
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.I Swap
|
2011-08-22 08:03:15 +00:00
|
|
|
establishes a file for the system to swap on.
|
2011-03-30 13:49:47 +00:00
|
|
|
If
|
|
|
|
.I file
|
2011-08-22 08:03:15 +00:00
|
|
|
is an existing file, it is used for system swap. If it
|
|
|
|
does not exist, a new file is created. If
|
|
|
|
.I file
|
|
|
|
is a directory, a unique file is created in that directory
|
|
|
|
on which to swap.
|
2011-03-30 13:49:47 +00:00
|
|
|
The environment variable
|
|
|
|
.B swap
|
|
|
|
is set to the full name of the resulting file.
|
|
|
|
The number of blocks available in the file or device
|
|
|
|
must be at least the number of swap blocks configured
|
|
|
|
at system boot time.
|
|
|
|
.PP
|
|
|
|
If a swap channel has already been set and no blocks
|
|
|
|
are currently valid in the file the old file will be
|
|
|
|
closed and then replaced. If any blocks are valid on
|
|
|
|
the device an error is returned instead.
|
|
|
|
.SH SOURCE
|
|
|
|
.B /sys/src/cmd/swap.c
|
|
|
|
.SH BUGS
|
2015-08-21 17:51:03 +00:00
|
|
|
Swapping to a file served by a local user-level process
|
2011-08-22 08:03:15 +00:00
|
|
|
will lead to deadlock if the process isn't made non-swappable
|
|
|
|
(see the
|
|
|
|
.B noswap
|
|
|
|
ctl-message in
|
|
|
|
.IR proc (3)).
|
|
|
|
.SH "SEE ALSO"
|
2017-10-29 22:09:54 +00:00
|
|
|
.IR swap (3),
|
2011-08-22 08:03:15 +00:00
|
|
|
.IR proc (3)
|