Skip to content
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

Many posix platforms should use readdir instead of readdir_r #40021

Closed
raphlinus opened this issue Feb 21, 2017 · 0 comments
Closed

Many posix platforms should use readdir instead of readdir_r #40021

raphlinus opened this issue Feb 21, 2017 · 0 comments

Comments

@raphlinus
Copy link
Contributor

Linux now deprecates readdir_r (see https://lwn.net/Articles/696474/ for the reasons for this deprecation), and Fuchsia doesn't implement it at all. There's already a configure switch in src/libstd/sys/unix/fs.rs, but it only selects readdir for Illumos.

The config should be switched to readdir at least for Fuchsia, and arguably for a number of other Posix-compatible systems as well. Sifting through exactly which should be which is beyond my scope, so I entrust this to the rust-libs community.

raphlinus added a commit to raphlinus/libc that referenced this issue Feb 21, 2017
The readdir_r call has problems, and we'll probably want to move to
readdir on many, if not most, unix targets. This patch makes readdir
available in unix, rather than just solaris as before.

See rust-lang/rust#40021
raphlinus added a commit to raphlinus/rust that referenced this issue Feb 21, 2017
The readdir_r function is deprecated on newer Posix systems because of
various problems, and not implemented at all for Fuchsia. There are
already implementations using both, and this patch switches Fuchsia
over to the readdir-based one.

Fixes rust-lang#40021 for Fuchsia, but that issue also contains discussion of
what should happen for other Posix systems.
raphlinus added a commit to raphlinus/rust that referenced this issue Feb 21, 2017
The readdir_r function is deprecated on newer Posix systems because of
various problems, and not implemented at all for Fuchsia. There are
already implementations using both, and this patch switches Fuchsia
over to the readdir-based one.

Fixes rust-lang#40021 for Fuchsia, but that issue also contains discussion of
what should happen for other Posix systems.
bors added a commit to rust-lang/libc that referenced this issue Feb 22, 2017
Make readdir available on all unix targets

The readdir_r call has problems, and we'll probably want to move to
readdir on many, if not most, unix targets. This patch makes readdir
available in unix, rather than just solaris as before.

See rust-lang/rust#40021
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 22, 2017
Switch Fuchsia to readdir (instead of readdir_r)

The readdir_r function is deprecated on newer Posix systems because of
various problems, and not implemented at all for Fuchsia. There are
already implementations using both, and this patch switches Fuchsia
over to the readdir-based one.

Fixes rust-lang#40021 for Fuchsia, but that issue also contains discussion of
what should happen for other Posix systems.
eddyb added a commit to eddyb/rust that referenced this issue Feb 25, 2017
Switch Fuchsia to readdir (instead of readdir_r)

The readdir_r function is deprecated on newer Posix systems because of
various problems, and not implemented at all for Fuchsia. There are
already implementations using both, and this patch switches Fuchsia
over to the readdir-based one.

Fixes rust-lang#40021 for Fuchsia, but that issue also contains discussion of
what should happen for other Posix systems.
eddyb added a commit to eddyb/rust that referenced this issue Feb 25, 2017
Switch Fuchsia to readdir (instead of readdir_r)

The readdir_r function is deprecated on newer Posix systems because of
various problems, and not implemented at all for Fuchsia. There are
already implementations using both, and this patch switches Fuchsia
over to the readdir-based one.

Fixes rust-lang#40021 for Fuchsia, but that issue also contains discussion of
what should happen for other Posix systems.
tavianator added a commit to tavianator/rust that referenced this issue Jan 11, 2022
readdir() is preferred over readdir_r() on Linux and many other
platforms because it more gracefully supports long file names.  Both
glibc and musl (and presumably all other Linux libc implementations)
guarantee that readdir() is thread-safe as long as a single DIR* is not
accessed concurrently, which is enough to make a readdir()-based
implementation of ReadDir safe.  This implementation is already used for
some other OSes including Fuchsia, Redox, and Solaris.

See rust-lang#40021 for more details.  Fixes rust-lang#86649.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 11, 2022
…shtriplett

fs: Use readdir() instead of readdir_r() on Linux

readdir() is preferred over readdir_r() on Linux and many other
platforms because it more gracefully supports long file names.  Both
glibc and musl (and presumably all other Linux libc implementations)
guarantee that readdir() is thread-safe as long as a single DIR* is not
accessed concurrently, which is enough to make a readdir()-based
implementation of ReadDir safe.  This implementation is already used for
some other OSes including Fuchsia, Redox, and Solaris.

See rust-lang#40021 for more details.  Fixes rust-lang#86649.
tavianator added a commit to tavianator/rust that referenced this issue Jan 11, 2022
readdir() is preferred over readdir_r() on Linux and many other
platforms because it more gracefully supports long file names.  Both
glibc and musl (and presumably all other Linux libc implementations)
guarantee that readdir() is thread-safe as long as a single DIR* is not
accessed concurrently, which is enough to make a readdir()-based
implementation of ReadDir safe.  This implementation is already used for
some other OSes including Fuchsia, Redox, and Solaris.

See rust-lang#40021 for more details.  Fixes rust-lang#86649.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 14, 2022
…shtriplett

fs: Use readdir() instead of readdir_r() on Linux

readdir() is preferred over readdir_r() on Linux and many other
platforms because it more gracefully supports long file names.  Both
glibc and musl (and presumably all other Linux libc implementations)
guarantee that readdir() is thread-safe as long as a single DIR* is not
accessed concurrently, which is enough to make a readdir()-based
implementation of ReadDir safe.  This implementation is already used for
some other OSes including Fuchsia, Redox, and Solaris.

See rust-lang#40021 for more details.  Fixes rust-lang#86649.
tavianator added a commit to tavianator/rust that referenced this issue Jan 21, 2022
readdir() is preferred over readdir_r() on Linux and many other
platforms because it more gracefully supports long file names.  Both
glibc and musl (and presumably all other Linux libc implementations)
guarantee that readdir() is thread-safe as long as a single DIR* is not
accessed concurrently, which is enough to make a readdir()-based
implementation of ReadDir safe.  This implementation is already used for
some other OSes including Fuchsia, Redox, and Solaris.

See rust-lang#40021 for more details.  Fixes rust-lang#86649.  Fixes rust-lang#34668.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 26, 2022
…shtriplett

fs: Use readdir() instead of readdir_r() on Linux and Android

See rust-lang#40021 for more details.  Fixes rust-lang#86649.  Fixes rust-lang#34668.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant