OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / release / man2 / unshare.2
index 8b4268f..97c39eb 100644 (file)
@@ -62,7 +62,7 @@ _BSD_SOURCE || _SVID_SOURCE
 .SH 説明
 \fBunshare\fP()  を使うと、プロセスは他のプロセスと現在共有している 実行コンテキストの一部を分離することができる。
 実行コンテキストの一部、たとえばマウント名前空間 (mount namespace)  などは、新しいプロセスを \fBfork\fP(2)  または
-\fBvfork\fP(2)  を使って生成したときに、暗黙のうちに共有される。 一方、仮想メモリなどは、 \fBclone\fP(2)
+\fBvfork\fP(2)  ã\82\92使ã\81£ã\81¦ç\94\9fæ\88\90ã\81\97ã\81\9fã\81¨ã\81\8dã\81«ã\80\81æ\9a\97é»\99ã\81®ã\81\86ã\81¡ã\81«å\85±æ\9c\89ã\81\95ã\82\8cã\82\8bã\80\82 ä¸\80æ\96¹ã\80\81ä»®æ\83³ã\83¡ã\83¢ã\83ªã\83¼ã\81ªã\81©ã\81¯ã\80\81 \fBclone\fP(2)
 を使ってプロセスを生成するときに、明示的に共有することを要求できる。
 
 \fBunshare\fP()  の主な利用法は、プロセスが新しいプロセスを生成することなく、 共有実行コンテキストを制御することである。
@@ -71,8 +71,8 @@ _BSD_SOURCE || _SVID_SOURCE
 で指定する:
 .TP 
 \fBCLONE_FILES\fP
-\fBclone\fP(2)  \fBCLONE_FILES\fP フラグの効果を取り消す。 ファイルディスクリプタテーブルを共有させず、
-呼び出し元プロセスは他のプロセスとファイルディスクリプタを共有しなくなる。
+\fBclone\fP(2)  \fBCLONE_FILES\fP ã\83\95ã\83©ã\82°ã\81®å\8a¹æ\9e\9cã\82\92å\8f\96ã\82\8aæ¶\88ã\81\99ã\80\82 ã\83\95ã\82¡ã\82¤ã\83«ã\83\87ã\82£ã\82¹ã\82¯ã\83ªã\83\97ã\82¿ã\83¼ã\83\86ã\83¼ã\83\96ã\83«ã\82\92å\85±æ\9c\89ã\81\95ã\81\9bã\81\9aã\80\81
\91¼ã\81³å\87ºã\81\97å\85\83ã\83\97ã\83­ã\82»ã\82¹ã\81¯ä»\96ã\81®ã\83\97ã\83­ã\82»ã\82¹ã\81¨ã\83\95ã\82¡ã\82¤ã\83«ã\83\87ã\82£ã\82¹ã\82¯ã\83ªã\83\97ã\82¿ã\83¼ã\82\92å\85±æ\9c\89ã\81\97ã\81ªã\81\8fã\81ªã\82\8bã\80\82
 .TP 
 \fBCLONE_FS\fP
 \fBclone\fP(2)  \fBCLONE_FS\fP フラグの効果を取り消す。ファイルシステム属性を共有させず、呼び出し元プロセスは、ルートディレクトリ
@@ -104,33 +104,25 @@ System\ V IPC 名前空間を共有せず、呼び出し元プロセスは 他
 ケーパビリティが必要である。
 .TP 
 \fBCLONE_NEWPID\fP (Linux 3.8 以降)
