OSDN Git Service

58d1471668ce45ae3c60f8e7efcd4ea9084a2b52
[linuxjm/LDP_man-pages.git] / draft / man7 / fifo.7
1 .\" This man page is Copyright (C) 1999 Claus Fischer.
2 .\" Permission is granted to distribute possibly modified copies
3 .\" of this page provided the header is included verbatim,
4 .\" and in case of nontrivial modification author and date
5 .\" of the modification is added to the header.
6 .\"
7 .\" 990620 - page created - aeb@cwi.nl
8 .\"
9 .\" FIXME . Add example programs to this page?
10 .\"
11 .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
12 .\"         all rights reserved.
13 .\" Translated Wed Jan  5 23:35:27 JST 2000
14 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
15 .\"
16 .TH FIFO 7 2008-12-03 "Linux" "Linux Programmer's Manual"
17 .\"O .SH NAME
18 .SH 名前
19 fifo \- 先入先出特殊ファイル、名前付きパイプ
20 .\"O .SH DESCRIPTION
21 .SH 書式
22 .\"O A FIFO special file (a named pipe) is similar to a pipe,
23 .\"O except that it is accessed as part of the file system.
24 .\"O It can be opened by multiple processes for reading or
25 .\"O writing.
26 .\"O When processes are exchanging data via the FIFO,
27 .\"O the kernel passes all data internally without writing it
28 .\"O to the file system.
29 .\"O Thus, the FIFO special file has no
30 .\"O contents on the file system; the file system entry merely
31 .\"O serves as a reference point so that processes can access
32 .\"O the pipe using a name in the file system.
33 FIFO 特殊ファイル(名前付きパイプ)はパイプに似ているが、
34 ファイルシステムの一部に関連付けられている点が異っている。
35 複数のプロセスが読み込みや書き込みのためにオープンすること
36 ができる。プロセスが FIFO を通しデータを交換する場合、
37 実際にそれをファイルシステムには書き込まず、カーネルは全ての
38 データを内部的に渡す。このように、FIFO 特殊ファイルはファイルシステム
39 上には内容を持たないので、ファイルシステムのエントリは
40 プロセスがそのファイルシステム上の名前を使用してそのパイプに
41 アクセスできるように参照ポイントを提供しているに過ぎない。
42 .PP
43 .\"O The kernel maintains exactly one pipe object for each
44 .\"O FIFO special file that is opened by at least one process.
45 .\"O The FIFO must be opened on both ends (reading and writing)
46 .\"O before data can be passed.
47 .\"O Normally, opening the FIFO blocks
48 .\"O until the other end is opened also.
49 カーネルは、少なくとも一つのプロセスによってオープンされている
50 FIFO 特殊ファイルについて、それぞれ一つのパイプのみを管理している。
51 データが渡される前にその FIFO の両端(書き込みと読み出し)がオープン
52 されていなければならない。通常、FIFO をオープンすると、
53 その反対側がオープンされるまで停止(block)させられる。
54 .PP
55 .\"O A process can open a FIFO in nonblocking mode.
56 .\"O In this
57 .\"O case, opening for read only will succeed even if no-one has
58 .\"O opened on the write side yet, opening for write only will
59 .\"O fail with
60 .\"O .B ENXIO
61 .\"O (no such device or address) unless the other
62 .\"O end has already been opened.
63 プロセスは FIFO を非停止(nonblocking)モードでオープンすることもできる。
64 この場合、読み込み専用でオープンした場合には書き込み側を誰もオープン
65 していなくても成功する。書き込み専用でオープンした場合は反対側が既に
66 オープンされていなければ
67 .B ENXIO
68 (そのようなデバイスまたはアドレスは存在しない)
69 というエラーで失敗する。
70 .PP
71 .\"O Under Linux, opening a FIFO for read and write will succeed
72 .\"O both in blocking and nonblocking mode.
73 .\"O POSIX leaves this
74 .\"O behavior undefined.
75 .\"O This can be used to open a FIFO for
76 .\"O writing while there are no readers available.
77 .\"O A process
78 .\"O that uses both ends of the connection in order to communicate
79 .\"O with itself should be very careful to avoid deadlocks.
80 Linux では、FIFO を読み込みと書き込み両用にオープンした場合、
81 停止、非停止のどちらのモードでも成功する。POSIX ではこの場合の
82 動作は定義されていない。これは読み込み側がいない時に書き込み用に
83 オープンするために使用することができる。自分自身と通信するために
84 両端を使用するプロセスはデッドロックを避けるために非常に注意深く
85 なければならない。
86 .\"O .SH NOTES
87 .SH 注意
88 .\"O When a process tries to write to a FIFO that is not opened
89 .\"O for read on the other side, the process is sent a
90 .\"O .B SIGPIPE
91 .\"O signal.
92 プロセスが、反対の読み込み側がオープンされていない FIFO を
93 書き込みのためにオープンしようとした場合、そのプロセスに
94 .B SIGPIPE
95 シグナルが送られる。
96
97 .\"O FIFO special files can be created by
98 .\"O .BR mkfifo (3),
99 .\"O and are indicated by
100 .\"O .IR "ls \-l"
101 .\"O with the file type \(aqp\(aq.
102 FIFO 特殊ファイルは
103 .BR mkfifo (3)
104 で作成することができ、
105 .IR "ls \-l"
106 ではファイル種別 \(aqp\(aq で表示される。
107 .\"O .SH "SEE ALSO"
108 .SH 関連項目
109 .BR mkfifo (1),
110 .BR open (2),
111 .BR pipe (2),
112 .BR sigaction (2),
113 .BR signal (2),
114 .BR socketpair (2),
115 .BR mkfifo (3),
116 .BR pipe (7)