OSDN Git Service

19067a05f67ebf25327578b301ede5761f5d831c
[linuxjm/LDP_man-pages.git] / release / man2 / pivot_root.2
1 .\" Copyright (C) 2000 by Werner Almesberger
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" May be distributed under GPL
5 .\" %%%LICENSE_END
6 .\"
7 .\" Written 2000-02-23 by Werner Almesberger
8 .\" Modified 2004-06-17 Michael Kerrisk <mtk.manpages@gmail.com>
9 .\"
10 .\"*******************************************************************
11 .\"
12 .\" This file was generated with po4a. Translate the source file.
13 .\"
14 .\"*******************************************************************
15 .\"
16 .\" Japanese Version Copyright (c) 2000 NAKANO Takeo all rights reserved.
17 .\" Translated Wed Jun 14 2000 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
18 .\"
19 .TH PIVOT_ROOT 2 2012\-07\-13 Linux "Linux Programmer's Manual"
20 .SH 名前
21 pivot_root \- change the root filesystem
22 .SH 書式
23 \fBint pivot_root(const char *\fP\fInew_root\fP\fB, const char *\fP\fIput_old\fP\fB);\fP
24
25 \fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。
26 .SH 説明
27 .\"
28 .\" The
29 .\" .B CAP_SYS_ADMIN
30 .\" capability is required.
31 \fBpivot_root\fP()  moves the root filesystem of the calling process to the
32 directory \fIput_old\fP and makes \fInew_root\fP the new root filesystem of the
33 calling process.
34
35 The typical use of \fBpivot_root\fP()  is during system startup, when the
36 system mounts a temporary root filesystem (e.g., an \fBinitrd\fP), then mounts
37 the real root filesystem, and eventually turns the latter into the current
38 root of all relevant processes or threads.
39
40 古い root ディレクトリを使っていた全てのプロセスやスレッドの カレント root とカレントワーキングディレクトリを、
41 \fBpivot_root\fP()  が変更するかどうかはわからない。 \fBpivot_root\fP()  の呼びだしプロセスは、古い root
42 やカレントワーキングディレクトリを使っていた プロセスが、いずれの場合でも正しく動作することを保証しなければならない。
43 これを簡単に行うには、それらのプロセスの root と カレントワーキングディレクトリを \fBpivot_root\fP()  を呼び出す前に
44 \fInew_root\fP に変更しておくことである。
45
46 The paragraph above is intentionally vague because the implementation of
47 \fBpivot_root\fP()  may change in the future.  At the time of writing,
48 \fBpivot_root\fP()  changes root and current working directory of each process
49 or thread to \fInew_root\fP if they point to the old root directory.  This is
50 necessary in order to prevent kernel threads from keeping the old root
51 directory busy with their root and current working directory, even if they
52 never access the filesystem in any way.  In the future, there may be a
53 mechanism for kernel threads to explicitly relinquish any access to the
54 filesystem, such that this fairly intrusive mechanism can be removed from
55 \fBpivot_root\fP().
56
57 これは呼び出し元のプロセスについても当てはまることに注意。 \fBpivot_root\fP()
58 がカレントプロセスのカレントワーキングディレクトリに影響するかどうかは 分からない。したがって \fBpivot_root\fP()  の直後に
59 \fBchdir("/")\fP を呼び出すとよい。
60
61 \fInew_root\fP および \fIput_old\fP には以下の制限がある:
62 .IP \- 3
63 ディレクトリでなければならない。
64 .IP \- 3
65 \fInew_root\fP and \fIput_old\fP must not be on the same filesystem as the current
66 root.
67 .IP \- 3
68 \fIput_old\fP は \fInew_root\fP 以下になければならない。すなわち \fIput_old\fP を差す文字列に 1 個以上の \fI../\fP
69 を付けることによって \fInew_root\fP と同じディレクトリが得られなければならない。
70 .IP \- 3
71 No other filesystem may be mounted on \fIput_old\fP.
72 .PP
73 利用例については \fBpivot_root\fP(8)  を参照のこと。
74
75 If the current root is not a mount point (e.g., after \fBchroot\fP(2)  or
76 \fBpivot_root\fP(), see also below), not the old root directory, but the mount
77 point of that filesystem is mounted on \fIput_old\fP.
78
79 \fInew_root\fP does not have to be a mount point.  In this case,
80 \fI/proc/mounts\fP will show the mount point of the filesystem containing
81 \fInew_root\fP as root (\fI/\fP).
82 .SH 返り値
83 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
84 .SH エラー
85 \fBpivot_root\fP()  は \fBstat\fP(2)  の返すあらゆるエラーを (\fIerrno\fP に)
86 返す可能性がある。さらに以下を返すことがある:
87 .TP 
88 \fBEBUSY\fP
89 \fInew_root\fP or \fIput_old\fP are on the current root filesystem, or a
90 filesystem is already mounted on \fIput_old\fP.
91 .TP 
92 \fBEINVAL\fP
93 \fIput_old\fP が \fInew_root\fP の下層にない。
94 .TP 
95 \fBENOTDIR\fP
96 \fInew_root\fP または \fIput_old\fP がディレクトリでない。
97 .TP 
98 \fBEPERM\fP
99 呼び出し元のプロセスが \fBCAP_SYS_ADMIN\fP ケーパビリティを持っていない。
100 .SH バージョン
101 \fBpivot_root\fP()  は Linux 2.3.41 で導入された。
102 .SH 準拠
103 \fBpivot_root\fP()  は Linux に固有のものなので、移植性はない。
104 .SH 注意
105 glibc はこのシステムコールに対するラッパー関数を提供していない。 \fBsyscall\fP(2)  を使って呼び出すこと。
106 .SH バグ
107 \fBpivot_root\fP()  はシステムの他のプロセス全ての root と カレントワーキングディレクトリとを変更しなくてもよいはずである。
108
109 \fBpivot_root\fP()  の使い方がもうちょっと曖昧になると、 あっという間にわけのわからない状態になってしまうだろう
110 .SH 関連項目
111 \fBchdir\fP(2), \fBchroot\fP(2), \fBstat\fP(2), \fBinitrd\fP(4), \fBpivot_root\fP(8)
112 .SH この文書について
113 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
114 である。プロジェクトの説明とバグ報告に関する情報は
115 http://www.kernel.org/doc/man\-pages/ に書かれている。