Hi all, In src/os_unix.c line 105, _LARGE_FILE is defined if SQLITE_DISABLE_LFS is not defined. But before that, <sqliteInt.h> is included, which contains exactly the same #defines already. This means that _LARGE_FILE will be defined twice. Most likely, one day in the past this code moved from os_unix.c to sqliteInt.h, but it was never removed from the original location.
Therefore I suggest to remove this duplication in os_unix.c, leaving everything (including the later-added comment) in sqliteInt.h. Proposed patch below. Hopefully this resolves the confusion for people (like me) who notice this. And, when comments change, they don't need to be updated in two places any more. Regards, Jan Nijtmans ================================================== --- src/sqliteInt.h +++ src/sqliteInt.h @@ -32,10 +32,15 @@ ** without this option, LFS is enable. But LFS does not exist in the kernel ** in Red Hat 6.0, so the code won't work. Hence, for maximum binary ** portability you should omit LFS. ** ** Similar is true for Mac OS X. LFS is only supported on Mac OS X 9 and later . +** +** The previous paragraph was written in 2005. (This paragraph is written +** on 2008-11-28.) These days, all Linux kernels support large files, so +** you should probably leave LFS enabled. But some embedded platforms might +** lack LFS in which case the SQLITE_DISABLE_LFS macro might still be useful. */ #ifndef SQLITE_DISABLE_LFS # define _LARGE_FILE 1 # ifndef _FILE_OFFSET_BITS # define _FILE_OFFSET_BITS 64 --- src/os_unix.c +++ src/os_unix.c @@ -81,36 +81,10 @@ # else # define OS_VXWORKS 0 # endif #endif -/* -** These #defines should enable >2GB file support on Posix if the -** underlying operating system supports it. If the OS lacks -** large file support, these should be no-ops. -** -** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch -** on the compiler command line. This is necessary if you are compiling -** on a recent machine (ex: RedHat 7.2) but you want your code to work -** on an older machine (ex: RedHat 6.0). If you compile on RedHat 7.2 -** without this option, LFS is enable. But LFS does not exist in the kernel -** in RedHat 6.0, so the code won't work. Hence, for maximum binary -** portability you should omit LFS. -** -** The previous paragraph was written in 2005. (This paragraph is written -** on 2008-11-28.) These days, all Linux kernels support large files, so -** you should probably leave LFS enabled. But some embedded platforms might -** lack LFS in which case the SQLITE_DISABLE_LFS macro might still be useful. -*/ -#ifndef SQLITE_DISABLE_LFS -# define _LARGE_FILE 1 -# ifndef _FILE_OFFSET_BITS -# define _FILE_OFFSET_BITS 64 -# endif -# define _LARGEFILE_SOURCE 1 -#endif - /* ** standard include files. */ #include <sys/types.h> #include <sys/stat.h> _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users