OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / release / 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 2007-06-22 "Linux" "Linux Programmer's Manual"
56 .SH Ì¾Á°
57 swapon, swapoff \- ¥Õ¥¡¥¤¥ë/¥Ç¥Ð¥¤¥¹¤Ø¤Î¥¹¥ï¥Ã¥×¤ò³«»Ï/Ää»ß¤¹¤ë
58 .SH ½ñ¼°
59 .B #include <unistd.h>
60 .br
61 .B #include <asm/page.h>     /* PAGE_SIZE ¤ò¸«¤Ä¤±¤ë¤¿¤á */
62 .br
63 .B #include <sys/swap.h>
64 .sp
65 .BI "int swapon(const char *" path ", int " swapflags );
66 .br
67 .BI "int swapoff(const char *" path );
68 .SH ÀâÌÀ
69 .BR swapon ()
70 ¤Ï
71 .I path
72 ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ä¥Ö¥í¥Ã¥¯¡¦¥Ç¥Ð¥¤¥¹¤Ë¥¹¥ï¥Ã¥×Îΰè¤òÀßÄꤹ¤ë¡£
73 .BR swapoff ()
74 ¤Ï
75 .I path
76 ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ä¥Ö¥í¥Ã¥¯¡¦¥Ç¥Ð¥¤¥¹¤Ø¤Î¥¹¥ï¥Ã¥×¤òÄä»ß¤¹¤ë¡£
77 .PP
78 .BR swapon ()
79 ¤Ï
80 .I swapflags
81 °ú¤­¿ô¤ò¼è¤ë¡£
82 .I swapflags
83 ¤Ë
84 .B SWAP_FLAG_PREFER
85 ¥Ó¥Ã¥È¤¬ÀßÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢¿·¤·¤¤¥¹¥ï¥Ã¥×Îΰè¤Ï¥Ç¥Õ¥©¥ë¥È¤è¤ê¤â¹â¤¤
86 Í¥ÀèÅÙ¤ò»ý¤Ä¡£
87 Í¥ÀèÅÙ¤Ï
88 .I swapflags
89 ¤Ë°Ê²¼¤Î¤è¤¦¤Ë¥³¡¼¥É²½¤µ¤ì¤Æ¤¤¤ë¡£
90 .br
91 .sp
92 .I "    (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK"
93 .br
94 .PP
95 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÆø¢¥×¥í¥»¥¹
96 .RB ( CAP_SYS_ADMIN
97 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Î¤ß¤¬»ÈÍѤǤ­¤ë¡£
98 .SS Í¥ÀèÅÙ
99 ¤½¤ì¤¾¤ì¤Î¥¹¥ï¥Ã¥×Îΰè¤Ï¹â (high) ¤ÈÄã (low) ¤Î¤É¤Á¤é¤«¤ÎÍ¥ÀèÅÙ¤ò»ý¤Ä¡£
100 ¥Ç¥Õ¥©¥ë¥È¤ÎÍ¥ÀèÅÙ¤ÏÄã¤Ç¤¢¤ë¡£
101 Ä㤤ͥÀèÅÙ¤ÎÎΰè¤Ë¤ª¤¤¤Æ¡¢¿·¤·¤¤Îΰè¤Ï¸Å¤¤Îΰè¤è¤ê¤µ¤é¤ËÄ㤤
102 Í¥ÀèÅÙ¤ò»ý¤Ä¡£
103 .PP
104 .I swapflags
105 ¤¬ÀßÄꤵ¤ì¤¿¤â¤Î¤ÏÁ´¤Æ¹â¤¤Í¥ÀèÅ٤Ȥʤꡢ¥Ç¥Õ¥©¥ë¥È¤è¤ê¤â¹â¤¤Í¥ÀèÅÙ¤ò»ý¤Ä¡£
106 »ÈÍѼԤϤ½¤ì¤é¤ËÉé¤Ç¤Ê¤¤Ãͤ¬»ØÄê¤Ç¤­¤ë¡£
107 Â礭¤Ê¿ô»ú¤Ï¹â¤¤Í¥ÀèÅÙ¤ò°ÕÌ£¤¹¤ë¡£
108 .PP
109 ¹â¤¤Í¥ÀèÅÙ¤ÎÎΰ褫¤é½ç¤Ë¥¹¥ï¥Ã¥×¡¦¥Ú¡¼¥¸¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¡£
110 ¤è¤êÄ㤤ͥÀèÅÙ¤ÎÎΰè¤ò»ÈÍѤ¹¤ëÁ°¤Ë¤è¤ê¹â¤¤Í¥ÀèÅÙ¤Î
111 Îΰè¤ò»È¤¤Àڤ롣¤â¤·Æó¤Ä°Ê¾å¤ÎÎΰ褬Ʊ¤¸Í¥ÀèÅÙ¤ò»ý¤Á¡¢
112 »È¤¨¤ëÃæ¤Ç°ìÈֹ⤤ͥÀèÅ٤Ǥ¢¤ì¤Ð¡¢¤½¤ì¤é¤Î¥Ú¡¼¥¸¤Ï´Ö¤Ç
113 ¥é¥¦¥ó¥É¡¦¥í¥Ó¥óÊý¼°¤ÇÇÛʬ¤µ¤ì¤ë¡£
114 .PP
115 Linux 1.3.6 ¤Ë¤ª¤¤¤Æ¡¢¥«¡¼¥Í¥ë¤ÏÄ̾ï¤Ï¤³¤ì¤é¤Îµ¬Â§¤Ë½¾¤Ã¤Æ¤¤¤ë¡£
116 ¤·¤«¤·Îã³°¤â¸ºß¤·¤Æ¤¤¤ë¡£
117 .SH ÊÖ¤êÃÍ
118 À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
119 .I errno
120 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
121 .SH ¥¨¥é¡¼
122 .TP
123 .B EBUSY
124 .RB ( swapon ()
125 ¤Ë¤ª¤¤¤Æ) »ØÄꤵ¤ì¤¿
126 .I path
127 ¤¬´û¤Ë¥¹¥ï¥Ã¥×Îΰè¤È¤·¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£
128 .TP
129 .B EINVAL
130 ¥Õ¥¡¥¤¥ë
131 .I path
132 ¤Ï¸ºß¤¹¤ë¤¬¡¢Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤â¥Ö¥í¥Ã¥¯¡¦¥Ç¥Ð¥¤¥¹¤â»²¾È¤·¤Æ¤¤¤Ê¤¤¡£
133 ¤Þ¤¿¤Ï
134 .BR swapon ()
135 ¤Ë¤ª¤¤¤Æ¡¢»ØÄꤵ¤ì¤¿ path ¤Î¥Õ¥¡¥¤¥ë¤¬Í­¸ú¤Ê¥¹¥ï¥Ã¥×¤Î½ð̾ (signature) ¤ò
136 ´Þ¤ó¤Ç¤¤¤Ê¤¤¤«¡¢tmpfs ¤Î¤è¤¦¤Ê¥¤¥ó¥á¥â¥ê (in-memory) ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à
137 ¾å¤Ë¤¢¤ë¡£
138 ¤Þ¤¿¤Ï
139 .BR swapoff ()
140 ¤Ë¤ª¤¤¤Æ¡¢
141 .I path
142 ¤¬¸½ºß¤Î¤È¤³¤í¥¹¥ï¥Ã¥×Îΰè¤Ç¤Ê¤¤¡£
143 .TP
144 .B ENFILE
145 ¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ÎÁí¿ô¤¬¥·¥¹¥Æ¥à¤ÎÀ©¸Â¤Ë㤷¤¿¡£
146 .TP
147 .B ENOENT
148 ¥Õ¥¡¥¤¥ë
149 .I path
150 ¤¬Â¸ºß¤·¤Ê¤¤¡£
151 .TP
152 .B ENOMEM
153 ¥¹¥ï¥Ã¥×¤ò³«»Ï¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¡¼¤¬¥·¥¹¥Æ¥à¤Ë¤Ê¤¤¡£
154 .TP
155 .B EPERM
156 »ÈÍѼԤ¬
157 .B CAP_SYS_ADMIN
158 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£
159 ¤â¤·¤¯¤Ï¡¢ºÇÂç¿ô¤Î¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤¬¤¹¤Ç¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë
160 (²¼µ­¤Î¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È)¡£
161 .SH ½àµò
162 ¤³¤ì¤é¤Î´Ø¿ô¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï
163 »ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£
164 ÆóÈÖÌܤÎ
165 .I swapflags
166 °ú¤­¿ô¤Ï Linux 1.3.2 ¤«¤éƳÆþ¤µ¤ì¤¿¡£
167 .SH Ãí°Õ
168 ¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ä¥Ñ¥¹¤Ï
169 .BR mkswap (8)
170 ¤Ë¤è¤Ã¤Æ½àÈ÷¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
171
172 »ÈÍѤǤ­¤ë¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤Î¿ô¤Ë¤Ï¾å¸Â¤¬¤¢¤ê¡¢¤½¤Î¾å¸Â¤Ï
173 ¥«¡¼¥Í¥ëÄê¿ô
174 .B MAX_SWAPFILES
175 ¤ÇÄêµÁ¤µ¤ì¤ë¡£
176 .B MAX_SWAPFILES
177 ¤ÎÃͤϡ¢¥«¡¼¥Í¥ë 2.4.10 ¤è¤êÁ°¤Ç¤Ï 8¡¢
178 ¥«¡¼¥Í¥ë 2.4.10 °Ê¹ß¤Ç¤Ï 32 ¤Ç¤¢¤ë¡£
179 ¥«¡¼¥Í¥ë 2.6.18 °Ê¹ß¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¤¬
180 .B CONFIG_MIGRATION
181 ¥ª¥×¥·¥ç¥ó¤òÍ­¸ú¤Ë¤·¤ÆºîÀ®¤µ¤ì¤¿¾ì¹ç¡¢
182 ¤³¤Î¾å¸Â¤¬ 2 ¾¯¤Ê¤¤ÃÍ (¤Ä¤Þ¤ê 30) ¤È¤Ê¤ë
183 (¤³¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢
184 .BR mbind (2)
185 ¤È
186 .BR migrate_pages (2)
187 ¤Î¥Ú¡¼¥¸¡¦¥Þ¥¤¥°¥ì¡¼¥·¥ç¥óµ¡Ç½ÍѤ˥¹¥ï¥Ã¥×¡¦¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¡¼¤¬
188 Æó¤ÄͽÌ󤵤ì¤ë)¡£
189 .SH ´ØÏ¢¹àÌÜ
190 .BR mkswap (8),
191 .BR swapoff (8),
192 .BR swapon (8)