From abb01a4fb3468db6e4db9508c7d74f9b3dfa6f0e Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Thu, 19 Oct 2023 14:53:11 -0400 Subject: [PATCH] errno: add error strings --- include/errno.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/errno.h b/include/errno.h index a5b96c7..bf4b564 100644 --- a/include/errno.h +++ b/include/errno.h @@ -8,4 +8,12 @@ #define EINVAL 3 #define EBADF 4 +static const char *errno_str[] = { + [0] = "Success", + [ENOMEM] = "Out of memory", + [ENOENT] = "No such file or directory", + [EINVAL] = "Invalid argument", + [EBADF] = "Bad file descriptor", +}; + #endif /* _ERRNO_H_ */