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