basic: add comment for LFS assert in dirent-util.h

Followup to eb29296937 as promised; requested
by lennart at https://github.com/systemd/systemd/pull/27599#discussion_r1192619263.
This commit is contained in:
Sam James
2023-08-13 10:40:36 +01:00
committed by Luca Boccassi
parent a0b0b670ab
commit 0b4e0943a0
+2
View File
@@ -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));