OSDN Git Service

Retire LDP man-pages repository
[linuxjm/LDP_man-pages.git] / draft / man2 / swapon.2
diff --git a/draft/man2/swapon.2 b/draft/man2/swapon.2
deleted file mode 100644 (file)
index 2df52fb..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
-.\"
-.\" %%%LICENSE_START(VERBATIM)
-.\" 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.
-.\" %%%LICENSE_END
-.\"
-.\" 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.
-.\"
-.\" FIXME Linux 3.11 added SWAP_FLAG_DISCARD_ONCE and SWAP_FLAG_DISCARD_PAGES
-.\"    commit dcf6b7ddd7df8965727746f89c59229b23180e5a
-.\"    Author: Rafael Aquini <aquini@redhat.com>
-.\"    Date:   Wed Jul 3 15:02:46 2013 -0700
-.\"
-.\"*******************************************************************
-.\"
-.\" This file was generated with po4a. Translate the source file.
-.\"
-.\"*******************************************************************
-.\"
-.\" 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
-.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
-.\"
-.TH SWAPON 2 2014\-05\-28 Linux "Linux Programmer's Manual"
-.SH 名前
-swapon, swapoff \- ファイル/デバイスへのスワップを開始/停止する
-.SH 書式
-\fB#include <unistd.h>\fP
-.br
-\fB#include <sys/swap.h>\fP
-.sp
-\fBint swapon(const char *\fP\fIpath\fP\fB, int \fP\fIswapflags\fP\fB);\fP
-.br
-\fBint swapoff(const char *\fP\fIpath\fP\fB);\fP
-.SH 説明
-\fBswapon\fP()  は \fIpath\fP で指定されたファイルやブロックデバイスにスワップ領域を設定する。 \fBswapoff\fP()  は
-\fIpath\fP で指定されたファイルやブロックデバイスへのスワップを停止する。
-.PP
-\fBswapon\fP() の \fIswapflags\fP 引き数に \fBSWAP_FLAG_PREFER\fP フラグが指定された場合、
-新しいスワップ領域はデフォルトよりも高い優先度を持つ。
-優先度は以下のように変換されて \fIswapflags\fP に指定する。
-.br
-.sp
-\fI(prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK\fP
-.br
-.PP
-\fBSWAP_FLAG_DISCARD\fP フラグが \fBswapon\fP() の \fIswapflags\fP 引き数に指定された場合、
-スワップデバイスが破棄 (discard) 操作や trim 操作をサポートしている場合には、
-解放されたスワップページは再利用される前に破棄される
-(これにより、SSD (Solid State Device) によっては性能が向上することがあるが、
-たいていは性能の向上はない)。
-「注意」も参照のこと。
-.PP
-これらの関数は特権プロセス (\fBCAP_SYS_ADMIN\fP ケーパビリティ (capability) を持つプロセス) のみが使用できる。
-.SS 優先度
-それぞれのスワップ領域は高 (high) と低 (low) のどちらかの優先度を持つ。 デフォルトの優先度は低である。
-低い優先度の領域において、新しい領域は古い領域よりさらに低い 優先度を持つ。
-.PP
-\fIswapflags\fP が設定されたものは全て高い優先度となり、デフォルトよりも高い優先度を持つ。 使用者はそれらに負でない値が指定できる。
-大きな数字は高い優先度を意味する。
-.PP
-高い優先度の領域から順にスワップページとして使用される。 より低い優先度の領域を使用する前により高い優先度の
-領域を使い切る。もし二つ以上の領域が同じ優先度を持ち、 使える中で一番高い優先度であれば、それらのページは間で ラウンドロビン方式で配分される。
-.PP
-Linux 1.3.6 において、カーネルは通常はこれらの規則に従っている。 しかし例外も存在している。
-.SH 返り値
-成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
-.SH エラー
-.TP 
-\fBEBUSY\fP
-(\fBswapon\fP()  において) 指定された \fIpath\fP が既にスワップ領域として使用されている。
-.TP 
-\fBEINVAL\fP
-ファイル \fIpath\fP は存在するが、通常のファイルもブロックデバイスも参照していない。
-.TP 
-\fBEINVAL\fP
-(\fBswapon\fP()) 指定されたパスが有効なスワップの署名 (signature) を含んでいないか、tmpfs
-のようなインメモリーファイルシステム上にある。
-.TP 
-\fBEINVAL\fP (Linux 3.4 以降)
-(\fBswapon\fP()) \fIflags\fP に無効なフラグ値が指定された。
-.TP 
-\fBEINVAL\fP
-(\fBswapoff\fP()) \fIpath\fP が現在スワップ領域ではない。
-.TP 
-\fBENFILE\fP
-オープンされたファイルの総数がシステム全体の上限に達していた。
-.TP 
-\fBENOENT\fP
-ファイル \fIpath\fP が存在しない。
-.TP 
-\fBENOMEM\fP
-スワップを開始するのに十分なメモリーがシステムにない。
-.TP 
-\fBEPERM\fP
-使用者が \fBCAP_SYS_ADMIN\fP ケーパビリティを持っていない。 もしくは、最大数のスワップファイルがすでに使用されている
-(下記の「注意」の節を参照)。
-.SH 準拠
-これらの関数は Linux 特有であり、移植を意図したプログラムでは 使用してはいけない。 二番目の \fIswapflags\fP 引き数は Linux
-1.3.2 から導入された。
-.SH 注意
-パーティションやパスは \fBmkswap\fP(8)  によって準備されていなければならない。
-
-使用できるスワップファイルの数には上限があり、その上限は カーネル定数 \fBMAX_SWAPFILES\fP で定義される。
-\fBMAX_SWAPFILES\fP の値は、カーネル 2.4.10 より前では 8、 カーネル 2.4.10 以降では 32 である。 カーネル
-2.6.18 以降では、カーネルが \fBCONFIG_MIGRATION\fP オプションを有効にして作成された場合、 この上限が 2 少ない値 (つまり
-30) となる (このカーネルでは、 \fBmbind\fP(2)  と \fBmigrate_pages\fP(2)
-のページマイグレーション機能用にスワップテーブルのエントリーが 二つ予約される)。 カーネル 2.6.32 以降では、カーネルが
-\fBCONFIG_MEMORY_FAILURE\fP オプションを有効にして作成された場合、 この上限がさらに 1 少ない値となる。
-
-.\" To be precise: 2.6.35.5
-スワップページの破棄は、カーネル 2.6.29 で導入され、その後カーネル 2.6.36 で
-\fBSWAP_FLAG_DISCARD\fP フラグが指定された場合にだけ実行されるようになったが、
-今でも、このフラグビットが指定されていない場合であっても、
-\fBswapon\fP が呼び出された際にスワップ領域全体の破棄が行われる。
-.SH 関連項目
-\fBmkswap\fP(8), \fBswapoff\fP(8), \fBswapon\fP(8)
-.SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
-である。プロジェクトの説明とバグ報告に関する情報は
-http://www.kernel.org/doc/man\-pages/ に書かれている。