OSDN Git Service

(split) LDP: Update release pages based on LDP 3.54 release
[linuxjm/LDP_man-pages.git] / release / man2 / mknod.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 .\" Modified 1996-08-18 by urs
11 .\" Modified 2003-04-23 by Michael Kerrisk
12 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
13 .\"
14 .\"*******************************************************************
15 .\"
16 .\" This file was generated with po4a. Translate the source file.
17 .\"
18 .\"*******************************************************************
19 .\"
20 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
21 .\"         all rights reserved.
22 .\" Translated 1997-06-26, SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
23 .\" Updated & Modified 1999-03-01, NAKANO Takeo <nakano@apm.seikei.ac.jp>
24 .\" Updated & Modified 2001-06-04, Yuichi SATO <ysato@h4.dion.ne.jp>
25 .\" Updated & Modified 2003-07-26, Yuichi SATO <ysato444@yahoo.co.jp>
26 .\" Updated & Modified 2004-12-31, Yuichi SATO
27 .\" Updated 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
28 .\"
29 .TH MKNOD 2 2013\-01\-27 Linux "Linux Programmer's Manual"
30 .SH 名前
31 mknod \- 特殊ファイルや通常のファイルを作成する
32 .SH 書式
33 .nf
34 \fB#include <sys/types.h>\fP
35 \fB#include <sys/stat.h>\fP
36 \fB#include <fcntl.h>\fP
37 \fB#include <unistd.h>\fP
38 .sp
39 \fBint mknod(const char *\fP\fIpathname\fP\fB, mode_t \fP\fImode\fP\fB, dev_t \fP\fIdev\fP\fB);\fP
40 .fi
41 .sp
42 .in -4n
43 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
44 .in
45 .sp
46 \fBmknod\fP():
47 .ad l
48 .RS 4
49 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
50 .RE
51 .ad
52 .SH 説明
53 The system call \fBmknod\fP()  creates a filesystem node (file, device special
54 file or named pipe) named \fIpathname\fP, with attributes specified by \fImode\fP
55 and \fIdev\fP.
56
57 \fImode\fP 引き数には、作成するノードの許可属性 (permission) とタイプを指定する。 \fImode\fP
58 の指定は以下にあげるファイルタイプのうちの 1 つと、 許可属性の組合せ (ビットごとの OR を使用) で行う。
59
60 許可属性は通常通り、プロセスの \fIumask\fP によって修正され、作成されたノードの許可属性は \fI(mode & ~umask)\fP となる。
61
62 .\" (S_IFSOCK since Linux 1.2.4)
63 ファイルタイプには \fBS_IFREG\fP, \fBS_IFCHR\fP, \fBS_IFBLK\fP, \fBS_IFIFO\fP, \fBS_IFSOCK\fP
64 のいずれかを指定しなければならない。 それぞれ順に、通常のファイル (空のファイルとして作成される)・
65 キャラクタスペシャルファイル・ブロックスペシャルファイル・ FIFO (名前付きパイプ)・UNIX ドメインソケットである (ファイルタイプ 0 は
66 \fBS_IFREG\fP と同じである)。
67
68 ファイルタイプが \fBS_IFCHR\fP または \fBS_IFBLK\fP のとき、 \fIdev\fP には作成するデバイススペシャルファイルのメジャー番号と
69 マイナー番号を指定する (\fBmakedev\fP(3)  は \fIdev\fP のこれらの番号を作成する際に役立つだろう)。 それ以外の場合は \fIdev\fP
70 は無視される。
71
72 \fIpathname\fP が既に存在する場合、またはシンボリックリンクの場合、 この呼び出しは \fBEEXIST\fP エラーで失敗する。
73
74 The newly created node will be owned by the effective user ID of the
75 process.  If the directory containing the node has the set\-group\-ID bit set,
76 or if the filesystem is mounted with BSD group semantics, the new node will
77 inherit the group ownership from its parent directory; otherwise it will be
78 owned by the effective group ID of the process.
79 .SH 返り値
80 \fBmknod\fP()  は成功した場合 0 を、失敗した場合 \-1 を返す (失敗した場合 \fIerrno\fP がエラーの内容にしたがってセットされる)。
81 .SH エラー
82 .TP 
83 \fBEACCES\fP
84 プロセスが親ディレクトリへの書き込み許可を持たない。 もしくはパス名 \fIpathname\fP 中のディレクトリ部分のどれかに検索許可属性が無い
85 (\fBpath_resolution\fP(7)  も参照すること)。
86 .TP 
87 \fBEDQUOT\fP
88 The user's quota of disk blocks or inodes on the filesystem has been
89 exhausted.
90 .TP 
91 \fBEEXIST\fP
92 \fIpathname\fP がすでに存在する。 これには \fIpathname\fP がシンボリックリンクである場合も含まれる
93 (シンボリックリンクがリンク切れか (dangling) どうかは関係ない)。
94 .TP 
95 \fBEFAULT\fP
96 \fIpathname\fP がそのプロセスのアクセス可能なアドレス空間の外を指している。
97 .TP 
98 \fBEINVAL\fP
99 \fImode\fP が通常のファイル・デバイススペシャルファイル・FIFO・ソケット以外を 作成するようにセットされている。
100 .TP 
101 \fBELOOP\fP
102 パス名 \fIpathname\fP を解決するときに、含まれているシンボリックリンクが多すぎた。
103 .TP 
104 \fBENAMETOOLONG\fP
105 \fIpathname\fP が長過ぎる。
106 .TP 
107 \fBENOENT\fP
108 \fIpathname\fP 中のディレクトリ部分が存在しない、 もしくはリンク先の無いシンボリックリンクである。
109 .TP 
110 \fBENOMEM\fP
111 十分なカーネルメモリが無い。
112 .TP 
113 \fBENOSPC\fP
114 \fIpathname\fP のあるデバイスに新たにノードを作成する空きが無い。
115 .TP 
116 \fBENOTDIR\fP
117 \fIpathname\fP 中のディレクトリ要素が、実際にはディレクトリでない。
118 .TP 
119 \fBEPERM\fP
120 .\" For UNIX domain sockets and regular files, EPERM is returned only in
121 .\" Linux 2.2 and earlier; in Linux 2.4 and later, unprivileged can
122 .\" use mknod() to make these files.
123 \fImode\fP requested creation of something other than a regular file, FIFO
124 (named pipe), or UNIX domain socket, and the caller is not privileged
125 (Linux: does not have the \fBCAP_MKNOD\fP capability); also returned if the
126 filesystem containing \fIpathname\fP does not support the type of node
127 requested.
128 .TP 
129 \fBEROFS\fP
130 \fIpathname\fP refers to a file on a read\-only filesystem.
131 .SH 準拠
132 .\" The Linux version differs from the SVr4 version in that it
133 .\" does not require root permission to create pipes, also in that no
134 .\" EMULTIHOP, ENOLINK, or EINTR error is documented.
135 SVr4, 4.4BSD, POSIX.1\-2001 (下記も参照).
136 .SH 注意
137 POSIX.1\-2001 では次のように書いている: 「\fBmknod\fP()  の唯一の移植性のある使用法は、FIFO
138 スペシャルファイルを作成することである。 \fImode\fP が \fBS_IFIFO\fP ではない場合、または \fIdev\fP が 0 ではない場合、
139 \fBmknod\fP()  の挙動は規定されていない。」 しかしながら、現在ではこの目的のために \fBmknod\fP()
140 を使用すべきではない。この目的のために特別に定義された関数である \fBmkfifo\fP()  を使用すべきである。
141
142 .\" and one should make UNIX domain sockets with socket(2) and bind(2).
143 Linux では、ディレクトリを作成するために この呼び出しを使用することはできない。 ディレクトリは \fBmkdir\fP(2)  で作成すべきである。
144
145 NFS を実現しているプロトコルには多くの不備が存在し、 それらのいくつかは \fBmknod\fP()  に影響を与える。
146 .SH 関連項目
147 \fBchmod\fP(2), \fBchown\fP(2), \fBfcntl\fP(2), \fBmkdir\fP(2), \fBmknodat\fP(2),
148 \fBmount\fP(2), \fBsocket\fP(2), \fBstat\fP(2), \fBumask\fP(2), \fBunlink\fP(2),
149 \fBmakedev\fP(3), \fBmkfifo\fP(3), \fBpath_resolution\fP(7)
150 .SH この文書について
151 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
152 である。プロジェクトの説明とバグ報告に関する情報は
153 http://www.kernel.org/doc/man\-pages/ に書かれている。