File: swapon.2

package info (click to toggle)
manpages-es 1.55-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,472 kB
  • ctags: 6
  • sloc: sh: 1,349; makefile: 63
file content (134 lines) | stat: -rw-r--r-- 4,633 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Modified by Michael Haardt <michael@moria.de>
.\" Modified Sat Jul 24 11:47:53 1993 by Rik Faith <faith@cs.unc.edu>
.\" Modified 22 July 1995 by Michael Chastain <mec@duracef.shout.net>:
.\"   Added 'swapflags' argument.
.\" Added historical remark, aeb, 950723.
.\" Modified Tue Oct 22 22:23:50 1996 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified 980908, aeb.
.\"
.\" Translated into Spanish Wed Feb 4 1998 by Gerardo Aburruzaga
.\" García <gerardo.aburruzaga@uca.es>
.\" Translation revised Wed Dec 30 1998 by Juan Piernas <piernas@ditec.um.es>
.\"
.TH SWAPON 2 "22 julio 1995" "Linux 1.3.6" "Manual del Programador de Linux"
.SH NOMBRE
swapon, swapoff \- arranca/para el intercambio al fichero/dispositivo
.SH SINOPSIS
.B #include <unistd.h>
.br
.B #include <asm/page.h>     /* para encontrar PAGE_SIZE */
.br
.B #include <sys/swap.h>
.sp
.BI "int swapon(const char *" camino ", int " swapflags );
.br
.BI "int swapoff(const char *" camino );
.SH DESCRIPCIÓN
.B swapon
establece como área de trasiego el fichero o dispositivo de bloques
especificado por
.IR camino .
.B swapoff
para el trasiego al fichero o dispositivo de bloque especificado por
.IR camino .
.PP
.B swapon
toma un argumento \fIswapflags\fP.
Si
.I swapflags
tiene el bit
.I SWAP_FLAG_PREFER
activado, la nueva área de trasiego tendrá una prioridad más alta que
la predeterminada. La prioridad se codifica como:
.br
.sp
.I "    (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK"
.br
.PP
Estas funciones sólo pueden ser empleadas por el súper-usuario.
.SH PRIORIDAD
Cada área de trasiego tiene una prioridad, alta o baja.
La prioridad predeterminada es la baja.
Dentro de las áreas de baja prioridad, las áreas nuevas tienen
prioridad aún más baja que las áreas antiguas.
.PP
Todas las prioridades puestas con
.I swapflags
son de alta prioridad, más alta que la predeterminada.
Peden tener cualquier valor no negativo escogido por el que llama a la
función. Números más altos significan prioridades mayores.
.PP
Las páginas de trasiego se cogen de las áreas en orden de prioridad,
primero las de mayor prioridad.
Para áreas con prioridades diferentes, un área de prioridad más alta
se gasta por completo antes de emplear una de prioridad más baja.
Si dos o más áreas tienen la misma prioridad, y es la más alta
disponible, las páginas se asignan según un algoritmo de asignación
en rueda entre ellas.
.PP
En Linux 1.3.6, el núcleo seguía usualmente estas reglas, pero había
excepciones. 
.SH "VALOR DEVUELTO"
En caso de éxito, se devuelve 0. En caso de error, se devuelve \-1 y
se pone en
.I errno
un valor apropiado.
.SH ERRORES
Muchos otros errores pueden ocurrir si
.I camino
no es válido.

.TP
.B EPERM
El usuario no es el súper-usuario, o están en uso más de
.B MAX_SWAPFILES
(definido como 8 en Linux 1.3.6) áreas de trasiego.
.TP
.B EINVAL
se devuelve si
.I camino 
existe, pero no es ni un camino de fichero regular ni un dispositivo
de bloques.
.TP
.B ENOENT
se devuelve si
.I camino 
no existe.
.TP
.B ENOMEM 
se devuelve si no hay bastante memoria como para iniciar el trasiego.
.SH "CONFORME A"
Estas funciones son específicas de Linux y no deberían emplearse en
programas supuestamente transportables.
El segundo argumento, `swapflags', fue introducido en Linux 1.3.2.
.SH OBSERVACIONES
La partición o camino debe ser preparada con
.BR mkswap (8).
.SH "VÉASE TAMBIÉN"
.BR mkswap (8), 
.BR swapon (8), 
.BR swapoff (8)