]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
musl: meson: explicitly set _LARGEFILE64_SOURCE
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 9 Jun 2025 15:29:46 +0000 (00:29 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 Nov 2025 19:44:00 +0000 (04:44 +0900)
glibc sets it when _GNU_SOURCE is defined, however, musl does not.
Let's explicitly define it to make getdents64() and struct dirent64
available even when building with musl.

meson.build

index e3ee957fd5e018c60808d45a78a86b60fc42297b..6d576b4d2049c6bfd36f738e08032bf1d10a5583 100644 (file)
@@ -560,6 +560,10 @@ conf.set10('HAVE_WARNING_ZERO_AS_NULL_POINTER_CONSTANT', have)
 conf.set('_GNU_SOURCE', 1)
 conf.set('__SANE_USERSPACE_TYPES__', true)
 
+# glibc always defines _LARGEFILE64_SOURCE when _GNU_SOURCE is set, but musl does not do that,
+# and it is necessary for making getdents64() and struct dirent64 exist.
+conf.set('_LARGEFILE64_SOURCE', 1)
+
 conf.set('SIZEOF_DEV_T', cc.sizeof('dev_t', prefix : '#include <sys/types.h>'))
 conf.set('SIZEOF_INO_T', cc.sizeof('ino_t', prefix : '#include <sys/types.h>'))
 conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))