OS‎ > ‎IPC‎ > ‎


A FIFO (“First In, First Out”, pronounced “Fy-Foh”) is sometimes known as a named pipe.

This latter aspect of FIFOs is designed to let them get around one of the shortcomings of normal pipes: you can't grab one end of a normal pipe that was created by an unrelated process. See, if I run two individual copies of a program, they can both call pipe() all they want and still not be able to speak to one another.

The FIFO is actually a file on disk, you just have to call mknod() with the proper arguments.
The FIFO file will be called “myfifo”. The second argument is the creation mode, which is used to tell mknod() to make a FIFO (the S_IFIFO part of the OR) and sets access permissions to that file (octal 644, or rw-r--r--).

mknod("myfifo", S_IFIFO | 0644 , 0);