Use the standard stat()/fstat() interfaces, not nonstandard *64().

Most modern Unix environments use 64-bit off_t by default: OpenBSD,
FreeBSD, OS X, and Linux libc implementations such as Musl.

glibc is the lone exception; it can default to 32 bits but this is
configurable by setting _FILE_OFFSET_BITS.

Avoiding the stat64()/fstat64() interfaces is desirable because they
are nonstandard and not implemented on many systems (including
OpenBSD and FreeBSD), and using 64 bits for stat()/fstat() is either
the default or trivial to set up.
This commit is contained in:
Anthony J. Bentley
2016-07-17 04:30:00 -06:00
parent 92594e08d4
commit 5bab6210ef
3 changed files with 19 additions and 15 deletions
+9
View File
@@ -93,6 +93,15 @@ else()
add_definitions(-DDATA_DIR="${datadir}/")
endif()
# Set file offset size to 64 bits.
#
# On modern Unixes, this is typically already the case. The lone exception is
# glibc, which may default to 32 bits. glibc allows this to be configured
# by setting _FILE_OFFSET_BITS.
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_definitions(-D_FILE_OFFSET_BITS=64)
endif()
# Set where the binary files will be built. The program will not execute from
# here. You must run "make install" to install these to the proper location
# as defined above.