vbos/lib/errno.c
Michael Shaw ad2de927e2 ext2/vfs: implement read fs call
also implement the cat command!
2023-10-21 00:46:42 -04:00

21 lines
504 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#include <errno.h>
#include <kernel/common.h>
static const char *errno_str[] = {
[0] = "Success",
[ENOMEM] = "Out of memory",
[ENOENT] = "No such file or directory",
[EINVAL] = "Invalid argument",
[EBADF] = "Bad file descriptor",
[ENOTDIR] = "Not a directory",
[EISDIR] = "Is a directory",
};
inline const char *strerror(int errnum)
{
if (errnum < 0 || (size_t)errnum >= ARRAY_SIZE(errno_str))
return "Unknown error";
return errno_str[errnum];
}