OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / 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 .TH FIFO 7 2008-12-03 "Linux" "Linux Programmer's Manual"
11 .SH NAME
12 fifo \- first-in first-out special file, named pipe
13 .SH DESCRIPTION
14 A FIFO special file (a named pipe) is similar to a pipe,
15 except that it is accessed as part of the file system.
16 It can be opened by multiple processes for reading or
17 writing.
18 When processes are exchanging data via the FIFO,
19 the kernel passes all data internally without writing it
20 to the file system.
21 Thus, the FIFO special file has no
22 contents on the file system; the file system entry merely
23 serves as a reference point so that processes can access
24 the pipe using a name in the file system.
25 .PP
26 The kernel maintains exactly one pipe object for each
27 FIFO special file that is opened by at least one process.
28 The FIFO must be opened on both ends (reading and writing)
29 before data can be passed.
30 Normally, opening the FIFO blocks
31 until the other end is opened also.
32 .PP
33 A process can open a FIFO in nonblocking mode.
34 In this
35 case, opening for read only will succeed even if no-one has
36 opened on the write side yet, opening for write only will
37 fail with
38 .B ENXIO
39 (no such device or address) unless the other
40 end has already been opened.
41 .PP
42 Under Linux, opening a FIFO for read and write will succeed
43 both in blocking and nonblocking mode.
44 POSIX leaves this
45 behavior undefined.
46 This can be used to open a FIFO for
47 writing while there are no readers available.
48 A process
49 that uses both ends of the connection in order to communicate
50 with itself should be very careful to avoid deadlocks.
51 .SH NOTES
52 When a process tries to write to a FIFO that is not opened
53 for read on the other side, the process is sent a
54 .B SIGPIPE
55 signal.
56
57 FIFO special files can be created by
58 .BR mkfifo (3),
59 and are indicated by
60 .IR "ls \-l"
61 with the file type \(aqp\(aq.
62 .SH "SEE ALSO"
63 .BR mkfifo (1),
64 .BR open (2),
65 .BR pipe (2),
66 .BR sigaction (2),
67 .BR signal (2),
68 .BR socketpair (2),
69 .BR mkfifo (3),
70 .BR pipe (7)