title: Exposing an API as multiple named pipe (FIFO) files in C
body: <p>I'm creating a C application daemon that I want to be able to interact with through named pipes. For example, I write in the shell <code>echo hello &gt; /tmp/appname/interface</code>, and the application reads it and does stuff with what I just echoed into the named pipe.</p>
  
  <p>I've successfully managed to implement this with a singular named pipe with <code>read()</code>. However, I want to be able to listen to many different named pipes at the same time. I don't think spawning a new thread for each named pipe is a very good solution. I am also concerned about whether constantly listening for something to be written to the named pipes with <code>read()</code> will use an unnecessarily high amount of CPU. Is there a better way to approach this?</p>