OSDN Git Service

(split) LDP: Translation snapshots for ja.po.
[linuxjm/LDP_man-pages.git] / draft / man2 / swapon.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified by Michael Haardt <michael@moria.de>
26 .\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified 1995-07-22 by Michael Chastain <mec@duracef.shout.net>
28 .\" Modified 1995-07-23 by aeb
29 .\" Modified 1996-10-22 by Eric S. Raymond <esr@thyrsus.com>
30 .\" Modified 1998-09-08 by aeb
31 .\" Modified 2004-06-17 by Michael Kerrisk <mtk.manpages@gmail.com>
32 .\" Modified 2004-10-10 by aeb
33 .\" 2004-12-14 mtk, Anand Kumria: added new errors
34 .\" 2007-06-22 Ivana Varekova <varekova@redhat.com>, mtk
35 .\"     Update text describing limit on number of swap files.
36 .\"
37 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
38 .\"         all rights reserved.
39 .\" Translated Mon Mar  3 23:54:56 JST 1997
40 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
41 .\" Modified Tue Dec  1 00:08:07 JST 1998
42 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
43 .\" Updated & Modified Fri Feb 11 07:40:12 JST 2005
44 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
45 .\" Updated 2007-09-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.64
46 .\"
47 .\"WORD:        swap                    スワップ
48 .\"WORD:        block device            ブロック・デバイス
49 .\"WORD:        super-user              スーパー・ユーザー
50 .\"WORD:        round robin             ラウンド・ロビン
51 .\"WORD:        partition               パーティション
52 .\"WORD:        page                    ページ
53 .\"WORD:        kernel                  カーネル
54 .\"
55 .TH SWAPON 2 2010-06-15 "Linux" "Linux Programmer's Manual"
56 .\"O .SH NAME
57 .SH 名前
58 .\"O swapon, swapoff \- start/stop swapping to file/device
59 swapon, swapoff \- ファイル/デバイスへのスワップを開始/停止する
60 .\"O .SH SYNOPSIS
61 .SH 書式
62 .B #include <unistd.h>
63 .br
64 .\"O .B #include <asm/page.h>     /* to find PAGE_SIZE */
65 .B #include <asm/page.h>     /* PAGE_SIZE を見つけるため */
66 .br
67 .B #include <sys/swap.h>
68 .sp
69 .BI "int swapon(const char *" path ", int " swapflags );
70 .br
71 .BI "int swapoff(const char *" path );
72 .\"O .SH DESCRIPTION
73 .SH 説明
74 .\"O .BR swapon ()
75 .\"O sets the swap area to the file or block device specified by
76 .\"O .IR path .
77 .BR swapon ()
78
79 .I path
80 で指定されたファイルやブロック・デバイスにスワップ領域を設定する。
81 .\"O .BR swapoff ()
82 .\"O stops swapping to the file or block device specified by
83 .\"O .IR path .
84 .BR swapoff ()
85
86 .I path
87 で指定されたファイルやブロック・デバイスへのスワップを停止する。
88 .PP
89 .\"O .BR swapon ()
90 .\"O takes a
91 .\"O .I swapflags
92 .\"O argument.
93 .BR swapon ()
94
95 .I swapflags
96 引き数を取る。
97 .\"O If
98 .\"O .I swapflags
99 .\"O has the
100 .\"O .B SWAP_FLAG_PREFER
101 .\"O bit turned on, the new swap area will have a higher priority than default.
102 .I swapflags
103
104 .B SWAP_FLAG_PREFER
105 ビットが設定された場合は、新しいスワップ領域はデフォルトよりも高い
106 優先度を持つ。
107 .\"O The priority is encoded within
108 .\"O .I swapflags
109 .\"O as:
110 優先度は
111 .I swapflags
112 に以下のようにコード化されている。
113 .br
114 .sp
115 .I "    (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK"
116 .br
117 .PP
118 .\"O These functions may only be used by a privileged process (one having the
119 .\"O .B CAP_SYS_ADMIN
120 .\"O capability).
121 これらの関数は特権プロセス
122 .RB ( CAP_SYS_ADMIN
123 ケーパビリティ (capability) を持つプロセス) のみが使用できる。
124 .\"O .SS Priority
125 .SS 優先度
126 .\"O Each swap area has a priority, either high or low.
127 .\"O The default priority is low.
128 .\"O Within the low-priority areas,
129 .\"O newer areas are even lower priority than older areas.
130 それぞれのスワップ領域は高 (high) と低 (low) のどちらかの優先度を持つ。
131 デフォルトの優先度は低である。
132 低い優先度の領域において、新しい領域は古い領域よりさらに低い
133 優先度を持つ。
134 .PP
135 .\"O All priorities set with
136 .\"O .I swapflags
137 .\"O are high-priority, higher than default.
138 .\"O They may have any nonnegative value chosen by the caller.
139 .\"O Higher numbers mean higher priority.
140 .I swapflags
141 が設定されたものは全て高い優先度となり、デフォルトよりも高い優先度を持つ。
142 使用者はそれらに負でない値が指定できる。
143 大きな数字は高い優先度を意味する。
144 .PP
145 .\"O Swap pages are allocated from areas in priority order,
146 .\"O highest priority first.
147 .\"O For areas with different priorities,
148 .\"O a higher-priority area is exhausted before using a lower-priority area.
149 .\"O If two or more areas have the same priority,
150 .\"O and it is the highest priority available,
151 .\"O pages are allocated on a round-robin basis between them.
152 高い優先度の領域から順にスワップ・ページとして使用される。
153 より低い優先度の領域を使用する前により高い優先度の
154 領域を使い切る。もし二つ以上の領域が同じ優先度を持ち、
155 使える中で一番高い優先度であれば、それらのページは間で
156 ラウンド・ロビン方式で配分される。
157 .PP
158 .\"O As of Linux 1.3.6, the kernel usually follows these rules,
159 .\"O but there are exceptions.
160 Linux 1.3.6 において、カーネルは通常はこれらの規則に従っている。
161 しかし例外も存在している。
162 .\"O .SH "RETURN VALUE"
163 .SH 返り値
164 .\"O On success, zero is returned.
165 .\"O  On error, \-1 is returned, and
166 .\"O .I errno
167 .\"O is set appropriately.
168 成功した場合は 0 が返される。エラーの場合は \-1 が返され、
169 .I errno
170 が適切に設定される。
171 .\"O .SH ERRORS
172 .SH エラー
173 .TP
174 .B EBUSY
175 .\"O (for
176 .\"O .BR swapon ())
177 .\"O The specified
178 .\"O .I path
179 .\"O is already being used as a swap area.
180 .RB ( swapon ()
181 において) 指定された
182 .I path
183 が既にスワップ領域として使用されている。
184 .TP
185 .B EINVAL
186 .\"O The file
187 .\"O .I path
188 .\"O exists, but refers neither to a regular file nor to a block device;
189 ファイル
190 .I path
191 は存在するが、通常のファイルもブロック・デバイスも参照していない。
192 .\"O or, for
193 .\"O .BR swapon (),
194 .\"O the indicated path does not contain a valid swap signature or
195 .\"O resides on an in-memory file system like tmpfs; or, for
196 .\"O or, for
197 .\"O .BR swapoff (),
198 .\"O .I path
199 .\"O is not currently a swap area.
200 または
201 .BR swapon ()
202 において、指定された path のファイルが有効なスワップの署名 (signature) を
203 含んでいないか、tmpfs のようなインメモリ (in-memory) のファイルシステム
204 上にある。
205 または
206 .BR swapoff ()
207 において、
208 .I path
209 が現在のところスワップ領域でない。
210 .TP
211 .B ENFILE
212 .\"O The system limit on the total number of open files has been reached.
213 オープンされたファイルの総数がシステムの制限に達した。
214 .TP
215 .B ENOENT
216 .\"O The file
217 .\"O .I path
218 .\"O does not exist.
219 ファイル
220 .I path
221 が存在しない。
222 .TP
223 .B ENOMEM
224 .\"O The system has insufficient memory to start swapping.
225 スワップを開始するのに十分なメモリーがシステムにない。
226 .TP
227 .B EPERM
228 .\"O The caller does not have the
229 .\"O .B CAP_SYS_ADMIN
230 .\"O capability.
231 .\"O Alternatively, the maximum number of swap files are already in use;
232 .\"O see NOTES below.
233 使用者が
234 .B CAP_SYS_ADMIN
235 ケーパビリティを持っていない。
236 もしくは、最大数のスワップファイルがすでに使用されている
237 (下記の「注意」の節を参照)。
238 .\"O .SH "CONFORMING TO"
239 .SH 準拠
240 .\"O These functions are Linux-specific and should not be used in programs
241 .\"O intended to be portable.
242 これらの関数は Linux 特有であり、移植を意図したプログラムでは
243 使用してはいけない。
244 .\"O The second
245 .\"O .I swapflags
246 .\"O argument was introduced in Linux 1.3.2.
247 二番目の
248 .I swapflags
249 引き数は Linux 1.3.2 から導入された。
250 .\"O .SH NOTES
251 .SH 注意
252 .\"O The partition or path must be prepared with
253 .\"O .BR mkswap (8).
254 パーティションやパスは
255 .BR mkswap (8)
256 によって準備されていなければならない。
257
258 .\"O There is an upper limit on the number of swap files that may be used,
259 .\"O defined by the kernel constant
260 .\"O .BR MAX_SWAPFILES .
261 .\"O Before kernel 2.4.10,
262 .\"O .B MAX_SWAPFILES
263 .\"O has the value 8;
264 .\"O since kernel 2.4.10, it has the value 32.
265 .\"O Since kernel 2.6.18, the limit is decreased by 2 (thus: 30)
266 .\"O if the kernel is built with the
267 .\"O .B CONFIG_MIGRATION
268 .\"O option
269 .\"O (which reserves two swap table entries for the page migration features of
270 .\"O .BR mbind (2)
271 .\"O and
272 .\"O .BR migrate_pages (2)).
273 .\"O Since kernel 2.6.32, the limit is further decreased by 1
274 .\"O if the kernel is built with the
275 .\"O .B CONFIG_MEMORY_FAILURE
276 .\"O option.
277 使用できるスワップファイルの数には上限があり、その上限は
278 カーネル定数
279 .B MAX_SWAPFILES
280 で定義される。
281 .B MAX_SWAPFILES
282 の値は、カーネル 2.4.10 より前では 8、
283 カーネル 2.4.10 以降では 32 である。
284 カーネル 2.6.18 以降では、カーネルが
285 .B CONFIG_MIGRATION
286 オプションを有効にして作成された場合、
287 この上限が 2 少ない値 (つまり 30) となる
288 (このカーネルでは、
289 .BR mbind (2)
290
291 .BR migrate_pages (2)
292 のページ・マイグレーション機能用にスワップ・テーブルのエントリーが
293 二つ予約される)。
294 カーネル 2.6.32 以降では、カーネルが
295 .B CONFIG_MEMORY_FAILURE
296 オプションを有効にして作成された場合、
297 この上限がさらに 1 少ない値となる。
298 .\"O .SH "SEE ALSO"
299 .SH 関連項目
300 .BR mkswap (8),
301 .BR swapoff (8),
302 .BR swapon (8)