If you want multiple independent processes to read from the pipe, you need to use a named pipe, also known as a FIFO.
Using the mkfifo
function, one process creates a file in the file system (normally in /tmp
). This file can then be opened for reading or writing using the normal open
system call by any other process that have access to that file.