OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man2 / umount.2
1 .\" Copyright (C) 1993 Rickard E. Faith <faith@cs.unc.edu>
2 .\" and Copyright (C) 1994 Andries E. Brouwer <aeb@cwi.nl>
3 .\" and Copyright (C) 2002, 2005 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\"
5 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .\" 2008-10-06, mtk: Created this as a new page by splitting
28 .\"     umount/umount2 material out of mount.2
29 .\"
30 .\"*******************************************************************
31 .\"
32 .\" This file was generated with po4a. Translate the source file.
33 .\"
34 .\"*******************************************************************
35 .\"
36 .\" Japanese Version Copyright (c) 2008  Akihiro MOTOKI
37 .\"         all rights reserved.
38 .\" Translated 2008-11-20, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.13
39 .\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
40 .\"
41 .TH UMOUNT 2 2010\-06\-19 Linux "Linux Programmer's Manual"
42 .SH 名前
43 umount, umount2 \- ファイルシステムをアンマウントする
44 .SH 書式
45 .nf
46 \fB#include <sys/mount.h>\fP
47 .sp
48 \fBint umount(const char *\fP\fItarget\fP\fB);\fP
49 .sp
50 \fBint umount2(const char *\fP\fItarget\fP\fB, int \fP\fIflags\fP\fB);\fP
51 .fi
52 .SH 説明
53 .\" Note: the kernel naming differs from the glibc naming
54 .\" umount2 is the glibc name for what the kernel now calls umount
55 .\" and umount is the glibc name for oldumount
56 \fBumount\fP()  と \fBumount2\fP()  は \fItarget\fP にマウントされている (最上位の) ファイルシステムを外す。
57
58 ファイルシステムのアンマウントを行うには、 適切な権限 (Linux では \fBCAP_SYS_ADMIN\fP ケーパビリティ) が必要である。
59
60 Linux 2.1.116 から、 \fBumount2\fP()  システムコールが追加された。これは \fBumount\fP()  と同様に
61 \fItarget\fP をアンマウントするが、 \fIflags\fP が追加されており、操作時の振る舞いを制御できる。
62 .TP 
63 \fBMNT_FORCE\fP (2.1.116 以降)
64 使用中 (busy) でも強制的にアンマウントを実行する。 これを行うとデータを失う可能性がある。 (NFS マウント専用)
65 .TP 
66 \fBMNT_DETACH\fP (2.4.11 以降)
67 遅延アンマウントを行う。マウントポイントに対する新規のアクセスは 不可能となり、実際のアンマウントはマウントポイントがビジーで なくなった時点で行う。
68 .TP 
69 \fBMNT_EXPIRE\fP (Linux 2.6.8 以降)
70 マウントポイントに期限切れの印をつける。 マウントポイントが現在使用中でない場合、このフラグをつけて \fBumount2\fP()  を初めて呼び出すと
71 \fBEAGAIN\fP エラーで失敗するが、マウントポイントには期限切れ (expire)  の印がつけられる。
72 そのマウントポイントはいずれかのプロセスがアクセスしない限り 期限切れの印がついたままとなる。 もう一度 \fBMNT_EXPIRE\fP をつけて
73 \fBumount2\fP()  を呼び出すと、期限切れの印のついたマウントポイントが アンマウントされる。 このフラグを \fBMNT_FORCE\fP もしくは
74 \fBMNT_DETACH\fP と同時に指定することはできない。
75 .TP 
76 \fBUMOUNT_NOFOLLOW\fP (Linux 2.6.34 以降)
77 .\" Later added to 2.6.33-stable
78 \fItarget\fP がシンボリックリンクの場合に、シンボリックリンクの展開を行わない。
79 このフラグを使うと、 \fIroot\fP に set\-user\-ID されたプログラムにおいて、
80 非特権ユーザがファイルシステムのアンマウントをできてしまうという
81 セキュリティ問題を回避することができる。
82 .SH 返り値
83 成功した場合、0 が返される。 失敗した場合、 \-1 が返され、 \fIerrno\fP に適切な値がセットされる。
84 .SH エラー
85 以下に示すエラーは、ファイルシステムに依存しないものである。 それぞれのファイルシステムタイプには固有のエラーが存在する場合があり、
86 独自の動作をすることもある。詳しくは Linux カーネルのソースを見て欲しい。
87 .TP 
88 \fBEAGAIN\fP
89 \fBMNT_EXPIRE\fP を指定した \fBumount2\fP()  の呼び出しで、正常に未使用のファイルシステムに期限切れの印を つけることができた。
90 .TP 
91 \fBEBUSY\fP
92 使用中 (busy) のため、 \fItarget\fP をアンマウントできなかった。
93 .TP 
94 \fBEFAULT\fP
95 \fItarget\fP がユーザアドレス空間の外を指している。
96 .TP 
97 \fBEINVAL\fP
98 \fItarget\fP がマウントポイントではない。 または、 \fBumount2\fP()  で、 \fBMNT_EXPIRE\fP が指定された
99 \fBumount2\fP()  で、 \fBMNT_DETACH\fP か \fBMNT_FORCE\fP が同時に指定された。
100 .TP 
101 \fBENAMETOOLONG\fP
102 パス名の長さが \fBMAXPATHLEN\fP より長かった。
103 .TP 
104 \fBENOENT\fP
105 パス名が空である。もしくは指定されたパスが存在しない。
106 .TP 
107 \fBENOMEM\fP
108 カーネルがファイル名やデータをコピーするための空きページを確保できなかった。
109 .TP 
110 \fBEPERM\fP
111 呼び出し元が必要な権限を持っていない。
112 .SH バージョン
113 .\" http://sourceware.org/bugzilla/show_bug.cgi?id=10092
114 \fBMNT_DETACH\fP と \fBMNT_EXPIRE\fP はバージョン 2.11 以降の glibc で利用できる。
115 .SH 準拠
116 この関数は Linux 固有の関数であり、移植を考慮したプログラムでは 使用すべきでない。
117 .SH 注意
118 元々の \fBumount\fP()  関数は \fIumount(device)\fP の形で呼び出され、 ブロックデバイス以外を指定して呼び出すと
119 \fBENOTBLK\fP を返した。 Linux 0.98p4 で、無名デバイス (anonymous device) に対応するために
120 \fIumount(dir)\fP の形での呼び出しが加えられた。 Linux 2.3.99\-pre7 で、\fIumount(device)\fP は削除され、
121 \fIumount(dir)\fP だけが残された (一つのデバイスを複数の位置にマウント出来るようになったため、
122 デバイスを指定しただけでは不十分だからである)。
123 .SH 関連項目
124 \fBmount\fP(2), \fBpath_resolution\fP(7), \fBmount\fP(8), \fBumount\fP(8)
125 .SH この文書について
126 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
127 である。プロジェクトの説明とバグ報告に関する情報は
128 http://www.kernel.org/doc/man\-pages/ に書かれている。