From c131f122778c62f920a99bbf854ced4a37ee8b03 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 3 Dec 2023 19:23:35 +0100 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libsyscalls_strerror.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 libsyscalls_strerror.c (limited to 'libsyscalls_strerror.c') diff --git a/libsyscalls_strerror.c b/libsyscalls_strerror.c new file mode 100644 index 0000000..d54ed74 --- /dev/null +++ b/libsyscalls_strerror.c @@ -0,0 +1,18 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" + + +const char * +libsyscalls_strerror(enum libsyscalls_error error) +{ +#define X(ENUM, STR)\ + case ENUM: return STR + + switch ((int)error) { + LIBSYSCALLS_LIST_ERRORS(X, ;); + default: + return "Unrecognised error"; + } + +#undef X +} -- cgit v1.2.3-70-g09d2