Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Standard C Library Functionsmkfifo(3C)


NAME

 mkfifo - make a FIFO special file

SYNOPSIS

 
#include <sys/types.h>
#include <sys/stat.h>
int mkfifo(const char *path, mode_t mode);

DESCRIPTION

 

The mkfifo() function creates a new FIFO special file named by the pathname pointed to by path. The file permission bits of the new FIFO are initialized from mode. The file permission bits of the mode argument are modified by the process's file creation mask (see umask(2)). Bits other than the file permission bits in mode are ignored.

The FIFO's user ID is set to the process's effective user ID. The FIFO's group ID is set to the group ID of the parent directory or to the effective group ID of the process.

The mkfifo() function calls mknod(2) to create the file.

Upon successful completion, mkfifo() marks for update the st_atime, st_ctime, and st_mtime fields of the file. Also, the st_ctime and st_mtime fields of the directory that contains the new entry are marked for update.

RETURN VALUES

 

Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.

ERRORS

 

The mkfifo() function will fail if:

EACCES
A component of the path prefix denies search permission, or write permission is denied on the parent directory of the FIFO to be created.
EEXIST
The named file already exists.
ELOOP
A loop exists in symbolic links encountered during resolution of the path argument.
ENAMETOOLONG
The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
ENOENT
A component of the path prefix specified by path does not name an existing directory or path is an empty string.
ENOSPC
The directory that would contain the new file cannot be extended or the file system is out of file-allocation resources.
ENOTDIR
A component of the path prefix is not a directory.
EROFS
The named file resides on a read-only file system.

The mkfifo() function may fail if:

ELOOP
More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument.

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelMT-Safe

SEE ALSO

 

mkdir(1), chmod(2), exec(2), mknod(2), umask(2), stat(3HEAD), fs_ufs(4), attributes(5)


SunOS 5.9Go To TopLast Changed 8 Aug 2001

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.