#include <9pm/windows.h> #include <9pm/u.h> #include <9pm/libc.h> #include "syscall.h" int fd2path(int fd, char *buf, uint nbuf) { Syscallmem *c; c = _getsyscallmem(); c->arg[0] = fd; c->arg[1] = 0; c->arg[2] = nbuf; c->nr = Sfd2path; if(_dosyscall(c) >= 0) strcpy(buf, (char*)(&c[1])); return c->ret; }