File: swapon.2

package info (click to toggle)
manpages-ja 0.5.0.0.20061115-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 19,788 kB
  • ctags: 4
  • sloc: sh: 13,215; perl: 157; makefile: 117
file content (170 lines) | stat: -rw-r--r-- 5,168 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
.\" 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@gmx.net>
.\" Modified 2004-10-10 by aeb
.\" 2004-12-14 mtk, Anand Kumria: added new errors
.\"
.\" 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>
.\"
.\"WORD:	swap			å
.\"WORD:	block device		֥åǥХ
.\"WORD:	super-user		ѡ桼
.\"WORD:	round robin		饦ɡӥ
.\"WORD:	partition		ѡƥ
.\"WORD:	page			ڡ
.\"WORD:	kernel			ͥ
.\"
.TH SWAPON 2 2004-10-10 "Linux 2.6.7" "Linux Programmer's Manual"
.SH ̾
swapon, swapoff \- ե/ǥХؤΥå (swap) 򳫻/ߤ
.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
ǻꤵ줿ե֥åǥХ (block device) 
åΰ (swap area) ꤹ롣
.BR swapoff ()

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

.I swapflags
.I swapflags

.I SWAP_FLAG_PREFER
ӥåȤꤵ줿ϡåΰϥǥեȤ⤤
ͥ (priority) ġ
ͥ٤
.I swapflags
˰ʲΤ褦˥ɲƤ롣
.br
.sp
.I "    (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK"
.br
.PP
δؿøץ
.RB ( CAP_SYS_ADMIN
ѥӥƥ (capability) ĥץ) ΤߤѤǤ롣
.SH ͥ
줾ΥåΰϹ⤤ (high) 㤤 (low) Τɤ餫
ͥ٤ġǥեȤͥ٤㤤
㤤ͥ٤ΰˤơΰϸŤΰꤵ㤤
ͥ٤ġ
.PP
.I swapflags
ꤵ줿Τƹ⤤ͥ٤ȤʤꡢǥեȤ⤤ͥ٤ġ
Ѽ (caller) ϤǤʤͤǤ롣
礭ʿϹ⤤ͥ٤̣롣
.PP
⤤ͥ٤ΰ褫˥åסڡ (swap page) ȤƻѤ롣
㤤ͥ٤ΰѤˤ⤤ͥ٤
ΰȤڤ롣⤷İʾΰ褬Ʊͥ٤
Ȥǰֹ⤤ͥ٤ǤСΥڡϴ֤
饦ɡӥ (round robin) ʬ롣
.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) ʤ
ޤ
.BR swapoff ()
ˤơ
.I path
ߤΤȤåΰǤʤ
.TP
.B ENFILE
ץ󤵤줿եƥ¤ã
.TP
.B ENOENT
ե
.I path 
¸ߤʤ
.TP
.B ENOMEM
åפ򳫻ϤΤ˽ʬʥ꡼ƥˤʤ
.TP
.B EPERM
ѼԤ
.B CAP_SYS_ADMIN
ѥӥƥäƤʤ
.B MAX_SWAPFILES
( 8; Linux 2.4.10 ʹߤ 32) ĤƤΥåפѤƤ롣
.SH 
δؿ Linux ͭǤꡢܿտޤץǤ
ѤƤϤʤ
ܤ
.I swapflags
 Linux 1.3.2 Ƴ줿
.SH 
ѡƥ (partition) ѥ
.BR mkswap (8)
ˤäƽƤʤФʤʤ
.SH Ϣ
.BR mkswap (8),
.BR swapoff (8),
.BR swapon (8)