f1c3c4d1bddf3754907c48abca3844cbdc6f6471
[tpg/acess2.git] / Usermode / Libraries / libc.so_src / errno.c
1 /*
2  * Acess2 C Library
3  * - By John Hodge (thePowersGang)
4  * 
5  * errno.c
6  * - errno and strerror
7  */
8 #include "lib.h"
9 #include <errno.h>
10 #include <acess/sys.h>
11
12 EXPORT int *libc_geterrno()
13 {
14         return &_errno;
15 }
16
17 EXPORT const char *strerror(int errnum)
18 {
19         switch(errnum)
20         {
21         case EOK:       return "Success";
22         case EISDIR:    return "Is a directory";
23         case ENOTDIR:   return "Not a directory";
24         case ENOSYS:    return "Invalid instruction/syscall";
25         case ENOENT:    return "No such file or directory";
26         case EINVAL:    return "Bad arguments";
27         case EPERM:     return "Permissions error";
28         default:
29                 _SysDebug("strerror: errnum=%i unk", errnum);
30                 return "unknown error";
31         }
32 }
33

UCC git Repository :: git.ucc.asn.au