diff options
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | lib/intercept/intercept.cpp | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 54d917e2..3aa96832 100644 --- a/configure.ac +++ b/configure.ac @@ -225,6 +225,11 @@ AC_CACHE_CHECK([if we have large file support enabled], [have_large_file_support [have_large_file_support=yes], [have_large_file_support=no] )]) +if test "x$have_large_file_support" = "xyes"; then + AC_DEFINE([HAVE_LARGE_FILE_SUPPORT], [1], + [Define to 1 if large files are supported]) +fi + ## Find out how to do file locking AC_CHECK_FUNCS([flock]) AC_CHECK_DECLS([O_EXLOCK],,, [[#include <fcntl.h>]]) diff --git a/lib/intercept/intercept.cpp b/lib/intercept/intercept.cpp index 44e9424d..a0c13521 100644 --- a/lib/intercept/intercept.cpp +++ b/lib/intercept/intercept.cpp @@ -457,7 +457,7 @@ struct dirent *readdir(DIR *dir) if (readdir_real == NULL) { - #if defined readdir && readdir == readdir64 + #ifdef HAVE_LARGE_FILE_SUPPORT readdir_real = (readdir_t*)find_function("readdir64"); #else readdir_real = (readdir_t*)find_function("readdir"); @@ -506,13 +506,13 @@ lstat(const char *file_name, STAT_STRUCT *buf) if (lstat_real == NULL) { #ifdef LINUX_WEIRD_LSTAT - #if defined __lxstat && __lxstat == __lxstat64 + #ifdef HAVE_LARGE_FILE_SUPPORT lstat_real = (lstat_t*)find_function("__lxstat64"); #else lstat_real = (lstat_t*)find_function("__lxstat"); #endif #else - #if defined lstat && lstat == lstat64 + #ifdef HAVE_LARGE_FILE_SUPPORT lstat_real = (lstat_t*)find_function("lstat64"); #else lstat_real = (lstat_t*)find_function("lstat"); |