strerror.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* Turning errno values into English error messages.
  2. Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 2000, 2001 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., 51 Franklin Street, Fifth Floor,
  15. Boston, MA 02110-1301, USA.
  16. As a special exception, the Free Software Foundation gives permission
  17. for additional uses of the text contained in its release of GUILE.
  18. The exception is that, if you link the GUILE library with other files
  19. to produce an executable, this does not by itself cause the
  20. resulting executable to be covered by the GNU General Public License.
  21. Your use of that executable is in no way restricted on account of
  22. linking the GUILE library code into it.
  23. This exception does not however invalidate any other reasons why
  24. the executable file might be covered by the GNU General Public License.
  25. This exception applies only to the code released by the
  26. Free Software Foundation under the name GUILE. If you copy
  27. code from other Free Software Foundation releases into a copy of
  28. GUILE, as the General Public License permits, the exception does
  29. not apply to the code that you add in this way. To avoid misleading
  30. anyone as to the status of such modified files, you must delete
  31. this exception notice from them.
  32. If you write modifications of your own for GUILE, it is your choice
  33. whether to permit this exception to apply to your modifications.
  34. If you do not wish that, delete this exception notice. */
  35. char *
  36. strerror (int errnum)
  37. {
  38. extern char *sys_errlist[];
  39. extern int sys_nerr;
  40. if (errnum >= 0 && errnum < sys_nerr)
  41. return sys_errlist[errnum];
  42. return (char *) "Unknown error";
  43. }
  44. /*
  45. Local Variables:
  46. c-file-style: "gnu"
  47. End:
  48. */