code: 9ferno

ref: b548687a8ed1d0a159c9d3f3f921d93bbb56908e
dir: /lib9/pread-Nt.c/

View raw version
#include "lib9.h"

long
pread(int fd, void *buf, long n, vlong offset)
{
	if(seek(fd, offset, 0) < 0)
		return -1;
	return read(fd, buf, n);
}