summaryrefslogtreecommitdiff
path: root/extstore.c
diff options
context:
space:
mode:
Diffstat (limited to 'extstore.c')
-rw-r--r--extstore.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/extstore.c b/extstore.c
index 9cd7ed8..790450b 100644
--- a/extstore.c
+++ b/extstore.c
@@ -773,11 +773,22 @@ static void *extstore_io_thread(void *arg) {
}
pthread_mutex_unlock(&p->mutex);
if (do_op) {
+#ifdef __APPLE__
+ ret = lseek(p->fd, SEEK_SET, p->offset + cur_io->offset);
+ if (ret >= 0) {
+ if (cur_io->iov == NULL) {
+ ret = read(p->fd, cur_io->buf, cur_io->len);
+ } else {
+ ret = readv(p->fd, cur_io->iov, cur_io->iovcnt);
+ }
+ }
+#else
if (cur_io->iov == NULL) {
ret = pread(p->fd, cur_io->buf, cur_io->len, p->offset + cur_io->offset);
} else {
ret = preadv(p->fd, cur_io->iov, cur_io->iovcnt, p->offset + cur_io->offset);
}
+#endif
}
break;
case OBJ_IO_WRITE: