summaryrefslogtreecommitdiffstats
path: root/usr/klibc/perror.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/klibc/perror.c')
-rw-r--r--usr/klibc/perror.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/usr/klibc/perror.c b/usr/klibc/perror.c
new file mode 100644
index 0000000..3177057
--- /dev/null
+++ b/usr/klibc/perror.c
@@ -0,0 +1,13 @@
+/*
+ * perror.c
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+
+void perror(const char *s)
+{
+ int e = errno;
+ fprintf(stderr, "%s: %s\n", s, strerror(e));
+}