code: 9ferno

ref: 0977f294bab0345ba43fbf674449fd8e996c5719
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);
}