* - errno and strerror
*/
#include "lib.h"
+#include <stdio.h>
#include <errno.h>
#include <acess/sys.h>
#include <string.h>
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";
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);
+}
+