aboutsummaryrefslogtreecommitdiff
path: root/src/lib9/pipe.c
blob: 01b244ef61434728657aa4b68ced75f51612b0da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <u.h>
#define NOPLAN9DEFINES
#include <libc.h>
#include <sys/socket.h>

/*
 * We use socketpair to get a two-way pipe.
 * The pipe still doesn't preserve message boundaries.
 * Worse, it cannot be reopened via /dev/fd/NNN on Linux.
 */
int
p9pipe(int fd[2])
{
	return socketpair(AF_UNIX, SOCK_STREAM, 0, fd);
}