Whamcloud - gitweb
libext2fs: create the inode bitmap checksum
[tools/e2fsprogs.git] / lib / blkid / llseek.c
index 0f47632..658acc9 100644 (file)
@@ -12,6 +12,7 @@
 #define _LARGEFILE_SOURCE
 #define _LARGEFILE64_SOURCE
 
+#include "config.h"
 #if HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
@@ -45,11 +46,11 @@ extern long long llseek(int fd, long long offset, int origin);
 
 #else  /* ! HAVE_LLSEEK */
 
-#if defined(__alpha__) || defined(__ia64__)
+#if SIZEOF_LONG == SIZEOF_LONG_LONG
 
 #define llseek lseek
 
-#else /* !__alpha__ && !__ia64__*/
+#else /* SIZEOF_LONG != SIZEOF_LONG_LONG */
 
 #include <linux/unistd.h>
 
@@ -125,12 +126,16 @@ blkid_loff_t blkid_llseek(int fd, blkid_loff_t offset, int whence)
 
 blkid_loff_t blkid_llseek(int fd, blkid_loff_t offset, int origin)
 {
+#if defined(HAVE_LSEEK64) && defined(HAVE_LSEEK64_PROTOTYPE)
+       return lseek64 (fd, offset, origin);
+#else
        if ((sizeof(off_t) < sizeof(blkid_loff_t)) &&
            (offset >= ((blkid_loff_t) 1 << ((sizeof(off_t)*8) - 1)))) {
                errno = EOVERFLOW;
                return -1;
        }
        return lseek(fd, (off_t) offset, origin);
+#endif
 }
 
 #endif /* linux */