summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--config.h6
-rwxr-xr-xlibntfs-3g/unix_io.c18
2 files changed, 23 insertions, 1 deletions
diff --git a/libntfs-3g/unix_io.c b/libntfs-3g/unix_io.c
index 4f2c18b..799db0b 100755
--- a/libntfs-3g/unix_io.c
+++ b/libntfs-3g/unix_io.c
@@ -61,10 +61,14 @@
#include "logging.h"
#include "misc.h"
+#ifdef __USE_FILE_OFFSET64
+#include <unistd.h>
+#endif
+
#define DEV_FD(dev) (*(int *)dev->d_private)
#ifdef __USE_FILE_OFFSET64
-#include <unistd.h>
+#define fcntl __fcntl64
#endif
/* Define to nothing if not present on this system. */
@@ -227,7 +231,11 @@ static int ntfs_device_unix_io_close(struct ntfs_device *dev)
static s64 ntfs_device_unix_io_seek(struct ntfs_device *dev, s64 offset,
int whence)
{
+#ifdef __USE_FILE_OFFSET64
return lseek64(DEV_FD(dev), offset, whence);
+#else
+ return lseek(DEV_FD(dev), offset, whence);
+#endif
}
/**
@@ -281,7 +289,11 @@ static s64 ntfs_device_unix_io_write(struct ntfs_device *dev, const void *buf,
static s64 ntfs_device_unix_io_pread(struct ntfs_device *dev, void *buf,
s64 count, s64 offset)
{
+#ifdef __USE_FILE_OFFSET64
return pread64(DEV_FD(dev), buf, count, offset);
+#else
+ return pread(DEV_FD(dev), buf, count, offset);
+#endif
}
/**
@@ -303,7 +315,11 @@ static s64 ntfs_device_unix_io_pwrite(struct ntfs_device *dev, const void *buf,
return -1;
}
NDevSetDirty(dev);
+#ifdef __USE_FILE_OFFSET64
return pwrite64(DEV_FD(dev), buf, count, offset);
+#else
+ return pwrite(DEV_FD(dev), buf, count, offset);
+#endif
}
/**