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

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

	c = _getsyscallmem();
	c->arg[0] = fd;
	c->arg[1] = 0;
	c->arg[2] = nbuf;
	c->nr = Sfd2syspath;
	if(_dosyscall(c) >= 0)
		strcpy(buf, (char*)(&c[1]));
	return c->ret;
}



syntax highlighted by Code2HTML, v. 0.9.1