-This flag has the same effect as the \fBclone\fP(2)  \fBCLONE_NEWPID\fP flag.
-Unshare the PID namespace, so that the calling process has a new PID
-namespace for its children which is not shared with any previously existing
-process.  The calling process is \fInot\fP moved into the new namespace.  The
-first child created by the calling process will have the process ID 1 and
-will assume the role of \fBinit\fP(1)  in the new namespace.  \fBCLONE_NEWPID\fP
-automatically implies \fBCLONE_THREAD\fP as well.  Use of \fBCLONE_NEWPID\fP
-requires the \fBCAP_SYS_ADMIN\fP capability.  For further information, see
-\fBpid_namespaces\fP(7).
+このフラグは \fBclone\fP(2) \fBCLONE_NEWPID\fP フラグと同じ効果を持つ。 PID 名前空間を共有しない。 呼び出し元プロセスは、
+すでに存在するどのプロセスとも共有されない新しい PID 名前空間を、 自身の子プロセス用に持つことになる。
+このプロセスにより作成される最初の子プロセスはプロセス ID 1 を持ち、 この新しい名前空間において \fBinit\fP(1) の役割を持つとみなされる。
+\fBCLONE_NEWPID\fP を指定すると、自動的に \fBCLONE_THREAD\fP も指定されたものとみなされる。 \fBCLONE_NEWPID\fP
+を使用するには \fBCAP_SYS_ADMIN\fP ケーパビリティが必要である。 詳細な情報は \fBpid_namespaces\fP(7) を参照。
 .TP 
 \fBCLONE_NEWUSER\fP (Linux 3.8 以降)
-This flag has the same effect as the \fBclone\fP(2)  \fBCLONE_NEWUSER\fP flag.
-Unshare the user namespace, so that the calling process is moved into a new
-user namespace which is not shared with any previously existing process.  As
-with the child process created by \fBclone\fP(2)  with the \fBCLONE_NEWUSER\fP
-flag, the caller obtains a full set of capabilities in the new namespace.
+このフラグは \fBclone\fP(2) \fBCLONE_NEWUSER\fP フラグと同じ効果を持つ。 ユーザー名前空間を共有せず、
+呼び出し元プロセスはすでに存在するどのプロセスとも共有されない新しいユーザー名前空間に移動される。 \fBCLONE_NEWUSER\fP フラグを指定して
+\fBclone\fP(2) で作成された子プロセスと同様に、 呼び出し元は新しい名前空間ですべてのケーパビリティを獲得する。
 .IP
 .\" commit e66eded8309ebf679d3d3c1f5820d1f2ca332c71
 .\" https://lwn.net/Articles/543273/
-\fBCLONE_NEWUSER\fP requires that the calling process is not threaded;
-specifying \fBCLONE_NEWUSER\fP automatically implies \fBCLONE_THREAD\fP.  Since
-Linux 3.9, \fBCLONE_NEWUSER\fP also automatically implies \fBCLONE_FS\fP.
-\fBCLONE_NEWUSER\fP requires that the user ID and group ID of the calling
-process are mapped to user IDs and group IDs in the user namespace of the
-calling process at the time of the call.
+\fBCLONE_NEWUSER\fP を使うには、呼び出し元プロセスがスレッド化されていないことが必要である。 \fBCLONE_NEWUSER\fP
+を指定すると、自動的に \fBCLONE_THREAD\fP が指定されたものとみなされる。 Linux 3.9 以降では、 \fBCLONE_NEWUSER\fP
+が指定された場合 \fBCLONE_FS\fP も指定されたとみなされる。 \fBCLONE_NEWUSER\fP を使うには、呼び出し元プロセスのユーザー ID
+とグループ ID が、 呼び出した時点で、 呼び出し元プロセスのユーザー名前空間のユーザー ID とグループ ID にマッピングされている必要がある。
 
-For further information on user namespaces, see \fBuser_namespaces\fP(7).
+ユーザー名前空間の詳細は \fBuser_namespaces\fP(7) を参照。
 .TP 
 \fBCLONE_NEWUTS\fP (Linux 2.6.19 以降)
 このフラグは \fBclone\fP(2) \fBCLONE_NEWUTS\fP フラグと同じ効果を持つ。 UTS
@@ -143,12 +135,10 @@ IPC 名前空間を共有せず、呼び出し元プロセスは他のプロセ
 .\" commit 9edff4ab1f8d82675277a04e359d0ed8bf14a7b7
 .\" CLONE_NEWNS If CLONE_SIGHAND is set and signals are also being shared
 .\" (i.e., current->signal->count > 1), force CLONE_THREAD.
