1MKFIFO(3)                  Linux Programmer's Manual                 MKFIFO(3)
2
3
4

NAME

6       mkfifo - make a FIFO special file (a named pipe)
7

SYNOPSIS

9       #include <sys/types.h>
10       #include <sys/stat.h>
11
12       int mkfifo(const char *pathname, mode_t mode);
13

DESCRIPTION

15       mkfifo()  makes a FIFO special file with name pathname.  mode specifies
16       the FIFO's permissions.  It is modified by the process's umask  in  the
17       usual way: the permissions of the created file are (mode & ~umask).
18
19       A  FIFO special file is similar to a pipe, except that it is created in
20       a different way.  Instead of being an anonymous communications channel,
21       a  FIFO  special  file  is  entered  into  the  file  system by calling
22       mkfifo().
23
24       Once you have created a FIFO special file in this way, any process  can
25       open  it  for  reading or writing, in the same way as an ordinary file.
26       However, it has to be open at both ends simultaneously before  you  can
27       proceed to do any input or output operations on it.  Opening a FIFO for
28       reading normally blocks until some other process opens  the  same  FIFO
29       for  writing,  and vice versa.  See fifo(7) for nonblocking handling of
30       FIFO special files.
31

RETURN VALUE

33       On success mkfifo() returns 0.  In the case of an error, -1 is returned
34       (in which case, errno is set appropriately).
35

ERRORS

37       EACCES One  of  the  directories in pathname did not allow search (exe‐
38              cute) permission.
39
40       EDQUOT The user's quota of disk blocks or inodes on the file system has
41              been exhausted.
42
43       EEXIST pathname  already exists.  This includes the case where pathname
44              is a symbolic link, dangling or not.
45
46       ENAMETOOLONG
47              Either the total length of pathname is greater than PATH_MAX, or
48              an  individual  filename  component  has  a  length greater than
49              NAME_MAX.  In the GNU system, there is no imposed limit on over‐
50              all  filename  length, but some file systems may place limits on
51              the length of a component.
52
53       ENOENT A directory component in pathname does not exist or  is  a  dan‐
54              gling symbolic link.
55
56       ENOSPC The directory or file system has no room for the new file.
57
58       ENOTDIR
59              A  component  used as a directory in pathname is not, in fact, a
60              directory.
61
62       EROFS  pathname refers to a read-only file system.
63

CONFORMING TO

65       POSIX.1-2001.
66

SEE ALSO

68       mkfifo(1), close(2), open(2),  read(2),  stat(2),  umask(2),  write(2),
69       mkfifoat(3), fifo(7)
70

COLOPHON

72       This  page  is  part of release 3.53 of the Linux man-pages project.  A
73       description of the project, and information about reporting  bugs,  can
74       be found at http://www.kernel.org/doc/man-pages/.
75
76
77
78GNU                               2013-01-27                         MKFIFO(3)
Impressum