1 .\" This manpage is Copyright (C) 1995 James R. Van Zandt <jrv@vanzandt.mv.com>
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" changed section from 2 to 3, aeb, 950919
27 .TH MKFIFO 3 2013-01-27 "GNU" "Linux Programmer's Manual"
29 mkfifo \- make a FIFO special file (a named pipe)
32 .B #include <sys/types.h>
33 .B #include <sys/stat.h>
35 .BI "int mkfifo(const char *" pathname ", mode_t " mode );
39 makes a FIFO special file with name \fIpathname\fP.
40 \fImode\fP specifies the FIFO's permissions.
42 process's \fBumask\fP in the usual way: the permissions of the created
43 file are \fB(\fP\fImode\fP\fB & ~umask)\fP.
45 A FIFO special file is similar to a pipe, except that it is created
47 Instead of being an anonymous communications
48 channel, a FIFO special file is entered into the filesystem by
52 Once you have created a FIFO special file in this way, any process can
53 open it for reading or writing, in the same way as an ordinary file.
54 However, it has to be open at both ends simultaneously before you can
55 proceed to do any input or output operations on it.
56 Opening a FIFO for reading normally blocks until some
57 other process opens the same FIFO for writing, and vice versa.
60 for nonblocking handling of FIFO special files.
65 In the case of an error, \-1 is returned (in which case, \fIerrno\fP
66 is set appropriately).
70 One of the directories in \fIpathname\fP did not allow search
74 The user's quota of disk blocks or inodes on the filesystem has been
78 \fIpathname\fP already exists.
79 This includes the case where
81 is a symbolic link, dangling or not.
84 Either the total length of \fIpathname\fP is greater than
85 \fBPATH_MAX\fP, or an individual filename component has a length
86 greater than \fBNAME_MAX\fP.
87 In the GNU system, there is no imposed
88 limit on overall filename length, but some filesystems may place
89 limits on the length of a component.
92 A directory component in \fIpathname\fP does not exist or is a
93 dangling symbolic link.
96 The directory or filesystem has no room for the new file.
99 A component used as a directory in \fIpathname\fP is not, in fact, a
103 \fIpathname\fP refers to a read-only filesystem.