mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
libzfs: use zfs_strerror() in place of strerror()
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Richard Kojedzinszky <richard@kojedz.in> Closes #15793
This commit is contained in:
committed by
Tony Hutter
parent
18c8abc8aa
commit
a1ea40af86
@@ -26,6 +26,8 @@
|
||||
#ifndef _LIBZUTIL_H
|
||||
#define _LIBZUTIL_H extern __attribute__((visibility("default")))
|
||||
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include <sys/nvpair.h>
|
||||
#include <sys/fs/zfs.h>
|
||||
|
||||
@@ -267,6 +269,14 @@ int for_each_vdev_in_nvlist(nvlist_t *nvroot, pool_vdev_iter_f func,
|
||||
void update_vdevs_config_dev_sysfs_path(nvlist_t *config);
|
||||
_LIBZUTIL_H void update_vdev_config_dev_sysfs_path(nvlist_t *nv,
|
||||
const char *path, const char *key);
|
||||
|
||||
/*
|
||||
* Thread-safe strerror() for use in ZFS libraries
|
||||
*/
|
||||
static inline char *zfs_strerror(int errnum) {
|
||||
return (strerror_l(errnum, uselocale(0)));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user