]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" This man page is Copyright (C) 1999 Claus Fischer. |
2297bf0e | 2 | .\" |
00acdba1 | 3 | .\" %%%LICENSE_START(VERBATIM_ONE_PARA) |
fea681da MK |
4 | .\" Permission is granted to distribute possibly modified copies |
5 | .\" of this page provided the header is included verbatim, | |
6 | .\" and in case of nontrivial modification author and date | |
7 | .\" of the modification is added to the header. | |
8ff7380d | 8 | .\" %%%LICENSE_END |
c13182ef | 9 | .\" |
fea681da MK |
10 | .\" 990620 - page created - aeb@cwi.nl |
11 | .\" | |
45186a5d | 12 | .TH FIFO 7 2017-11-26 "Linux man-pages (unreleased)" |
fea681da MK |
13 | .SH NAME |
14 | fifo \- first-in first-out special file, named pipe | |
15 | .SH DESCRIPTION | |
16 | A FIFO special file (a named pipe) is similar to a pipe, | |
9ee4a2b6 | 17 | except that it is accessed as part of the filesystem. |
fea681da | 18 | It can be opened by multiple processes for reading or |
c13182ef MK |
19 | writing. |
20 | When processes are exchanging data via the FIFO, | |
fea681da | 21 | the kernel passes all data internally without writing it |
9ee4a2b6 | 22 | to the filesystem. |
c13182ef | 23 | Thus, the FIFO special file has no |
9ee4a2b6 | 24 | contents on the filesystem; the filesystem entry merely |
fea681da | 25 | serves as a reference point so that processes can access |
9ee4a2b6 | 26 | the pipe using a name in the filesystem. |
fea681da MK |
27 | .PP |
28 | The kernel maintains exactly one pipe object for each | |
29 | FIFO special file that is opened by at least one process. | |
30 | The FIFO must be opened on both ends (reading and writing) | |
c13182ef MK |
31 | before data can be passed. |
32 | Normally, opening the FIFO blocks | |
fea681da MK |
33 | until the other end is opened also. |
34 | .PP | |
ff40dbb3 | 35 | A process can open a FIFO in nonblocking mode. |
c13182ef | 36 | In this |
9b13f770 | 37 | case, opening for read-only succeeds even if no one has |
26cd31fd MK |
38 | opened on the write side yet and opening for write-only |
39 | fails with | |
097585ed MK |
40 | .B ENXIO |
41 | (no such device or address) unless the other | |
fea681da MK |
42 | end has already been opened. |
43 | .PP | |
44 | Under Linux, opening a FIFO for read and write will succeed | |
ff40dbb3 | 45 | both in blocking and nonblocking mode. |
c13182ef | 46 | POSIX leaves this |
d9bfdb9c | 47 | behavior undefined. |
c13182ef MK |
48 | This can be used to open a FIFO for |
49 | writing while there are no readers available. | |
50 | A process | |
fea681da MK |
51 | that uses both ends of the connection in order to communicate |
52 | with itself should be very careful to avoid deadlocks. | |
53 | .SH NOTES | |
bd054369 | 54 | For details of the semantics of I/O on FIFOs, see |
84661892 MK |
55 | .BR pipe (7). |
56 | .PP | |
fea681da | 57 | When a process tries to write to a FIFO that is not opened |
8bd58774 MK |
58 | for read on the other side, the process is sent a |
59 | .B SIGPIPE | |
fea681da | 60 | signal. |
a721e8b2 | 61 | .PP |
fea681da MK |
62 | FIFO special files can be created by |
63 | .BR mkfifo (3), | |
d91ca9d3 | 64 | and are indicated by |
1ae6b2c7 | 65 | .I ls\~\-l |
d91ca9d3 | 66 | with the file type \(aqp\(aq. |
47297adb | 67 | .SH SEE ALSO |
fea681da MK |
68 | .BR mkfifo (1), |
69 | .BR open (2), | |
70 | .BR pipe (2), | |
71 | .BR sigaction (2), | |
72 | .BR signal (2), | |
73 | .BR socketpair (2), | |
be37f2c5 MK |
74 | .BR mkfifo (3), |
75 | .BR pipe (7) |