OSDN Git Service

Convert release and draft pages to UTF-8.
[linuxjm/jm.git] / manual / LDP_man-pages / release / man2 / mknodat.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 MKNODAT 2 2010-09-20 "Linux" "Linux Programmer's Manual"
30 .SH 名前
31 mknodat \- ディレクトリファイルディスクリプタから相対的な位置に、
32 特殊ファイルや通常のファイルを作成する
33 .SH 書式
34 .nf
35 .B #include <fcntl.h>           /* AT_* 定数の定義 */
36 .B #include <sys/stat.h>
37 .sp
38 .BI "int mknodat(int " dirfd ", const char *" pathname ", mode_t " mode \
39 ", dev_t " dev );
40 .fi
41 .sp
42 .in -4n
43 glibc 向けの機能検査マクロの要件
44 .RB ( feature_test_macros (7)
45 参照):
46 .in
47 .sp
48 .BR mknodat ():
49 .PD 0
50 .ad l
51 .RS 4
52 .TP 4
53 glibc 2.10 以降:
54 _XOPEN_SOURCE\ >=\ 700
55 .\" Other FTM combinations will also expose mknodat(), but this function was
56 .\" added in SUSv4, marked XSI, so we'll just document what the standard says
57 .TP 4
58 glibc 2.10 より前:
59 _ATFILE_SOURCE
60 .RE
61 .ad
62 .PD
63 .SH 説明
64 .BR mknodat ()
65 システムコールは、この man ページで説明している違いがある以外は、
66 .BR mknod (2)
67 と全く同じように動作する。
68
69 .I pathname
70 で指定されるパス名が相対パス名である場合、
71 ファイルディスクリプタ
72 .I dirfd
73 で参照されるディレクトリからの相対パス名として解釈される
74 .RB ( mknod (2)
75 では、相対パスは呼び出し元プロセスの
76 カレントワーキングディレクトリからの相対パスとなる)。
77
78 .I pathname
79 が相対パスであり、かつ
80 .I dirfd
81 が特別な値
82 .B AT_FDCWD
83 である場合、
84 .I pathname
85
86 .RB ( mknod (2)
87 と同じように) 呼び出し元プロセスの
88 カレントワーキングディレクトリからの相対パス名として解釈される。
89
90 .I pathname
91 が絶対パスである場合、
92 .I dirfd
93 は無視される。
94 .SH 返り値
95 成功した場合、
96 .BR mknodat ()
97 は 0 を返す。
98 エラーの場合、\-1 が返されて、
99 .I errno
100 にはエラーを示す値が設定される。
101 .SH エラー
102 .BR mknod (2)
103 と同じエラーが
104 .BR mknodat ()
105 でも起こる。
106 .BR mknodat ()
107 では、その他に以下のエラーが起こる:
108 .TP
109 .B EBADF
110 .I dirfd
111 が有効なファイルディスクリプタでない。
112 .TP
113 .B ENOTDIR
114 .I pathname
115 が相対パスで、かつ
116 .I dirfd
117 がディレクトリ以外のファイルを参照するファイルディスクリプタである。
118 .SH バージョン
119 .BR mknodat ()
120 は Linux カーネル 2.6.16 で追加された。
121 .SH 準拠
122 POSIX.1-2008.
123 .SH 注意
124 .BR mknodat ()
125 が必要な理由については、
126 .BR openat (2)
127 を参照すること。
128 .SH 関連項目
129 .BR mknod (2),
130 .BR openat (2),
131 .BR path_resolution (7)