vbos/lib/errno.c
Michael Shaw 105bdb4464 ahci: add ahci driver
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
2026-07-14 19:03:10 -04:00

31 lines
847 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#include <kernel/common.h>
#include <lib/errno.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",
[ENOSPC] = "No space left on device",
[EEXIST] = "File exists",
[ENOEXEC] = "Exec format error",
[EFAULT] = "Bad address",
[EAGAIN] = "Try again",
[EIO] = "Input/output error",
[EBUSY] = "Device or resource busy",
[ENOSYS] = "Function not implemented",
[ENAMETOOLONG] = "Name too long",
[EROFS] = "Read-only file system",
};
const char *strerror(int errnum)
{
if (errnum < 0 || (size_t)errnum >= ARRAY_SIZE(errno_str))
return "Unknown error";
return errno_str[errnum];
}