-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dirent-util: Remove asserts on dirent64 == dirent #25809
Conversation
These lines are just for safety. Even if they are redundant, they should not hurt anything. Why do you want to drop them? |
the lfs64 functions like |
Hmm, but, the relation between This sounds mostly for musl. Then, I'd like to request to add |
Can you explain whats non-trivial ? In musl
Sure, I have that already. This was just trying to clean up systemd. |
Hmm, this is just safety stuff that doesnt do anything. It just checks that lfs support works the way it should. Sre you suggesting this breaks on musl? Or why the change? |
The difference between dirent and dirent64 is simple, but it is not simple when the guards
So, I do not think this is a good cleanup... This potentially reduces safety. |
Anyway, please explain what the rationale behind this is? Does this fix anything for you on musl? Or is this merely about cleaning up a test that is redundant in your eyes? |
so, the reason why i think we should keep this extra safety net is mostly because _FILE_OFFSET_BITS is a generic cross-platform thing, and getdents() is a Linux-specific thing that various libcs are known to define differently even. Hence the assumption that the generic, widely-accepted concept also covers the Linux-specific function/structure here seems a bit too much of a stretch to me, hence the extra safety net. |
it is one patch less to keep systemd working with latest musl. Since latest musl has deprecated LFS64 functions, this patch is required. |
christ, musl doesn't care the least bit about compatibility, does it? |
so does musl also get rid of getdents64() given the "64" in its name? honestly it appears to me that musl builds should really just do |
@kraj btw, while i have you: With 45519d1 you can drop https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd/0013-Define-glibc-compatible-basename-for-non-glibc-syste.patch Also, current kernels have faccessat2(), hence https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd/0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch is actively breaking things on current kernels (and a terrible idea anyway) Also this is entirely redundant: https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/systemd/systemd/0002-Add-sys-stat.h-for-S_IFDIR.patch – since quite a while sys/stat.h is included already, just a few lines up |
We already have assert_cc(_FILE_OFFSET_BITS == 64) which ensures that 64bit LFS functions are same as their original counterparts Signed-off-by: Khem Raj <raj.khem@gmail.com>
I agree with @yuwata: this change increases risk. Ifdefs are easy to get wrong. Maybe instead add a meson check if |
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: systemd#25809
Superseded by #27599. |
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: #25809
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: systemd/systemd#25809 (cherry picked from commit eb29296)
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: systemd/systemd#25809 (cherry picked from commit eb29296)
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: systemd/systemd#25809 (cherry picked from commit eb29296)
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: systemd/systemd#25809 (cherry picked from commit eb29296) (cherry picked from commit 4984f70)
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: systemd/systemd#25809 (cherry picked from commit eb29296) (cherry picked from commit 4984f70)
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: systemd/systemd#25809 (cherry picked from commit eb29296) (cherry picked from commit 4984f70) (cherry picked from commit bff6cef)
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: systemd/systemd#25809 (cherry picked from commit eb29296) (cherry picked from commit 4984f70) (cherry picked from commit bff6cef)
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: systemd/systemd#25809
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: systemd/systemd#25809
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: systemd/systemd#25809 (cherry picked from commit eb29296937b268e0140a2ab1cf204c2ebb72fa5a) (cherry picked from commit 4984f70db5b1ce3103dfb6b2ecdbced86bf92703)
We already have assert_cc(_FILE_OFFSET_BITS == 64) which ensures that 64bit LFS functions are same as their original counterparts
Signed-off-by: Khem Raj raj.khem@gmail.com