]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/mkfifo.3
Updated CONFORMING TO section
[thirdparty/man-pages.git] / man3 / mkfifo.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" This manpage is Copyright (C) 1995 James R. Van Zandt <jrv@vanzandt.mv.com>
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" changed section from 2 to 3, aeb, 950919
26 .\"
27 .TH MKFIFO 3 1995-09-03 "Linux 1.2.13" "Linux Programmer's Manual"
28 .SH NAME
29 mkfifo \- make a FIFO special file (a named pipe)
30 .SH SYNOPSIS
31 .nf
32 .B #include <sys/types.h>
33 .B #include <sys/stat.h>
34 .sp
35 .BI "int mkfifo(const char *" pathname ", mode_t " mode );
36 .fi
37 .SH DESCRIPTION
38 \fBmkfifo\fP() makes a FIFO special file with name \fIpathname\fP.
39 \fImode\fP specifies the FIFO's permissions. It is modified by the
40 process's \fBumask\fP in the usual way: the permissions of the created
41 file are \fB(\fP\fImode\fP\fB & ~umask)\fP.
42 .PP
43 A FIFO special file is similar to a pipe, except that it is created
44 in a different way. Instead of being an anonymous communications
45 channel, a FIFO special file is entered into the file system by
46 calling \fBmkfifo\fP().
47 .PP
48 Once you have created a FIFO special file in this way, any process can
49 open it for reading or writing, in the same way as an ordinary file.
50 However, it has to be open at both ends simultaneously before you can
51 proceed to do any input or output operations on it. Opening a FIFO
52 for reading normally blocks until some other process opens the same
53 FIFO for writing, and vice versa. See
54 .BR fifo (7)
55 for non-blocking handling of FIFO special files.
56 .SH "RETURN VALUE"
57 On success \fImkfifo\fP() returns 0. In
58 the case of an error, -1 is returned (in which case, \fIerrno\fP
59 is set appropriately).
60 .SH ERRORS
61 .TP
62 .B EACCES
63 One of the directories in \fIpathname\fP did not allow search
64 (execute) permission.
65 .TP
66 .B EEXIST
67 \fIpathname\fP already exists.
68 .TP
69 .B ENAMETOOLONG
70 Either the total length of \fIpathname\fP is greater than
71 \fBPATH_MAX\fP, or an individual filename component has a length
72 greater than \fBNAME_MAX\fP. In the GNU system, there is no imposed
73 limit on overall filename length, but some file systems may place
74 limits on the length of a component.
75 .TP
76 .B ENOENT
77 A directory component in \fIpathname\fP does not exist or is a
78 dangling symbolic link.
79 .TP
80 .B ENOSPC
81 The directory or filesystem has no room for the new file.
82 .TP
83 .B ENOTDIR
84 A component used as a directory in \fIpathname\fP is not, in fact, a
85 directory.
86 .TP
87 .B EROFS
88 \fIpathname\fP refers to a read-only filesystem.
89 .SH "CONFORMING TO"
90 POSIX.1-2001.
91 .SH "SEE ALSO"
92 .BR mkfifo (1),
93 .BR close (2),
94 .BR open (2),
95 .BR read (2),
96 .BR stat (2),
97 .BR umask (2),
98 .BR write (2),
99 .BR mkfifoat (3),
100 .BR fifo (7)