#include <9pm/windows.h> #include <9pm/u.h> #include <9pm/libc.h> #include "syscall.h" vlong seek(int fd, vlong off, int whence) { ulong *a; Syscallmem *c; c = _getsyscallmem(); c->arg[0] = 0; c->arg[1] = fd; *(vlong*)(c->arg+2) = off; a = (ulong*)((vlong*)(c->arg+2)+1); *a = whence; c->nr = Sseek; if(_dosyscall(c) == -1) return -1; return *(vlong*)(&c[1]); }