From Hackepedia
Jump to navigationJump to search

A Fifo is a named pipe. It is used for IPC. It is created with the mkfifo syscall or command. Fifos reside in the filesystem and require a process to read from it while another process writes to it. Unfortunately a process reading from a fifo does not know what the credentials of the process that wrote to it are, so in some regards it's worthless (use a UNIX socket with getpeereid if your system supports it instead). Messages passed through a fifo are atomic only if they are smaller than PIPE_SIZE (/usr/include/sys/pipe.h) meaning that if messages are larger and multiple processes are writing to the fifo the data may not arrive in the order that they were written to it and in fact becomes useless.