summaryrefslogtreecommitdiffstats
path: root/config/cmake
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2011-10-20 19:08:42 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2011-10-20 19:08:42 (GMT)
commit705d92a7966e8697c8ddc5824733e95e2e56c031 (patch)
treeb2426c8635a46521574d735633cd6dceb07757cf /config/cmake
parentb15ebb546ee87bf7deae3c88687d1966b0e56aa5 (diff)
downloadhdf5-705d92a7966e8697c8ddc5824733e95e2e56c031.zip
hdf5-705d92a7966e8697c8ddc5824733e95e2e56c031.tar.gz
hdf5-705d92a7966e8697c8ddc5824733e95e2e56c031.tar.bz2
[svn-r21622] Update LFS test
Tested: local linux
Diffstat (limited to 'config/cmake')
-rw-r--r--config/cmake/HDF5Tests.c43
1 files changed, 37 insertions, 6 deletions
diff --git a/config/cmake/HDF5Tests.c b/config/cmake/HDF5Tests.c
index f580bbc..4887454 100644
--- a/config/cmake/HDF5Tests.c
+++ b/config/cmake/HDF5Tests.c
@@ -336,6 +336,37 @@ int main()
}
#endif
+#ifdef TEST_LFS_WORKS
+/* Return 0 when LFS is available and 1 otherwise. */
+#define _LARGEFILE_SOURCE
+#define _LARGEFILE64_SOURCE
+#define _LARGE_FILES
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <assert.h>
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ /* check that off_t can hold 2^63 - 1 and perform basic operations... */
+#define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ if (OFF_T_64 % 2147483647 != 1)
+ return 1;
+
+ // stat breaks on SCO OpenServer
+ struct stat buf;
+ stat( argv[0], &buf );
+ if (!S_ISREG(buf.st_mode))
+ return 2;
+
+ FILE *file = fopen( argv[0], "r" );
+ off_t offset = ftello( file );
+ fseek( file, offset, SEEK_CUR );
+ fclose( file );
+ return 0;
+}
+#endif
#ifdef GETTIMEOFDAY_GIVES_TZ
#ifdef HAVE_SYS_TIME_H
@@ -380,14 +411,14 @@ int main ()
typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
int main ()
{
- PGNSI pGNSI;
- pGNSI = (PGNSI) GetProcAddress(
+ PGNSI pGNSI;
+ pGNSI = (PGNSI) GetProcAddress(
GetModuleHandle(TEXT("kernel32.dll")),
"InitOnceExecuteOnce");
- if(NULL == pGNSI)
- return 1;
- else
- return 0;
+ if(NULL == pGNSI)
+ return 1;
+ else
+ return 0;
}
#endif /* HAVE_IOEO */