Back to index

glibc  2.9
pipe.c File Reference
#include <errno.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <unistd.h>

Go to the source code of this file.


int __pipe (int fds[2])

Function Documentation

int __pipe ( int  fds[2])

Definition at line 30 of file pipe.c.

  int save_errno = errno;
  int result;

  /* The magic S_IFIFO protocol tells the pflocal server to create
     sockets which report themselves as FIFOs, as POSIX requires for
     pipes.  */
  result = __socketpair (PF_LOCAL, SOCK_STREAM, S_IFIFO, fds);
  if (result == -1 && errno == EPROTONOSUPPORT)
      /* We contacted an "old" pflocal server that doesn't support the
         magic S_IFIFO protocol.
        FIXME: Remove this junk somewhere in the future.  */
      __set_errno (save_errno);
      return __socketpair (PF_LOCAL, SOCK_STREAM, 0, fds);

  return result;

Here is the call graph for this function: