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

int
await(char *buf, uint nbuf)
{
	Syscallmem *c;

	c = _getsyscallmem();
	c->arg[0] = 0;
	c->arg[1] = nbuf;
	c->nr = Sawait;
	if(_dosyscall(c) > 0)
		memmove(buf, &c[1], c->ret);
	return c->ret;
}

