diff --git a/libc/errno/errno.c b/libc/errno/errno.c new file mode 100644 index 0000000..2126ddb --- /dev/null +++ b/libc/errno/errno.c @@ -0,0 +1,4 @@ +#include + +_errno_t errno = 0; + diff --git a/libc/include/errno.h b/libc/include/errno.h new file mode 100644 index 0000000..4d26153 --- /dev/null +++ b/libc/include/errno.h @@ -0,0 +1,39 @@ +#ifndef _ERRNO_H +#define _ERRNO_H + +// Basic POSIX defined error idk +enum { + EPERM = 1, // Operation not permitted + ENOENT, // No such file or directory + ESRCH, // No such process + EINTR, // Interrupted system call + EIO, // I/O error + ENXIO, // No such device or address + E2BIG, // Argument list too long + ENOEXEC, // Exec format error + EBADF, // Bad file descriptor + ECHILD, // No child processes + EAGAIN, // Resource temporarily unavailable + ENOMEM, // Out of memory + EACCES, // Permission denied + EFAULT, // Bad address + EBUSY, // Device or resource busy + EEXIST, // File exists + ENOTDIR, // Not a directory + EISDIR, // Is a directory + EINVAL, // Invalid argument + ENFILE, // File table overflow + EMFILE, // Too many open files + ENOTTY, // Not a typewriter + EFBIG, // File too large + ENOSPC, // No space left on device + ESPIPE, // Illegal seek + EROFS, // Read-only file system + EMLINK, // Too many links + EPIPE, // Broken pipe + EDQUOT, // Disk quota exceeded +}; + +extern int errno; + +#endif