Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mkfifo(3) [osf1 man page]

mkfifo(3)						     Library Functions Manual							 mkfifo(3)

NAME
mkfifo - Creates a FIFO LIBRARY
Standard C Library (libc.a) System V Compatibility Library (libsys5.a) SYNOPSIS
#include <sys/types.h> #include <sys/stat.h> int mkfifo ( const char *path, mode_t mode ); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: mkfifo(): POSIX.1, XPG4, XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Names the new file. If the final component of the path parameter names a symbolic link, the link will be traversed and pathname resolution will continue. Specifies the type, attributes, and access permissions of the file. This parameter is constructed by logically ORing val- ues described in the sys/mode.h header file. The mode is then modified by the current file mode creation mask (umask) value. DESCRIPTION
The mkfifo function used with libc.a is an interface to the mknod function, where the file that is to be created is a FIFO special file. When used with libsys5.a, the mkfifo() function creates a uni-directional STREAMS based file descriptor. No special system privileges are required under either implementation. Upon successful completion, the mkfifo() function marks the st_atime, st_ctime, and st_mtime fields of the file for update, and sets the st_ctime and st_mtime fields of the directory that contains the new entry for update. RETURN VALUES
Upon successful completion of mkfifo(), a value of 0 (zero) is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. ERRORS
If the mkfifo() function fails, the new file is not created and errno may be set to one of the following values: A component of the path prefix denies search permission, or write permission is denied on the parent directory of the FIFO to be created. The directory in which the entry for the new link is being placed cannot be extended because the user's quota of disk blocks or inodes on the file system is exhausted. The named file exists. Too many links were encountered in translating path. No more file descriptors are available for this process. The system file table is full, or the device containing the pipes has no free inodes. The length of the path parameter exceeds PATH_MAX or a pathname component is longer than NAME_MAX. A component of the path prefix does not exist or the path parameter points to an empty string. The directory that would contain the new file cannot be extended or the file system is out of file allocation resources. A component of the path prefix is not a directory. The mode parameter specifies a file type other than S_IFIFO and the calling process does not have the DEV_CONFIG system privilege. The directory in which the file is to be created is located on a read-only file system. RELATED INFORMATION
Commands: chmod(1), mkdir(1), mkfifo(1) Functions: chmod(2), mkdir(2), mknod(2), open(2), stat(2), umask(2) Standards: standards(5) delim off mkfifo(3)

Check Out this Related Man Page

mkfifo(3C)						   Standard C Library Functions 						mkfifo(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. If path names a symbolic link, mkfifo() fails and sets errno to EEXIST. 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 Too many symbolic links were encountered in resolving path. ENAMETOOLONG The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}. EXAMPLES
Example 1 Create a FIFO File The following example demonstrates how to create a FIFO file named /home/cnd/mod_done with read and write permissions for the owner and read permissions for the group and others. #include sys/types.h> #include sys/stat.h> int status; ... status = mkfifo("/home/cnd/mod_done", S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH); ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mkdir(1), chmod(2), exec(2), mknod(2), umask(2), stat.h(3HEAD), ufs(7FS), attributes(5), standards(5) SunOS 5.11 24 Apr 2002 mkfifo(3C)
Man Page