-This flag reverses the effect of the \fBclone\fP(2)  \fBCLONE_SYSVSEM\fP flag.
-Unshare System\ V semaphore adjustment (\fIsemadj\fP)  values, so that the
-calling process has a new empty \fIsemadj\fP list that is not shared with any
-other process.  If this is the last process that has a reference to the
-process's current \fIsemadj\fP list, then the adjustments in that list are
-applied to the corresponding semaphores, as described in \fBsemop\fP(2).
+このフラグは \fBclone\fP(2) \fBCLONE_SYSVSEM\fP フラグの効果を逆転させる。 System\ V セマフォの調整値
+(\fIsemadj\fP) を共有せず、 呼び出し元プロセスは他のプロセスとは共有されない新しい空の \fIsemadj\fP リストを持つ。
+そのプロセスが、自分の現在の \fIsemadj\fP リストへの参照を持つ最後のプロセスであれば、 このリストの調整値は対応するセマフォに適用される
+(\fBsemop\fP(2) に説明がある通り)。
 .PP
 .\" As at 3.9, the following forced implications also apply,
 .\" although the relevant flags are not yet implemented.
@@ -156,13 +146,11 @@ applied to the corresponding semaphores, as described in \fBsemop\fP(2).
 .\" If CLONE_VM is set, force CLONE_SIGHAND.
 .\"
 .\" See kernel/fork.c::check_unshare_flags()
-In addition, \fBCLONE_THREAD\fP, \fBCLONE_SIGHAND\fP, and \fBCLONE_VM\fP can be
-specified in \fIflags\fP if the caller is single threaded (i.e., it is not
-sharing its address space with another process or thread).  In this case,
-these flags have no effect.  (Note also that specifying \fBCLONE_THREAD\fP
-automatically implies \fBCLONE_VM\fP, and specifying \fBCLONE_VM\fP automatically
-implies \fBCLONE_SIGHAND\fP.)  If the process is multithreaded, then the use of
-these flags results in an error.
+上記に加えて、 呼び出し元がシングルスレッドの場合 (すなわち別のプロセスやスレッドとアドレス空間を共有していない場合)、
+\fBCLONE_THREAD\fP, \fBCLONE_SIGHAND\fP, \fBCLONE_VM\fP を指定することができる。 この場合、
+これらのフラグは効果を持たない。 (\fBCLONE_THREAD\fP を指定すると自動的に \fBCLONE_VM\fP が指定されたとみなされ、
+\fBCLONE_VM\fP を指定すると自動的に \fBCLONE_SIGHAND\fP が指定されたとみなされる点に注意してほしい。)
+プロセスがマルチスレッドの場合、 これらのフラグを使用するとエラーとなる。
 .PP
 \fIflags\fP に 0 が指定された場合、 \fBunshare\fP()  は何も行わないので、
 呼び出し元プロセスの実行コンテキストは、何も変更されない。
@@ -174,31 +162,28 @@ these flags results in an error.
 \fIflags\fP に不正なビットが指定された。
 .TP 
 \fBEINVAL\fP
-\fBCLONE_THREAD\fP, \fBCLONE_SIGHAND\fP, or \fBCLONE_VM\fP was specified in \fIflags\fP,
-and the caller is multithreaded.
+\fBCLONE_THREAD\fP, \fBCLONE_SIGHAND\fP, \fBCLONE_VM\fP が \fIflags\fP に指定されたが、
+呼び出したプロセスはマルチスレッドである。
 .TP 
 \fBENOMEM\fP
-呼び出し元のコンテキストのうち共有を解除する必要がある部分をコピーするために、 十分なメモリが確保できなかった。
\91¼ã\81³å\87ºã\81\97å\85\83ã\81®ã\82³ã\83³ã\83\86ã\82­ã\82¹ã\83\88ã\81®ã\81\86ã\81¡å\85±æ\9c\89ã\82\92解é\99¤ã\81\99ã\82\8bå¿\85è¦\81ã\81\8cã\81\82ã\82\8bé\83¨å\88\86ã\82\92ã\82³ã\83\94ã\83¼ã\81\99ã\82\8bã\81\9fã\82\81ã\81«ã\80\81 å\8d\81å\88\86ã\81ªã\83¡ã\83¢ã\83ªã\83¼ã\81\8c確ä¿\9dã\81§ã\81\8dã\81ªã\81\8bã\81£ã\81\9fã\80\82
 .TP 
 \fBEPERM\fP
 呼び出し元プロセスはこの操作を行うのに必要な特権を持っていなかった。
 .TP 
 \fBEPERM\fP
