X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=Usermode%2FLibraries%2Flibc.so_src%2Ferrno.c;h=7e1905cde270da450f4ed728cb9d5145dd915679;hb=85653b526282abdbcab5c9b2d3aed13b74261aa9;hp=af369b12d87055243a02e9f4d3d6d139db1557b9;hpb=b99e0f9bd0dfcf6f1b3d33534ea78f8fb33be92a;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libc.so_src/errno.c b/Usermode/Libraries/libc.so_src/errno.c index af369b12..7e1905cd 100644 --- a/Usermode/Libraries/libc.so_src/errno.c +++ b/Usermode/Libraries/libc.so_src/errno.c @@ -6,6 +6,7 @@ * - errno and strerror */ #include "lib.h" +#include #include #include #include @@ -42,6 +43,7 @@ EXPORT char *strerror(int errnum) case EADDRNOTAVAIL: return "Address not avaliable"; case EINPROGRESS: return "Operation in process"; case EPERM: return "Operation not permitted"; + case ENOTTY: return "Not a TTY"; case EAGAIN: return "Try again"; case EALREADY: return "Operation was no-op"; case EINTERNAL: return "Internal error"; @@ -61,3 +63,16 @@ EXPORT int strerror_r(int errnum, char *buf, size_t bufsiz) return 0; } +// stdio.h +EXPORT void perror(const char *s) +{ + int err = errno; + if( s && s[0] ) { + fprintf(stderr, "%s: (%i) %s\n", s, err, strerror(err)); + } + else { + fprintf(stderr, "(%i) %s\n", err, strerror(err)); + } + _SysDebug("perror('%s'): %s (%i)", s, strerror(err), err); +} +