HomeFreeBSD

fix: make zfs_strerror really thread-safe and portable

Description

fix: make zfs_strerror really thread-safe and portable

#15793 wanted to make zfs_strerror threadsafe, unfortunately, it
turned out that strerror_l() usage was wrong, and also, some libc
implementations dont have strerror_l().

zfs_strerror() now simply calls original strerror() and copies the
result to a thread-local buffer, then returns that.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Richard Kojedzinszky <richard@kojedz.in>
Closes #15793
Closes #16640
Closes #16923

Details

Provenance
Richard Kojedzinszky <rkojedzinszky@users.noreply.github.com>Authored on Jan 4 2025, 6:33 PM
GitHub <noreply@github.com>Committed on Jan 4 2025, 6:33 PM
Parents
rG939e0237c549: Too many vdev probe errors should suspend pool
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGdc0324bfa900: fix: make zfs_strerror really thread-safe and portable (authored by Richard Kojedzinszky <rkojedzinszky@users.noreply.github.com>).Jan 4 2025, 6:33 PM