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

strerror is not (guaranteed) to be thread safe #156

Open
semicoleon opened this issue Mar 13, 2024 · 1 comment
Open

strerror is not (guaranteed) to be thread safe #156

semicoleon opened this issue Mar 13, 2024 · 1 comment

Comments

@semicoleon
Copy link

This package's Errno type is using strerror to produce error strings. For unknown error numbers strerror writes a string into a static buffer and returns it, but whether this static buffer is thread local is unspecified. Using strerror_r would guarantee thread safety even for unknown error codes.

@glessard
Copy link
Contributor

We might want to use strerror_s from C11 instead, for portability.

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

2 participants