summaryrefslogtreecommitdiffstats
path: root/src/basic/dirent-util.h
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-08-13 08:46:45 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2023-08-13 11:40:36 +0200
commit0b4e0943a01496837944b8d7bd1f5cd67597916e (patch)
tree66df6ff7cce3932d704345df5732e0f7d598b431 /src/basic/dirent-util.h
parenttest: skip test-path on Salsa CI (diff)
downloadsystemd-0b4e0943a01496837944b8d7bd1f5cd67597916e.tar.xz
systemd-0b4e0943a01496837944b8d7bd1f5cd67597916e.zip
basic: add comment for LFS assert in dirent-util.h
Followup to eb29296937b268e0140a2ab1cf204c2ebb72fa5a as promised; requested by lennart at https://github.com/systemd/systemd/pull/27599#discussion_r1192619263.
Diffstat (limited to 'src/basic/dirent-util.h')
-rw-r--r--src/basic/dirent-util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/basic/dirent-util.h b/src/basic/dirent-util.h
index f695885948..0a2fcbf957 100644
--- a/src/basic/dirent-util.h
+++ b/src/basic/dirent-util.h
@@ -36,6 +36,8 @@ struct dirent *readdir_no_dot(DIR *dirp);
/* Only if 64-bit off_t is enabled struct dirent + struct dirent64 are actually the same. We require this, and
* we want them to be interchangeable to make getdents64() work, hence verify that. */
assert_cc(_FILE_OFFSET_BITS == 64);
+/* These asserts would fail on musl where the LFS extensions don't exist. They should
+ * always be present on glibc however. */
#if HAVE_STRUCT_DIRENT64
assert_cc(sizeof(struct dirent) == sizeof(struct dirent64));
assert_cc(offsetof(struct dirent, d_ino) == offsetof(struct dirent64, d_ino));