title: How to create named pipe (mkfifo) in Android?
body: <p>I am having trouble in creating named pipe in Android and the example below illustrates my dilemma:</p>
  
  <pre><code>res = mkfifo("/sdcard/fifo9000", S_IRWXO);
  if (res != 0)
  {
      LOG("Error while creating a pipe (return:%d, errno:%d)", res, errno);
  }
  </code></pre>
  
  <p>The code always prints:</p>
  
  <pre><code>Error while creating a pipe (return:-1, errno:1)
  </code></pre>
  
  <p>I can't figure out exactly why this fails. The application has android.permission.WRITE_EXTERNAL_STORAGE permissions. I can create normal files with exactly the same name in the same location, but pipe creation fails. The pipe in question should be accessible from multiple applications.</p>
  
  <ol>
  <li>I suspect that noone can create pipes in /sdcard. Where would it be the best location to do so?</li>
  <li>What mode mast should I set (2nd parameter)?</li>
  <li>Does application need any extra permissions?</li>
  </ol>