5 |
|
* Substitute routines for pread(2) and pwrite(2) |
6 |
|
*/ |
7 |
|
|
8 |
< |
extern off_t lseek(); |
8 |
> |
#include "platform.h" |
9 |
|
|
10 |
|
|
11 |
|
int |
13 |
|
int fd; |
14 |
|
char *buf; |
15 |
|
unsigned int siz; |
16 |
< |
long pos; |
16 |
> |
long offs; |
17 |
|
{ |
18 |
< |
if (lseek(fd, (off_t)offs, 0) != offs) |
18 |
> |
if (lseek(fd, (off_t)offs, SEEK_SET) != offs) |
19 |
|
return(-1); |
20 |
|
return(read(fd, buf, siz)); |
21 |
|
/* technically, we should reset pointer here */ |
27 |
|
int fd; |
28 |
|
char *buf; |
29 |
|
unsigned int siz; |
30 |
< |
long pos; |
30 |
> |
long offs; |
31 |
|
{ |
32 |
< |
if (lseek(fd, (off_t)offs, 0) != offs) |
32 |
> |
if (lseek(fd, (off_t)offs, SEEK_SET) != offs) |
33 |
|
return(-1); |
34 |
|
return(write(fd, buf, siz)); |
35 |
|
/* technically, we should reset pointer here */ |