freebsd-nq/contrib/libg++/libio/ioperror.c
Peter Wemm 5acb90c9b6 Import of raw libg++-2.7.2, but in a very cut-down form. There is still
a small amount of unused stuff (by the bmakefiles to follow), but it
isn't much and seems harmless enough.
1996-10-03 21:35:18 +00:00

23 lines
386 B
C

#include "libioP.h"
#include <errno.h>
#include <string.h>
#ifndef errno
extern int errno;
#endif
#ifndef _IO_strerror
extern char* _IO_strerror __P((int));
#endif
void
DEFUN(_IO_perror, (s),
const char *s)
{
char *error = _IO_strerror (errno);
if (s != NULL && *s != '\0')
_IO_fprintf (_IO_stderr, "%s:", s);
_IO_fprintf (_IO_stderr, "%s\n", error ? error : "");
}