987732821746028def0df9fe03f5e848ffb39241
[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 ENOSYS:    return "Invalid instruction/syscall";
22         case ENOENT:    return "No such file or directory";
23         case EINVAL:    return "Bad arguments";
24         case EPERM:     return "Permissions error";
25         default:
26                 _SysDebug("strerror: errnum=%i unk", errnum);
27                 return "unknown error";
28         }
29 }
30

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