From: John Hodge Date: Mon, 15 Jul 2013 02:15:14 +0000 (+0800) Subject: Usermode/libc - Fixed some slight errno issues X-Git-Tag: rel0.15~353 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=fa6e0731826c508a8a5d963b05b475e6e20d37a4;hp=5228a990933853fc5f5df7083ff458cdaddac371;p=tpg%2Facess2.git Usermode/libc - Fixed some slight errno issues --- diff --git a/Usermode/Libraries/libc.so_src/errno.c b/Usermode/Libraries/libc.so_src/errno.c index 98773282..f1c3c4d1 100644 --- a/Usermode/Libraries/libc.so_src/errno.c +++ b/Usermode/Libraries/libc.so_src/errno.c @@ -18,6 +18,9 @@ EXPORT const char *strerror(int errnum) { switch(errnum) { + case EOK: return "Success"; + case EISDIR: return "Is a directory"; + case ENOTDIR: return "Not a directory"; case ENOSYS: return "Invalid instruction/syscall"; case ENOENT: return "No such file or directory"; case EINVAL: return "Bad arguments"; diff --git a/Usermode/Libraries/libc.so_src/include_exp/errno.enum.h b/Usermode/Libraries/libc.so_src/include_exp/errno.enum.h index de9bd7b5..831ab658 100644 --- a/Usermode/Libraries/libc.so_src/include_exp/errno.enum.h +++ b/Usermode/Libraries/libc.so_src/include_exp/errno.enum.h @@ -15,6 +15,7 @@ enum { EEXIST, // Already exists ENFILE, // Too many open files ENOTDIR, // Not a directory + EISDIR, // Is a directory EIO, // IO Error EINTR, // Operation interrupted (signal) EWOULDBLOCK, // Operation would have blocked diff --git a/Usermode/Libraries/libc.so_src/include_exp/errno.h b/Usermode/Libraries/libc.so_src/include_exp/errno.h index 2fc26a33..a808379b 100644 --- a/Usermode/Libraries/libc.so_src/include_exp/errno.h +++ b/Usermode/Libraries/libc.so_src/include_exp/errno.h @@ -5,15 +5,15 @@ * errno.h * - Error values and related functions */ -#ifndef _ERRNO_H_ -#define _ERRNO_H_ +#ifndef _LIBC_ERRNO_H_ +#define _LIBC_ERRNO_H_ // TODO: Fully implement errno.h, make sure it matches the kernel one extern int *libc_geterrno(void); #define errno (*libc_geterrno()) -extern const char *strerr(int errnum); +extern const char *strerror(int errnum); #include "errno.enum.h"