diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-10-05 12:56:36 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-10-05 13:22:57 -0400 |
commit | 428cf9c206beee3407ea3c5480b00f4cfbea95f5 (patch) | |
tree | b5abbb4ad7fc8ee450ea0abfdb7419ca89b8a8ca /src/bfstd.h | |
parent | 634359bb169311646f6369b21f0c90a9819fe2ce (diff) | |
download | bfs-428cf9c206beee3407ea3c5480b00f4cfbea95f5.tar.xz |
bfstd: Add a thread-safe wrapper for strerror()
Diffstat (limited to 'src/bfstd.h')
-rw-r--r-- | src/bfstd.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/bfstd.h b/src/bfstd.h index fb77399..abde24e 100644 --- a/src/bfstd.h +++ b/src/bfstd.h @@ -167,6 +167,17 @@ char *xstpecpy(char *dest, char *end, const char *src); char *xstpencpy(char *dest, char *end, const char *src, size_t n); /** + * Thread-safe strerror(). + * + * @param errnum + * An error number. + * @return + * A string describing that error, which remains valid until the next + * xstrerror() call in the same thread. + */ +const char *xstrerror(int errnum); + +/** * Format a mode like ls -l (e.g. -rw-r--r--). * * @param mode |