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