Skip to content

[POSIX] readdir_r() deprectated, replace with readdir() #2637

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

Merged
merged 1 commit into from
Feb 1, 2020

Conversation

spevans
Copy link
Contributor

@spevans spevans commented Jan 31, 2020

  • readdir_r() may be unsafe where NAME_MAX is unspecified as the
    buffer length isnt passed in. This may cause NUL termination issues.

  • glibc >= 2.24 deprecates readdir_r()

  • POSIX.1-2008 doesnt require readdir() to be thread-safe but, in glibc,
    calls with different directory streams are.

  • Callers of readdir() using methods need to ensure synchronisation
    if the same directory is read by multiple threads.

- readdir_r() may be unsafe where NAME_MAX is unspecified as the
  buffer length isnt passed in. This may cause NUL termination issues.

- glibc >= 2.24 deprecates readdir_r()

- POSIX.1-2008 doesnt require readdir() to be thread-safe but, in glibc,
  calls with different directory streams are.

- Callers of readdir() using methods need to ensure synchronisation
  if the same directory is read by multiple threads.
@spevans
Copy link
Contributor Author

spevans commented Jan 31, 2020

@swift-ci test

@spevans
Copy link
Contributor Author

spevans commented Feb 1, 2020

@swift-ci test and merge

@swift-ci swift-ci merged commit cf9616b into swiftlang:master Feb 1, 2020
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

Successfully merging this pull request may close these issues.

2 participants