[ccextractor-users] [ISSUE] lseek64 does not work on my 32-bit system
Brought to you by:
cfsmp3
From: anshul <ans...@gm...> - 2014-05-21 04:44:00
|
Hi lseek64 return -1 at run time and while compiling compiler gives following warning. gcc -c -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -I../src/gpacmp4/ -I../src/libpng -I../src/zlib -O3 -std=gnu99 ../src/file_functions.c -o objs/file_functions.o ../src/file_functions.c: In function 'getfilesize': ../src/file_functions.c:14:5: warning: implicit declaration of function 'lseek64' [-Wimplicit-function-declaration] ../src/file_functions.c: In function 'gettotalfilessize': ../src/file_functions.c:31:9: warning: implicit declaration of function 'open64' [-Wimplicit-function-declaration] I have gone through man 7 feature_test_macro on linux , in which i interpreted that no need to use xxxx64, linux will do those things automatically if _FILE_OFFSET_BITS=64 is defined. following is variables from linux manuals: _LARGEFILE64_SOURCE: Expose definitions for the alternative API specified by the LFS (Large File Summit) as a "transitional extension" to the Single UNIX Specification. (See ?http://opengroup.org/platform/lfs.html?) The alternative API consists of a set of new objects (i.e., functions and types) whose names are suffixed with "64" (e.g., off64_t versus off_t, lseek64() versus lseek(), etc.). New programs should not employ this interface; instead _FILE_OFFSET_BITS=64 should be employed. _FILE_OFFSET_BITS: Defining this macro with the value 64 automatically converts references to 32-bit functions and data types related to file I/O and file system operations into references to their 64-bit counterparts. This is useful for performing I/O on large files (> 2 Gigabytes) on 32-bit systems. (Defining this macro permits correctly written programs to use large files with only a recompilation being required.) 64-bit systems naturally permit file sizes greater than 2 Gigabytes, and on those systems this macro has no effect. As our test server is 64bit the same issue is not reproduced there. Thanks Anshul |