When creating new programs to access large POSIX files:
Place the following Define statement in front of the first Include statement:
#define _LARGEFILE64_SOURCE 1
Specify the header unistd.h as the first Include statement.
Then the program will have all interfaces and data types it needs available to it.Use the 64-bit functions to access large POSIX files, i.e. simply use open64(), lseek64(), ... instead of the normal functions open(), lseek(),... .
The following list provides an overview of all 64-bit functions:creat64() fstat64() lseek64() stat64() fgetpos64() fstatvfs64() lstat64() statvf64()s fopen64() ftell64() mmap64() statvfs64() freopen64() ftruncate64() open64() truncate64() fseek64() getdents64() readdir64() fsetpos64()
getrlimit64()
setrlimit64()
Use the 64-bit data types in the program instead of the 32-bit data types, e.g. off64_t (64-Bit) instead of off_t (32-Bit). These data types are defined in the Include file sys/types.h. This allows the 64-bit and 32-bit interfaces to be used in parallel in a program, e.g. lseek() and lseek64(). This facilitates migration of programs.