ref: 1b1d9dd8049e73b4e6fe1b6305229af5a5fd54eb
dir: /sys/man/3/swap/
.TH SWAP 3 .SH NAME swap \- memory usage statistics and swap file control .SH SYNOPSIS .nf .B bind -a #¶ /dev .B /dev/swap .fi .SH DESCRIPTION The .B swap device holds a text block giving memory usage statistics: .IP .EX \fIn\fP memory \fIn\fP pagesize \fIn\fP kernel \fIn\fP/\fIm\fP user \fIn\fP/\fIm\fP swap \fIa\fP/\fIn\fP/\fIm\fP kernel malloc \fIa\fP/\fIn\fP/\fIm\fP kernel draw \fIa\fP/\fIn\fP/\fIm\fP kernel secret .EE .PP These are total memory (bytes), system page size (bytes), kernel memory (pages), user memory (pages), swap space (pages), kernel malloced data (bytes), kernel graphics data (bytes) and kernel secret data (bytes). The expression .IR n / m indicates .I n used out of .I m available. For kernel malloc and kernel draw, .IR a indicates the current allocation in bytes. These numbers are not blank padded. .PP To turn on swapping, write to .B swap the textual file descriptor number of a file or device on which to swap. .PP Only the hostowner is allowed to enable swapping. The pages written to the swap file are transparently encrypted by the kernel using a random key. .SH SEE ALSO .IR memory (8), .IR swap (8). .SH SOURCE .B /sys/src/9/port/devswap.c