1 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
2 .\" and Copyright (C) 1993 Michael Haardt
3 .\" and Copyright (C) 1993,1994 Ian Jackson.
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.
10 .\"*******************************************************************
12 .\" This file was generated with po4a. Translate the source file.
14 .\"*******************************************************************
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>
30 .TH MKDIR 2 2013\-01\-27 Linux "Linux Programmer's Manual"
35 .\" .B #include <unistd.h>
36 \fB#include <sys/stat.h>\fP
37 \fB#include <sys/types.h>\fP
39 \fBint mkdir(const char *\fP\fIpathname\fP\fB, mode_t \fP\fImode\fP\fB);\fP
42 \fBmkdir\fP() は \fIpathname\fP で示される名前のディレクトリを作成しようとする。
44 \fImode\fP 引き数は、作成されたディレクトリの許可属性を決定するのに使われる。 この値に、通常通りプロセスの \fIumask\fP
45 による修正が加えられる。 したがって、作成されたディレクトリの許可属性は (\fImode\fP & ~\fIumask\fP & 0777) となる。
46 作成されたディレクトリのその他のモードビットはオペレーティングシステムに 依存する。Linux の場合は、以下の通りである。
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.
55 もし親ディレクトリに set group ID ビットがセットされていれば新しく作成される ディレクトリにも set group ID
58 \fBmkdir\fP() は成功した場合 0 を、失敗した場合 \-1 を返す (また、 \fIerrno\fP がエラーの内容にしたがって適切に設定される)。
62 プロセスが親ディレクトリへの書き込み許可を持たない、もしくは \fIpathname\fP 中のディレクトリのどれかに検索許可属性が無い
63 (\fBpath_resolution\fP(7) も参照)。
66 The user's quota of disk blocks or inodes on the filesystem has been
70 \fIpathname\fP が既に存在している(ただしそれがディレクトリであるとは限らない)。 \fIpathname\fP がシンボリックリンクの場合も
71 (その指定先が存在するかどうかに関らず)エラーになる。
74 \fIpathname\fP がアクセス可能なアドレス空間の外を指している。
77 \fIpathname\fP を解決するときに、解決すべきシンボリックリンクが多すぎた。
80 親ディレクトリへのリンク数が \fBLINK_MAX\fP を超えてしまう。
86 \fIpathname\fP の構成要素のディレクトリのいずれかが存在しないか、 またはリンク先が存在しないシンボリックリンクである。
92 \fIpathname\fP を含むデバイスに新たにディレクトリを作成する空きが無い。
95 もしくはユーザーのディスク quota が使い切られているため、 新たにディレクトリを作成することができない。
98 \fIpathname\fP のディレクトリ部分が実際にはディレクトリでない。
101 The filesystem containing \fIpathname\fP does not support the creation of
105 \fIpathname\fP refers to a file on a read\-only filesystem.
107 .\" SVr4 documents additional EIO, EMULTIHOP
108 SVr4, BSD, POSIX.1\-2001.
110 Linux では、許可ビット以外で意味を持つのは、 \fBS_ISVTX\fP モードビットだけである。 つまり、Linux
111 では作成されたディレクトリは実際には (\fImode\fP & ~\fIumask\fP & 01777) のモードを持つことになる。 \fBstat\fP(2)
114 NFS を実現しているプロトコルには多くの不備が存在し、 それら中には \fBmkdir\fP() に影響を与えるものもある。
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)
120 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
121 である。プロジェクトの説明とバグ報告に関する情報は
122 http://www.kernel.org/doc/man\-pages/ に書かれている。