File: swapon.2

package info (click to toggle)
manpages-ja 0.5.0.0.20080615-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 20,508 kB
  • ctags: 1
  • sloc: sh: 13,690; perl: 157; makefile: 114
file content (192 lines) | stat: -rw-r--r-- 5,813 bytes parent folder | download
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
.\" 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 1993-07-24 by Rik Faith <faith@cs.unc.edu>
.\" Modified 1995-07-22 by Michael Chastain <mec@duracef.shout.net>
.\" Modified 1995-07-23 by aeb
.\" Modified 1996-10-22 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified 1998-09-08 by aeb
.\" Modified 2004-06-17 by Michael Kerrisk <mtk.manpages@gmail.com>
.\" Modified 2004-10-10 by aeb
.\" 2004-12-14 mtk, Anand Kumria: added new errors
.\" 2007-06-22 Ivana Varekova <varekova@redhat.com>, mtk
.\"     Update text describing limit on number of swap files.
.\"
.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
.\"         all rights reserved.
.\" Translated Mon Mar  3 23:54:56 JST 1997
.\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Modified Tue Dec  1 00:08:07 JST 1998
.\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Updated & Modified Fri Feb 11 07:40:12 JST 2005
.\"         by Yuichi SATO <ysato444@yahoo.co.jp>
.\" Updated 2007-09-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.64
.\"
.\"WORD:	swap			å
.\"WORD:	block device		֥åǥХ
.\"WORD:	super-user		ѡ桼
.\"WORD:	round robin		饦ɡӥ
.\"WORD:	partition		ѡƥ
.\"WORD:	page			ڡ
.\"WORD:	kernel			ͥ
.\"
.TH SWAPON 2 2007-06-22 "Linux" "Linux Programmer's Manual"
.SH ̾
swapon, swapoff \- ե/ǥХؤΥåפ򳫻/ߤ
.SH 
.B #include <unistd.h>
.br
.B #include <asm/page.h>     /* PAGE_SIZE 򸫤Ĥ뤿 */
.br
.B #include <sys/swap.h>
.sp
.BI "int swapon(const char *" path ", int " swapflags );
.br
.BI "int swapoff(const char *" path );
.SH 
.BR swapon ()

.I path
ǻꤵ줿ե֥åǥХ˥åΰꤹ롣
.BR swapoff ()

.I path
ǻꤵ줿ե֥åǥХؤΥåפߤ롣
.PP
.BR swapon ()

.I swapflags
.I swapflags

.B SWAP_FLAG_PREFER
ӥåȤꤵ줿ϡåΰϥǥեȤ⤤
ͥ٤ġ
ͥ٤
.I swapflags
˰ʲΤ褦˥ɲƤ롣
.br
.sp
.I "    (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK"
.br
.PP
δؿøץ
.RB ( CAP_SYS_ADMIN
ѥӥƥ (capability) ĥץ) ΤߤѤǤ롣
.SS ͥ
줾ΥåΰϹ (high)  (low) Τɤ餫ͥ٤ġ
ǥեȤͥ٤Ǥ롣
㤤ͥ٤ΰˤơΰϸŤΰꤵ㤤
ͥ٤ġ
.PP
.I swapflags
ꤵ줿Τƹ⤤ͥ٤ȤʤꡢǥեȤ⤤ͥ٤ġ
ѼԤϤǤʤͤǤ롣
礭ʿϹ⤤ͥ٤̣롣
.PP
⤤ͥ٤ΰ褫˥åסڡȤƻѤ롣
㤤ͥ٤ΰѤˤ⤤ͥ٤
ΰȤڤ롣⤷İʾΰ褬Ʊͥ٤
Ȥǰֹ⤤ͥ٤ǤСΥڡϴ֤
饦ɡӥʬ롣
.PP
Linux 1.3.6 ˤơͥ̾Ϥε§˽äƤ롣
㳰¸ߤƤ롣
.SH ֤
 0 ֤롣顼ξ \-1 ֤졢
.I errno
Ŭڤꤵ롣
.SH 顼
.TP
.B EBUSY
.RB ( swapon ()
ˤ) ꤵ줿
.I path
˥åΰȤƻѤƤ롣
.TP
.B EINVAL
ե
.I path
¸ߤ뤬̾Υե֥åǥХ⻲ȤƤʤ
ޤ
.BR swapon ()
ˤơꤵ줿 path Υե뤬ͭʥåפν̾ (signature) 
ޤǤʤtmpfs Τ褦ʥ (in-memory) Υե륷ƥ
ˤ롣
ޤ
.BR swapoff ()
ˤơ
.I path
ߤΤȤåΰǤʤ
.TP
.B ENFILE
ץ󤵤줿եƥ¤ã
.TP
.B ENOENT
ե
.I path
¸ߤʤ
.TP
.B ENOMEM
åפ򳫻ϤΤ˽ʬʥ꡼ƥˤʤ
.TP
.B EPERM
ѼԤ
.B CAP_SYS_ADMIN
ѥӥƥäƤʤ
⤷ϡΥåץե뤬Ǥ˻ѤƤ
(Ρաפ򻲾)
.SH 
δؿ Linux ͭǤꡢܿտޤץǤ
ѤƤϤʤ
ܤ
.I swapflags
 Linux 1.3.2 Ƴ줿
.SH 
ѡƥѥ
.BR mkswap (8)
ˤäƽƤʤФʤʤ

ѤǤ륹åץեοˤϾ¤ꡢξ¤
ͥ
.B MAX_SWAPFILES
.B MAX_SWAPFILES
ͤϡͥ 2.6.10 Ǥ 8
ͥ 2.6.10 ʹߤǤ 32 Ǥ롣
ͥ 2.6.18 ʹߤǤϡͥ뤬
.B CONFIG_MIGRATION
ץͭˤƺ줿硢
ξ¤ 2 ʤ (Ĥޤ 30) Ȥʤ
(ΥͥǤϡ
.BR mbind (2)

.BR migrate_pages (2)
Υڡޥ졼ǽѤ˥åסơ֥Υȥ꡼
ͽ󤵤)
.SH Ϣ
.BR mkswap (8),
.BR swapoff (8),
.BR swapon (8)