--- ray/src/common/preadwrite.c 2003/02/22 02:07:22 3.1 +++ ray/src/common/preadwrite.c 2003/10/20 16:01:55 3.2 @@ -1,11 +1,11 @@ #ifndef lint -static const char RCSid[] = "$Id: preadwrite.c,v 3.1 2003/02/22 02:07:22 greg Exp $"; +static const char RCSid[] = "$Id: preadwrite.c,v 3.2 2003/10/20 16:01:55 greg Exp $"; #endif /* * Substitute routines for pread(2) and pwrite(2) */ -extern off_t lseek(); +#include "platform.h" int @@ -13,9 +13,9 @@ pread(fd, buf, siz, offs) /* read buffer from an open int fd; char *buf; unsigned int siz; -long pos; +long offs; { - if (lseek(fd, (off_t)offs, 0) != offs) + if (lseek(fd, (off_t)offs, SEEK_SET) != offs) return(-1); return(read(fd, buf, siz)); /* technically, we should reset pointer here */ @@ -27,9 +27,9 @@ pwrite(fd, buf, siz, offs) /* write buffer to an open int fd; char *buf; unsigned int siz; -long pos; +long offs; { - if (lseek(fd, (off_t)offs, 0) != offs) + if (lseek(fd, (off_t)offs, SEEK_SET) != offs) return(-1); return(write(fd, buf, siz)); /* technically, we should reset pointer here */