#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]);
}



syntax highlighted by Code2HTML, v. 0.9.1