/* perror.c (emx+gcc) -- Copyright (c) 1990-1995 by Eberhard Mattes */

#include <stdio.h>
#include <stdlib.h>

void perror (const char *string)
{
  int e = errno;

  if (string != NULL && *string != 0)
    {
      fputs (string, stderr);
      fputs (": ", stderr);
    }
  if (e >= 0 && e < _sys_nerr)
    fputs (_sys_errlist[e], stderr);
  else
    fprintf (stderr, "Unknown error %d", e);
  fputc ('\n', stderr);
}
