Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mkfifo(2) — CLIX 3.1r7.6.28

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chmod(8)

mkdir(1)

mknod(8)

mkfifo(2)

chmod(2)

mkdir(2)

mknod(2)

open(2)

umask(2)



  mkfifo(2)                           CLIX                           mkfifo(2)



  NAME

    mkfifo - Creates a FIFO special file

  LIBRARY

    Standard C Library (libc.a)

  SYNOPSIS

    #include <sys/types.h>

    #include <sys/stat.h>

    int mkfifo(
      char *path ,
      mode_t mode );

  PARAMETERS

    path   Points to the name of the new file.

    mode   Specifies the file permission bits (see the mknod() function) of
           the file to be created except those set in the process file mode
           creation mask.  (See the umask() function.)

  DESCRIPTION

    The mkfifo() function creates a new FIFO special file named by the
    pathname pointed to by path.  The new file has the following
    characteristics:

    ⊕  Owner ID set to the process effective user ID

    ⊕  Group ID set to the process effective group ID

    ⊕  The file permission bits of the new FIFO are initialized from mode.
       The file permission bits of the mode parameter are modified by the
       process file creation mask.  (See the umask() function.)

  EXAMPLES

    To create a fifo with read-only permissions for all users:

    if (mkfifo("fifo_file", S_IRUSR | S_IRGRP | S_IROTH) == -1)
            perror("Mkfifo failed");

    In this example, S_IRUSR, S_IRGRP, and S_IROTH are chmod() mode
    parameters.

  RETURN VALUES



  2/94 - Intergraph Corporation                                              1






  mkfifo(2)                           CLIX                           mkfifo(2)



    Upon successful completion, a value of 0 is returned.  If mkfifo() fails,
    a value of -1 is returned and the global variable errno is set to indicate
    the error.

  ERRORS

    The mkfifo() function fails and the new file is not created if one or more
    of the following are true:

    [EEXIST]
           The named file exists.

    [EROFS]
           The directory in which the file is to be created is located on a
           read-only file system.

    [ENOSPC]
           No space is available.

    [EACCES]
           A component of the path prefix denies search permission.

    [ENOTDIR]
           A component of the path prefix is not a directory.

    [ENAMETOOLONG]
           The length of the path parameter exceeds PATH_MAX, or a pathname
           component is longer than NAME_MAX while _POSIX_NO_TRUNC is in
           effect.

    [ENOENT]
           A component of the path prefix does not exist.

    [EFAULT]
           The path parameter points outside the allocated address space of
           the process.

    [EINTR]
           A signal was caught during the mkfifo() function.

    [ENOLINK]
           The path parameter points to a remote machine and the link to that
           machine is no longer active.

    [EMULTIHOP]
           Components of path require hopping to multiple remote machines.

  RELATED INFORMATION

    Commands: chmod(8), mkdir(1), mknod(8)




  2                                              Intergraph Corporation - 2/94






  mkfifo(2)                           CLIX                           mkfifo(2)



    Functions: chmod(2), mkdir(2), mknod(2), open(2), umask(2)





















































  2/94 - Intergraph Corporation                                              3




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026