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