1 #define _LARGEFILE64_SOURCE
2 #define _XOPEN_SOURCE 500
9 int readall(int fd, void *buf, size_t len, loff_t offset)
15 if(lseek(fd, offset, SEEK_SET) != offset)
17 ret = read(fd, buf, len);
19 ret = pread64(fd, buf, len, offset);
33 int writeall(int fd, const void *buf, size_t len, loff_t offset)
39 if(lseek(fd, offset, SEEK_SET) != offset)
41 ret = write(fd, buf, len);
43 ret = pwrite64(fd, buf, len, offset);