OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / release / man3 / mkfifo.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" This manpage is Copyright (C) 1995 James R. Van Zandt <jrv@vanzandt.mv.com>
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 .\" changed section from 2 to 3, aeb, 950919
26 .\"
27 .\" Japanese Version Copyright (c) 1998 George Momma
28 .\"         all rights reserved.
29 .\" Translated Mon May 25 23:11:03 JST 1998
30 .\"         by George Momma <momma@wakhok.ac.jp>
31 .\" Updated 1999-12-11 by Kentaro Shirakata <argrath@ub32.org>
32 .\" Updated 2008-07-30 by Kentaro Shirakata <argrath@ub32.org>
33 .\"
34 .\"WORD:        named pipe              名前付きパイプ
35 .\"WORD:        permission              許可モード
36 .\"WORD:        filename                ファイル名
37 .\"WORD:        filename component      ファイル名部分
38 .\"WORD:        directory component     ディレクトリ部分
39 .TH MKFIFO 3 2008-06-12 "GNU" "Linux Programmer's Manual"
40 .SH 名前
41 mkfifo \- FIFOスペシャルファイル(名前付きパイプ)を作成する
42 .SH 書式
43 .nf
44 .B #include <sys/types.h>
45 .B #include <sys/stat.h>
46 .sp
47 .BI "int mkfifo(const char *" pathname ", mode_t " mode );
48 .fi
49 .SH 説明
50 .BR mkfifo ()
51 は名前 \fIpathname\fP を持つFIFOスペシャルファイルを作成
52 する。FIFOの許可モードは \fImode\fP で指定され、プロセスの
53 \fBumask\fP によって通常の方式で変更を受ける: 作成されたファイルの許可
54 モードは \fB(\fP\fImode\fP\fB & ~umask)\fP となる。
55 .PP
56 FIFOスペシャルファイルはパイプに似ているが、作成のされ方のみが異なって
57 いる。FIFOスペシャルファイルは名前のない通信路ではなく、
58 .BR mkfifo ()
59 の呼び出しによりファイルシステムの中に加えられる。
60 .PP
61 ひとたびこのようにしてFIFOスペシャルファイルが作成されると、通常のファ
62 イルと同じように、どのプロセスからでも読み出し、書き込み用にこれをオー
63 プンすることができる。ただし、これに対する全ての入出力操作に先立って
64 その両端がオープンされている必要がある。FIFOを読み出し用にオープンする
65 と、通常他のプロセスによって同じFIFOが書き込み用にオープンされるまでブ
66 ロックされ、逆の場合も同様である。
67 FIFOスペシャルファイルをブロックせずに扱う方法については
68 .BR fifo (7)
69 を参照のこと。
70 .SH 返り値
71 成功した場合
72 .BR mkfifo ()
73 は 0 を返す。
74 エラーの場合 \-1 を返す (また \fIerrno\fP が適切に設定される)。
75 .SH エラー
76 .TP
77 .B EACCES
78 \fIpathname\fP の中のディレクトリの一つに対し検索(実行)許可がない。
79 .TP
80 .B EEXIST
81 \fIpathname\fP がすでに存在する。
82 これには、
83 .I pathname
84 が(リンク切れかどうかに関わらず)シンボリックリンクである場合も含む。
85 .TP
86 .B ENAMETOOLONG
87 \fIpathname\fP の長さが \fBPATH_MAX\fP を超えているか、個々のファイル
88 名部分の長さが \fBNAME_MAX\fP を超えている。GNUシステムにおいては、ファ
89 イル名の全体の長さに対しては制限は課せられていないが、ファイルシステム
90 によっては各部分の長さに制限のある可能性がある。
91 .TP
92 .B ENOENT
93 \fIpathname\fP の中のディレクトリ部分が存在しないか、リンク先のないシ
94 ンボリックリンクである。
95 .TP
96 .B ENOSPC
97 ディレクトリまたはファイルシステムに新規ファイルを作成する余地がない。
98 .TP
99 .B ENOTDIR
100 \fIpathname\fP 中でディレクトリとして使用されている部分が実際にはディ
101 レクトリではない。
102 .TP
103 .B EROFS
104 \fIpathname\fP が読み取り専用のファイルシステムを指している。
105 .SH 準拠
106 POSIX.1-2001.
107 .SH 関連項目
108 .BR mkfifo (1),
109 .BR close (2),
110 .BR open (2),
111 .BR read (2),
112 .BR stat (2),
113 .BR umask (2),
114 .BR write (2),
115 .BR mkfifoat (3),
116 .BR fifo (7)