Create a FIFO special file
#include <sys/types.h> #include <sys/stat.h> int mkfifo( const char* path, mode_t mode );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
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, modified by the process's creation mask (see umask()). Bits that are set in mode other than the file permission bits are ignored.
The FIFO owner ID is set to the process's effective user ID and the FIFO's group ID is set to the process's effective group ID.
If mkfifo() succeeds, the st_ftime, st_ctime, st_atime and st_mtime fields of the file are marked for update. Also, the st_ctime and st_mtime fields of the directory that contains the new entry are marked for update.
#include <sys/types.h> #include <sys/stat.h> #include <stdlib.h> int main( void ) { (void)mkfifo( "hd/qnx", S_IRUSR | S_IWUSR ); return EXIT_SUCCESS; }
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |