#include <9pm/windows.h>
#include <9pm/u.h>
#include <9pm/libc.h>
#include "syscall.h"

int
pipe(int *p)
{
	Syscallmem *c;
	ulong *a;

	c = _getsyscallmem();
	c->arg[0] = 0;
	c->nr = Spipe;
	if(_dosyscall(c) == -1)
		return -1;
	a = (ulong*)(&c[1]);
	p[0] = a[0];
	p[1] = a[1];
	return 0;
}