-\fBCLONE_NEWUSER\fP was specified in \fIflags\fP, but either the effective user ID
-or the effective group ID of the caller does not have a mapping in the
-parent namespace (see \fBuser_namespaces\fP(7)).
+\fBCLONE_NEWUSER\fP が \fIflags\fP に指定されたが、 呼び出し元の実効ユーザー ID もしくは実効グループ ID
+が親名前空間にマッピングがない (\fBuser_namespaces\fP(7) 参照)。
 .TP 
 \fBEPERM\fP (Linux 3.9 以降)
 .\" commit 3151527ee007b73a0ebd296010f1c0454a919c7d
 .\" FIXME What is the rationale for this restriction?
-\fBCLONE_NEWUSER was specified in\fP \fIflags\fP and the caller is in a chroot
-environment (i.e., the caller's root directory does not match the root
-directory of the mount namespace in which it resides).
+\fBCLONE_NEWUSER\fP が \fIflags\fP に指定され、 呼び出し元が chroot された環境にいる (すなわち、呼び出し元の root
+ディレクトリが呼び出し元が属するマウント名前空間の root ディレクトリに一致しない)。
 .TP 
 \fBEUSERS\fP (Linux 3.11 以降)
-\fBCLONE_NEWUSER\fP was specified in \fIflags\fP, and the call would cause the
-limit on the number of nested user namespaces to be exceeded.  See
-\fBuser_namespaces\fP(7).
+\fBCLONE_NEWUSER\fP が \fIflags\fP に指定されており、 この呼び出しによりネストされたユーザー名前空間数の上限を超えてしまう。
+\fBuser_namespaces\fP(7) を参照。
 .SH バージョン
 \fBunshare\fP()  システムコールは Linux カーネル 2.6.16 で追加された。
 .SH 準拠
@@ -229,11 +214,9 @@ limit on the number of nested user namespaces to be exceeded.  See
 \fBCLONE_THREAD\fP, \fBCLONE_VM\fP の効果を取り消すためのフラグが実装されていない。
 これらの機能は、必要であれば将来追加されるかもしれない。
 .SH 例
-The program below provides a simple implementation of the \fBunshare\fP(1)
-command, which unshares one or more namespaces and executes the command
-supplied in its command\-line arguments.  Here's an example of the use of
-this program, running a shell in a new mount namespace, and verifying that
-the original shell and the new shell are in separate mount namespaces:
+以下のプログラムは \fBunshare\fP(1) コマンドの簡単な実装である。 このコマンドは、1 つ以上の名前空間の unshare を行ってから、
+コマンドライン引き数で指定されたコマンドを実行する。 以下はこのプログラムの使用例である。 新しいマウント名前空間でシェルを実行し、
+元のシェルと新しいシェルが別のマウント名前空間にいることを確認している。
 .in +4n
 .nf
 
@@ -246,8 +229,7 @@ mnt:[4026532325]
 .fi
 .in
 
-The differing output of the two \fBreadlink\fP(1)  commands shows that the two
-shells are in different mount namespaces.
+2 つの \fBreadlink\fP(1) コマンドの出力が違うことから、 2 つのシェルは異なるマウント名前空間にいることが分かる。
 .SS プログラムのソース
 \&
 .nf
@@ -317,6 +299,6 @@ main(int argc, char *argv[])
 
 Linux カーネルソース内の \fIDocumentation/unshare.txt\fP
 .SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.76 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
 である。プロジェクトの説明とバグ報告に関する情報は
 http://www.kernel.org/doc/man\-pages/ に書かれている。