summaryrefslogtreecommitdiffstats
path: root/libsyscalls_strerror.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-12-03 19:23:35 +0100
committerMattias Andrée <maandree@kth.se>2023-12-03 19:23:35 +0100
commitc131f122778c62f920a99bbf854ced4a37ee8b03 (patch)
tree14c933f98f4d64dffb0a594bc40dd5121c6c5a8e /libsyscalls_strerror.c
downloadlibsyscalls-c131f122778c62f920a99bbf854ced4a37ee8b03.tar.gz
libsyscalls-c131f122778c62f920a99bbf854ced4a37ee8b03.tar.bz2
libsyscalls-c131f122778c62f920a99bbf854ced4a37ee8b03.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libsyscalls_strerror.c')
-rw-r--r--libsyscalls_strerror.c18
1 files changed, 18 insertions, 0 deletions
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
+}