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

Provide replacement function for strerror_l() #701

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ffontaine
Copy link

strerror_l() is not implemented in some C libraries, such as uClibc, so let's provide a simple replacement function that falls back on strerror().

Signed-off-by: Thomas Petazzoni [email protected]
[Retrieved from: https://git.buildroot.net/buildroot/tree/package/libblockdev/0001-Provide-replacement-function-for-strerror_l.patch]
Signed-off-by: Fabrice Fontaine [email protected]

strerror_l() is not implemented in some C libraries, such as uClibc,
so let's provide a simple replacement function that falls back on
strerror().

Signed-off-by: Thomas Petazzoni <[email protected]>
[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/libblockdev/0001-Provide-replacement-function-for-strerror_l.patch]
Signed-off-by: Fabrice Fontaine <[email protected]>
@blivetghoul
Copy link

Can one of the admins verify this patch?

@tbzatek
Copy link
Member

tbzatek commented Feb 3, 2022

Interesting, thanks for the patch. However this is not a direct replacement since it handles locales differently - we use it to return non-localized string. Is there anything similar available in uClibc? Alternatively, this might be backported from other libc implementations.

Out of curiosity, is there anything else missing for successful libblockdev compilation?

@ffontaine
Copy link
Author

To my knowledge, there is nothing similar in uclibc-ng. strerror_l declaration was added back in 2012 with wbx-github/uclibc-ng@0769334 but it was never implemented. It should also be noted that locale support can also be disabled by the user in uclibc-ng. Indeed, this feature isn't really needed on embedded systems.

Finally, this patch was the only one needed to integrate libblockdev in buildroot in 2020.

@tbzatek
Copy link
Member

tbzatek commented Feb 4, 2022

To me it looks like an issue that should be fixed on uclibc side.

Further inspiration, not sure how do they handle uclibc though: https://lists.infradead.org/pipermail/libnl/2016-August/002193.html

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.

4 participants