compat: off64_t is not defined by musl
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 17 Jan 2023 21:57:35 +0000 (16:57 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 22 Feb 2023 21:55:27 +0000 (16:55 -0500)
commit57fd993799a2b081c826f6fc8def32d28d526bfb
treed511e26c2bec7de06afb5f54f5c60e8d2e3b9028
parent7e090e6bea2c8ea8ef7b776caf17b529b1e1f7ce
compat: off64_t is not defined by musl

This helps compile with latest musl, where off64_t is not defined unless
_LARGEFILE64_SOURCE is defined. On glibc, _LARGEFILE64_SOURCE is defined
if _GNU_SOURCE is defined, so the problem is only seen with musl.

Since the project uses AC_SYS_LARGEFILE, which from the autoconf doc:
"arrange for 64-bit file offsets, known as large-file support."

As such, it is safe to assume off_t is 64-bit wide. This is checked by a
static_assert to catch any platform where autoconf would let a 32-bit
off_t slip.

Reported-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: If2c6007a8c85bc3f3065002af8a7538b882fb4a8
src/common/compat/compat-fcntl.cpp
src/common/compat/fcntl.hpp
This page took 0.02491 seconds and 4 git commands to generate.