Fifo

From Hackepedia
Revision as of 14:57, 3 December 2005 by Pbug (talk | contribs) (explanation of a fifo)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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.