code: purgatorio

ref: 51bcc63cc6bce3f9dab27cf6bd7155512b82c8fa
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);
}