OSDN Git Service

(split) LDP: Update release pages based on LDP 3.54 release
[linuxjm/LDP_man-pages.git] / release / man2 / mkdir.2
1 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
2 .\"             and Copyright (C) 1993 Michael Haardt
3 .\"             and Copyright (C) 1993,1994 Ian Jackson.
4 .\"
5 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
6 .\" You may distribute it under the terms of the GNU General
7 .\" Public License. It comes with NO WARRANTY.
8 .\" %%%LICENSE_END
9 .\"
10 .\"*******************************************************************
11 .\"
12 .\" This file was generated with po4a. Translate the source file.
13 .\"
14 .\"*******************************************************************
15 .\"
16 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
17 .\"         all rights reserved.
18 .\" Translated Thu Jun 26 20:47:26 JST 1997
19 .\"         by SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
20 .\" Updated & Modified Fri Jan 22 1999
21 .\"         by NAKANO Takeo <nakano@apm.seikei.ac.jp>
22 .\" Updated Fri Sep 13 JST 2000 by Kentaro Shirakata <argrath@ub32.org>
23 .\" Updated Sun May 23 JST 2004 by Kentaro Shirakata <argrath@ub32.org>
24 .\" Updated Thu Mar 24 JST 2005 by Kentaro Shirakata <argrath@ub32.org>
25 .\" Updated Wed Jul 30 JST 2008 by Kentaro Shirakata <argrath@ub32.org>
26 .\" Updated 2012-05-08, Akihiro MOTOKI <amotoki@gmail.com>
27 .\" Updated 2013-05-01, Akihiro MOTOKI <amotoki@gmail.com>
28 .\" Updated 2013-05-06, Akihiro MOTOKI <amotoki@gmail.com>
29 .\"
30 .TH MKDIR 2 2013\-01\-27 Linux "Linux Programmer's Manual"
31 .SH 名前
32 mkdir \- ディレクトリを作成する
33 .SH 書式
34 .nf
35 .\" .B #include <unistd.h>
36 \fB#include <sys/stat.h>\fP
37 \fB#include <sys/types.h>\fP
38 .sp
39 \fBint mkdir(const char *\fP\fIpathname\fP\fB, mode_t \fP\fImode\fP\fB);\fP
40 .fi
41 .SH 説明
42 \fBmkdir\fP()  は \fIpathname\fP で示される名前のディレクトリを作成しようとする。
43
44 \fImode\fP 引き数は、作成されたディレクトリの許可属性を決定するのに使われる。 この値に、通常通りプロセスの \fIumask\fP
45 による修正が加えられる。 したがって、作成されたディレクトリの許可属性は (\fImode\fP & ~\fIumask\fP & 0777)  となる。
46 作成されたディレクトリのその他のモードビットはオペレーティングシステムに 依存する。Linux の場合は、以下の通りである。
47
48 The newly created directory will be owned by the effective user ID of the
49 process.  If the directory containing the file has the set\-group\-ID bit set,
50 or if the filesystem is mounted with BSD group semantics (\fImount \-o
51 bsdgroups\fP or, synonymously \fImount \-o grpid\fP), the new directory will
52 inherit the group ownership from its parent; otherwise it will be owned by
53 the effective group ID of the process.
54
55 もし親ディレクトリに set group ID ビットがセットされていれば新しく作成される ディレクトリにも set group ID
56 ビットがセットされる。
57 .SH 返り値
58 \fBmkdir\fP()  は成功した場合 0 を、失敗した場合 \-1 を返す (また、 \fIerrno\fP がエラーの内容にしたがって適切に設定される)。
59 .SH エラー
60 .TP 
61 \fBEACCES\fP
62 プロセスが親ディレクトリへの書き込み許可を持たない、もしくは \fIpathname\fP 中のディレクトリのどれかに検索許可属性が無い
63 (\fBpath_resolution\fP(7)  も参照)。
64 .TP 
65 \fBEDQUOT\fP
66 The user's quota of disk blocks or inodes on the filesystem has been
67 exhausted.
68 .TP 
69 \fBEEXIST\fP
70 \fIpathname\fP が既に存在している(ただしそれがディレクトリであるとは限らない)。 \fIpathname\fP がシンボリックリンクの場合も
71 (その指定先が存在するかどうかに関らず)エラーになる。
72 .TP 
73 \fBEFAULT\fP
74 \fIpathname\fP がアクセス可能なアドレス空間の外を指している。
75 .TP 
76 \fBELOOP\fP
77 \fIpathname\fP を解決するときに、解決すべきシンボリックリンクが多すぎた。
78 .TP 
79 \fBEMLINK\fP
80 親ディレクトリへのリンク数が \fBLINK_MAX\fP を超えてしまう。
81 .TP 
82 \fBENAMETOOLONG\fP
83 \fIpathname\fP が長すぎる。
84 .TP 
85 \fBENOENT\fP
86 \fIpathname\fP の構成要素のディレクトリのいずれかが存在しないか、 またはリンク先が存在しないシンボリックリンクである。
87 .TP 
88 \fBENOMEM\fP
89 カーネルに十分なメモリがない。
90 .TP 
91 \fBENOSPC\fP
92 \fIpathname\fP を含むデバイスに新たにディレクトリを作成する空きが無い。
93 .TP 
94 \fBENOSPC\fP
95 もしくはユーザーのディスク quota が使い切られているため、 新たにディレクトリを作成することができない。
96 .TP 
97 \fBENOTDIR\fP
98 \fIpathname\fP のディレクトリ部分が実際にはディレクトリでない。
99 .TP 
100 \fBEPERM\fP
101 The filesystem containing \fIpathname\fP does not support the creation of
102 directories.
103 .TP 
104 \fBEROFS\fP
105 \fIpathname\fP refers to a file on a read\-only filesystem.
106 .SH 準拠
107 .\" SVr4 documents additional EIO, EMULTIHOP
108 SVr4, BSD, POSIX.1\-2001.
109 .SH 注意
110 Linux では、許可ビット以外で意味を持つのは、 \fBS_ISVTX\fP モードビットだけである。 つまり、Linux
111 では作成されたディレクトリは実際には (\fImode\fP & ~\fIumask\fP & 01777)  のモードを持つことになる。 \fBstat\fP(2)
112 を参照のこと。
113 .PP
114 NFS を実現しているプロトコルには多くの不備が存在し、 それら中には \fBmkdir\fP()  に影響を与えるものもある。
115 .SH 関連項目
116 \fBmkdir\fP(1), \fBchmod\fP(2), \fBchown\fP(2), \fBmkdirat\fP(2), \fBmknod\fP(2),
117 \fBmount\fP(2), \fBrmdir\fP(2), \fBstat\fP(2), \fBumask\fP(2), \fBunlink\fP(2),
118 \fBpath_resolution\fP(7)
119 .SH この文書について
120 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
121 である。プロジェクトの説明とバグ報告に関する情報は
122 http://www.kernel.org/doc/man\-pages/ に書かれている。