Seth Woolley's Man Viewer

Manual for mkfifo - man 3 mkfifo

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

MKFIFO(3)                  Linux Programmer's Manual                 MKFIFO(3)

       mkfifo(1,3) - make a FIFO special file(1,n) (a named(5,8) pipe(2,8))

       #include <sys/types.h>
       #include <sys/stat.h>

       int mkfifo(1,3)(const char *pathname, mode_t mode);

       mkfifo(1,3)  makes  a  FIFO special file(1,n) with name pathname.  mode specifies
       the FIFO's permissions. It is modified by the process's  umask  in(1,8)  the
       usual way: the permissions of the created file(1,n) are (mode & ~umask).

       A  FIFO special file(1,n) is similar to a pipe(2,8), except that it is created in(1,8)
       a different way.  Instead of being an anonymous communications channel,
       a  FIFO special file(1,n) is entered into the file(1,n) system by calling mkfifo(1,3).

       Once you have created a FIFO special file(1,n) in(1,8) this way, any process  can
       open(2,3,n)  it  for  reading or writing, in(1,8) the same way as an ordinary file.
       However, it has to be open(2,3,n) at both ends simultaneously before  you  can
       proceed to do any input or output operations on it.  Opening a FIFO for
       reading normally blocks until some other process opens  the  same  FIFO
       for  writing,  and vice versa. See fifo(4) for non-blocking handling of
       FIFO special files.

       The normal, successful return value from mkfifo(1,3) is 0.  In the  case  of
       an error(8,n), -1 is returned (in(1,8) which case, errno is set(7,n,1 builtins) appropriately).

       EACCES One  of  the  directories in(1,8) pathname did not allow search (exe-
              cute) permission.

       EEXIST pathname already exists.

              Either the total length of pathname is greater than PATH_MAX, or
              an  individual  file(1,n)  name  component  has a length greater than
              NAME_MAX.  In the GNU system, there is no imposed limit on over-
              all  file(1,n) name length, but some file(1,n) systems may place limits on
              the length of a component.

       ENOENT A directory component in(1,8) pathname does not exist or  is  a  dan-
              gling symbolic link.

       ENOSPC The directory or filesystem has no room for the new file.

              A  component  used as a directory in(1,8) pathname is not, in(1,8) fact, a

       EROFS  pathname refers to a read-only filesystem.


       mkfifo(1,3)(1), close(2,7,n)(2), open(2,3,n)(2),  read(2,n,1 builtins)(2),  stat(1,2)(2),  umask(2),  write(1,2)(2),

Linux 1.2.13                      1995-09-03                         MKFIFO(3)

References for this manual (incoming links)