-
Notifications
You must be signed in to change notification settings - Fork 1.1k
add musl and glibc wrappers for getdents{,64} #4522
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
base: main
Are you sure you want to change the base?
Conversation
d91a5d0
to
a23fedf
Compare
d6e29f6
to
5d4300a
Compare
I do not understand why freebsd tests would be failing if I have not modified any code or semver tests for freebsd. It appears the tests are failing on methods I have not modified (https://cirrus-ci.com/task/5573619788546048):
|
a5a28a1
to
f16f1da
Compare
Ok, now I'm getting a failure in a musl shard (
The Any pointers on how one would typically debug this would be appreciated. I know the header |
the musl bundled with rust appears to be from january 2024
Ok, after testing this locally against a separate project (since the |
Ok, it looks like the freebsd shards are failing on |
Description
The method
posix_getdents()
has recently been added in POSIX issue 8 (from 2024). This method offers a standard interface to retrieve multiple directory entries at once into a preallocated buffer. This typically translates directly to a syscall using the existingSYS_getdents{,64}
key.However, as
posix_getdents()
is so new, it has not been universally implemented yet. musl added it immediately last year, but glibc does not yet have it. Instead, glibc >= 2.30 has the methodgetdents64()
, which is Linux-only.While musl appears to implement
posix_getdents()
for all supported platforms, it appears that the version of musl rust pulls in is not from the local machine, but from its own bundled copy. This copy does not haveposix_getdents()
, but instead simply hasgetdents64()
to match glibc on linux.So this PR only adds
getdents64()
on glibc linux, andgetdents{,64}()
on musl linux.Sources
posix_getdents()
): https://github.com/bminor/musl/blob/86373b4999bfd9a9379bc4a3ca877b1c80a2a340/src/dirent/posix_getdents.c#L6getdents()
): https://github.com/bminor/musl/blob/86373b4999bfd9a9379bc4a3ca877b1c80a2a340/src/linux/getdents.c#L6getdents64()
): https://github.com/bminor/musl/blob/86373b4999bfd9a9379bc4a3ca877b1c80a2a340/include/dirent.h#L80getdents64()
): https://github.com/bminor/glibc/blob/7eed691cc2b6c5dbb6066ee1251606a744c7f05c/sysdeps/unix/sysv/linux/bits/dirent_ext.h#L29Checklist
libc-test/semver
have been updated*LAST
or*MAX
areincluded (see #3131)
cd libc-test && cargo test --target mytarget
);especially relevant for platforms that may not be checked in CI
@rustbot label +stable-nominated