strerror.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Turning errno values into English error messages.
  2. Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 2000, 2002 Free Software Foundation, Inc.
  3. This file is part of GNU Emacs.
  4. GNU Emacs is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Emacs is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Emacs; see the file COPYING. If not, write to
  14. the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA. */
  16. char *
  17. strerror (int errnum)
  18. {
  19. extern char *sys_errlist[];
  20. extern int sys_nerr;
  21. if (errnum >= 0 && errnum < sys_nerr)
  22. return sys_errlist[errnum];
  23. return (char *) "Unknown error";
  24. }
  25. /*
  26. Local Variables:
  27. c-file-style: "gnu"
  28. End:
  29. */