OSDN Git Service

962bd7837e57a794766f1f28a20f3a6a79037b95
[linuxjm/LDP_man-pages.git] / release / man2 / mkdirat.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" This manpage is Copyright (C) 2006, Michael Kerrisk
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Japanese Version Copyright (c) 2006 Yuichi SATO
26 .\"         all rights reserved.
27 .\" Translated 2006-09-30 by Yuichi SATO <ysato444@yahoo.co.jp>, LDP v2.39
28 .\"
29 .TH MKDIRAT 2 2009-12-13 "Linux" "Linux Programmer's Manual"
30 .SH 名前
31 mkdirat \- ディレクトリファイルディスクリプタから相対的な位置にディレクトリを作成する
32 .SH 書式
33 .nf
34 .B #include <fcntl.h>           /* AT_* 定数の定義 */
35 .B #include <sys/stat.h>
36 .sp
37 .BI "int mkdirat(int " dirfd ", const char *" pathname ", mode_t " mode );
38 .fi
39 .sp
40 .in -4n
41 glibc 向けの機能検査マクロの要件
42 .RB ( feature_test_macros (7)
43 参照):
44 .in
45 .sp
46 .BR mkdirat ():
47 .PD 0
48 .ad l
49 .RS 4
50 .TP 4
51 glibc 2.10 以降:
52 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
53 .TP
54 glibc 2.10 より前:
55 _ATFILE_SOURCE
56 .RE
57 .ad
58 .PD
59 .SH 説明
60 .BR mkdirat ()
61 システムコールは、この man ページで説明している違いがある以外は、
62 .BR mkdir (2)
63 と全く同じように動作する。
64
65 .I pathname
66 で指定されるパス名が相対パス名である場合、
67 ファイルディスクリプタ
68 .I dirfd
69 で参照されるディレクトリからの相対パス名として解釈される
70 .RB ( mkdir (2)
71 では、相対パスは呼び出し元プロセスの
72 カレントワーキングディレクトリからの相対パスとなる)。
73
74 .I pathname
75 が相対パスであり、かつ
76 .I dirfd
77 が特別な値
78 .B AT_FDCWD
79 である場合、
80 .I pathname
81
82 .RB ( mkdir (2)
83 と同じように) 呼び出し元プロセスの
84 カレントワーキングディレクトリからの相対パス名として解釈される。
85
86 .I pathname
87 が絶対パスである場合、
88 .I dirfd
89 は無視される。
90 .SH 返り値
91 成功した場合、
92 .BR mkdirat ()
93 は 0 を返す。
94 エラーの場合、\-1 が返されて、
95 .I errno
96 にはエラーを示す値が設定される。
97 .SH エラー
98 .BR mkdir (2)
99 と同じエラーが
100 .BR mkdirat ()
101 でも起こる。
102 .BR mkdirat ()
103 では、その他に以下のエラーが起こる:
104 .TP
105 .B EBADF
106 .I dirfd
107 が有効なファイルディスクリプタでない。
108 .TP
109 .B ENOTDIR
110 .I pathname
111 が相対パスで、かつ
112 .I dirfd
113 がディレクトリ以外のファイルを参照するファイルディスクリプタである。
114 .SH バージョン
115 .BR mkdirat ()
116 は Linux カーネル 2.6.16 で追加された。
117 .SH 準拠
118 POSIX.1-2008.
119 .SH 注意
120 .BR mkdirat ()
121 が必要な理由については、
122 .BR openat (2)
123 を参照すること。
124 .SH 説明
125 .BR mkdir (2),
126 .BR openat (2),
127 .BR path_resolution (7)