[Box Backup-dev] COMMIT r310 - in box/trunk: . lib/common test/raidfile
boxbackup-dev at fluffy.co.uk
boxbackup-dev at fluffy.co.uk
Sat Jan 7 23:35:59 GMT 2006
Author: martin
Date: 2006-01-07 23:35:52 +0000 (Sat, 07 Jan 2006)
New Revision: 310
Modified:
box/trunk/configure.ac
box/trunk/lib/common/BoxPlatform.h
box/trunk/test/raidfile/intercept.cpp
Log:
Fix raidfile intercept tests on 32 bit Linux with large file support.
Now intercept tests are never disabled.
Modified: box/trunk/configure.ac
===================================================================
--- box/trunk/configure.ac 2006-01-06 20:36:15 UTC (rev 309)
+++ box/trunk/configure.ac 2006-01-07 23:35:52 UTC (rev 310)
@@ -132,17 +132,13 @@
### Miscellaneous complicated feature checks
## Check for large file support active. AC_SYS_LARGEFILE has already worked
-## out how to enable it if necessary, we need to know if we've got it so we
-## can disable the raidfile intercepts
+## out how to enable it if necessary, we just use this to report to the user
AC_CACHE_CHECK([if we have large file support enabled], [have_large_file_support],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[$ac_includes_default]], [[
return sizeof(off_t)==4;
]])],
[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 large file support is in use])
-fi
## Find out how to do file locking
AC_CHECK_FUNCS([flock])
Modified: box/trunk/lib/common/BoxPlatform.h
===================================================================
--- box/trunk/lib/common/BoxPlatform.h 2006-01-06 20:36:15 UTC (rev 309)
+++ box/trunk/lib/common/BoxPlatform.h 2006-01-07 23:35:52 UTC (rev 310)
@@ -47,11 +47,6 @@
#endif
#endif
-// Cannot do the intercepts in test/raidfile if large file support is enabled
-#ifdef HAVE_LARGE_FILE_SUPPORT
- #define PLATFORM_CLIB_FNS_INTERCEPTION_IMPOSSIBLE
-#endif
-
#ifdef HAVE_DEFINE_PRAGMA
// set packing to one bytes (can't use push/pop on gcc)
#define BEGIN_STRUCTURE_PACKING_FOR_WIRE #pragma pack(1)
Modified: box/trunk/test/raidfile/intercept.cpp
===================================================================
--- box/trunk/test/raidfile/intercept.cpp 2006-01-06 20:36:15 UTC (rev 309)
+++ box/trunk/test/raidfile/intercept.cpp 2006-01-07 23:35:52 UTC (rev 310)
@@ -162,6 +162,15 @@
}
extern "C" int
+open64(const char *path, int flags, mode_t mode)
+{
+ // With _FILE_OFFSET_BITS set to 64 this should really use (flags |
+ // O_LARGEFILE) here, but not actually necessary for the tests and not
+ // worth the trouble finding O_LARGEFILE
+ return open(path, flags, mode);
+}
+
+extern "C" int
close(int d)
{
CHECK_FOR_FAKE_ERROR_COND(d, SIZE_ALWAYS_ERROR, SYS_close, -1);
@@ -245,6 +254,10 @@
#else
#ifdef HAVE_LSEEK_DUMMY_PARAM
off_t r = syscall(SYS_lseek, fildes, 0 /* extra 0 required here! */, offset, whence);
+ #elif defined(_FILE_OFFSET_BITS)
+ // Don't bother trying to call SYS__llseek on 32 bit since it is
+ // fiddly and not needed for the tests
+ off_t r = syscall(SYS_lseek, fildes, (uint32_t)offset, whence);
#else
off_t r = syscall(SYS_lseek, fildes, offset, whence);
#endif
More information about the Boxbackup-dev
mailing list