home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_100
/
163_01
/
perror.c
< prev
next >
Wrap
Text File
|
1988-01-31
|
640b
|
15 lines
/*
** print string s, followed by a colon and the message corresponding to
** the current value of _errno
*/
extern int *stderr, fputs(), fputc(), errno, sys_nerr, sys_errlist[];
perror(s) char *s; {
fputs(s, stderr);
fputs(": ", stderr);
if(errno < sys_nerr)
fputs(sys_errlist[errno], stderr);
else
fputs("Undefined error", stderr);
fputc('\n', stderr);
}