diff options
author | Timothy Pearson <[email protected]> | 2011-11-08 12:31:36 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-11-08 12:31:36 -0600 |
commit | d796c9dd933ab96ec83b9a634feedd5d32e1ba3f (patch) | |
tree | 6e3dcca4f77e20ec8966c666aac7c35bd4704053 /config.tests/unix/largefile/largefiletest.cpp | |
download | tqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.tar.gz tqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.zip |
Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731
Diffstat (limited to 'config.tests/unix/largefile/largefiletest.cpp')
-rw-r--r-- | config.tests/unix/largefile/largefiletest.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/config.tests/unix/largefile/largefiletest.cpp b/config.tests/unix/largefile/largefiletest.cpp new file mode 100644 index 000000000..ed04e7a4a --- /dev/null +++ b/config.tests/unix/largefile/largefiletest.cpp @@ -0,0 +1,32 @@ +/* Sample program for configure to test Large File support on target +platforms. +*/ + +#define _LARGEFILE_SOURCE +#define _LARGE_FILES +#define _FILE_OFFSET_BITS 64 +#include <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <assert.h> +#include <stdio.h> + +int main( int, 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; +} |