summaryrefslogtreecommitdiff
path: root/libc/error/perror.c
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>1996-03-24 21:25:23 +0100
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:29:54 +0200
commitdcc973ea3e31710429858c99d4f040334ac67c06 (patch)
tree8883b902eb18eba489957b7f03caa491fd7992a7 /libc/error/perror.c
parentfe22c37817ce338fbbc90b239320248c270957fa (diff)
downloaddev86-dcc973ea3e31710429858c99d4f040334ac67c06.tar.gz
Import Dev86-0.0.5.tar.gzv0.0.5
Diffstat (limited to 'libc/error/perror.c')
-rw-r--r--libc/error/perror.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libc/error/perror.c b/libc/error/perror.c
new file mode 100644
index 0000000..f9b0965
--- /dev/null
+++ b/libc/error/perror.c
@@ -0,0 +1,19 @@
+
+#include <errno.h>
+
+void
+perror(str)
+__const char * str;
+{
+ register char * ptr;
+ if(str)
+ {
+ write(2, str, strlen(str));
+ write(2, ": ", 2);
+ }
+ else write(2, "perror: ", 8);
+
+ ptr = strerror(errno);
+ write(2, ptr, strlen(ptr));
+ write(2, "\n", 1);
+}