From 0b11d765769517b32a97052332a09840e340b553 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 28 Sep 2023 12:06:17 +0300 Subject: [PATCH] LibC: Add errno for unknown error --- libc/include/errno.h | 2 ++ libc/include/sys/banan-os.h | 3 +++ libc/string.cpp | 2 ++ 3 files changed, 7 insertions(+) diff --git a/libc/include/errno.h b/libc/include/errno.h index a2408110d..2dcc3e578 100644 --- a/libc/include/errno.h +++ b/libc/include/errno.h @@ -91,6 +91,8 @@ __BEGIN_DECLS #define ENOTBLK 82 #define EEXISTS 83 +#define EUNKNOWN 0xFF + #define errno __errno extern int __errno; diff --git a/libc/include/sys/banan-os.h b/libc/include/sys/banan-os.h index 9db8b93c4..cb2a41cf3 100644 --- a/libc/include/sys/banan-os.h +++ b/libc/include/sys/banan-os.h @@ -11,6 +11,9 @@ __BEGIN_DECLS #define TTY_FLAG_ENABLE_OUTPUT 1 #define TTY_FLAG_ENABLE_INPUT 2 +#define POWER_SHUTDOWN 0 +#define POWER_REBOOT 1 + /* fildes: refers to valid tty device command: one of TTY_CMD_* definitions diff --git a/libc/string.cpp b/libc/string.cpp index f51d31108..3f4ba105e 100644 --- a/libc/string.cpp +++ b/libc/string.cpp @@ -173,6 +173,7 @@ const char* strerrorname_np(int error) case EXDEV: return "EXDEV"; case EEXISTS: return "EEXISTS"; case ENOTBLK: return "ENOTBLK"; + case EUNKNOWN: return "EUNKNOWN"; } errno = EINVAL; @@ -267,6 +268,7 @@ const char* strerrordesc_np(int error) case EXDEV: return "Cross-device link."; case EEXISTS: return "File exists"; case ENOTBLK: return "Block device required"; + case EUNKNOWN: return "Unknown error"; } errno = EINVAL;