| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- make a FIFO special file
#include <sys/stat.h>intmkfifo(const char *path,mode_tmode);
int mkfifoat(intfd, const char *path, mode_tmode);
Themkfifo() function creates a new FIFO special file named by thepathname pointed to bypath. The file permission bits of thenew FIFO are initialized frommode. The file permission bits ofthemode argument are modified by the process's file creation mask (seeumask(2)).Bits other than the file permission bits inmode are ignored.
Ifpath names a symbolic link,mkfifo() fails and setserrno toEEXIST.
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 theparent directory or to the effective group ID of the process.
Themkfifo() function callsmknod(2) to create the file.
Upon successful completion,mkfifo() marks for update thest_atime,st_ctime, andst_mtimefields of the file. Also, thest_ctime andst_mtime fields of thedirectory that contains the new entry are marked for update.
Themkfifoat() function is equivalent tomkfifo() except in the case wherepath specifies a relative path. In this case the newly created FIFOis created relative to the directory associated with the file descriptorfdinstead of the current working directory. If the file descriptor was opened withoutO_SEARCH, the function checks whether directory searches are permitted using the currentpermissions of the directory underlying the file descriptor. If the file descriptorwas opened withO_SEARCH, the function does not perform the check
Ifmkfifoat() is passed the special valueAT_FDCWD in thefd parameter,the current working directory is used and the is be identical toa call tomkfifo().
Upon successful completion,0 is returned. Otherwise,-1 is returned anderrno is set to indicate the error.
Themkfifo() andmkfifoat() functions will fail if:
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 named file already exists.
A loop exists in symbolic links encountered during resolution of thepath argument.
The length of thepath argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
A component of the path prefix specified bypath does not name an existing directory orpath is 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 named file resides on a read-only file system.
Themkfifoat() functions will fail if:
fd was not opened withO_SEARCH and the permissions of the directory underlyingfd do not permit directory searches.
Thepath argument does not specify an absolute path and thefd argument is neitherAT_FDCWD nor a valid file descriptor open for reading or searching.
Themkfifo() andmkfifoat() functions may fail if:
Too many symbolic links were encountered in resolvingpath.
The length of thepath argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
Themkfifoat() functions may fail if:
Thepath argument is not an absolute path andfd is neitherAT_FDCWD nor a file descriptor associated with a directory.
Example 1 Create a FIFO File
The following example demonstrates how to create a FIFO file named/home/cnd/mod_donewith read and write permissions for the owner and read permissions forthe group and others.
#include sys/stat.h>int status;...status = mkfifo("/home/cnd/mod_done", S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);Seeattributes(5) for descriptions of the following attributes:
|
mkdir(1),chmod(2),exec(2),mknod(2),umask(2),stat.h(3HEAD),ufs(7FS),attributes(5),standards(5)
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |