plan9port

[fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port # fast
git clone https://src.adamsgaard.dk/plan9port.git # slow
Log | Files | Refs | README | LICENSE Back to index

pipe.c (320B)


      1 #include <u.h>
      2 #define NOPLAN9DEFINES
      3 #include <libc.h>
      4 #include <sys/socket.h>
      5 
      6 /*
      7  * We use socketpair to get a two-way pipe.
      8  * The pipe still doesn't preserve message boundaries.
      9  * Worse, it cannot be reopened via /dev/fd/NNN on Linux.
     10  */
     11 int
     12 p9pipe(int fd[2])
     13 {
     14 	return socketpair(AF_UNIX, SOCK_STREAM, 0, fd);
     15 }