From: Ken Thompson Date: Tue, 26 Nov 1974 23:13:21 +0000 (-0500) Subject: Research V5 development X-Git-Tag: Research-V5~95 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/e68bf9ca3572a5abcee972ee39b9bc54cdbf5774 Research V5 development Work on file usr/source/s4/perror.c Co-Authored-By: Dennis Ritchie Synthesized-from: v5 --- diff --git a/usr/source/s4/perror.c b/usr/source/s4/perror.c new file mode 100644 index 0000000000..e9e6dc132f --- /dev/null +++ b/usr/source/s4/perror.c @@ -0,0 +1,15 @@ +int errno; +int sys_nerr; +char *sys_errlist[]; +perror(s) +char *s; +{ + char *c; + + c = "Unknown error"; + if(errno < sys_nerr) + c = sys_errlist[errno]; + if(*s == '\0') + printf("%s", c); else + printf("%s: %s\n", s, c); +}