errorlib.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Mach Operating System
  3. * Copyright (c) 1991,1990,1989 Carnegie Mellon University
  4. * All Rights Reserved.
  5. *
  6. * Permission to use, copy, modify and distribute this software and its
  7. * documentation is hereby granted, provided that both the copyright
  8. * notice and this permission notice appear in all copies of the
  9. * software, derivative works or modified versions, and any portions
  10. * thereof, and that both notices appear in supporting documentation.
  11. *
  12. * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
  13. * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14. * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15. *
  16. * Carnegie Mellon requests users of this software to return to
  17. *
  18. * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
  19. * School of Computer Science
  20. * Carnegie Mellon University
  21. * Pittsburgh PA 15213-3890
  22. *
  23. * any improvements or extensions that they make and grant Carnegie the
  24. * rights to redistribute these changes.
  25. */
  26. /*
  27. * (pre-GNU) HISTORY
  28. *
  29. * Revision 2.3 92/03/31 15:18:52 rpd
  30. * Added KERN_DEVICE_MOD for device errors.
  31. * [92/03/09 rpd]
  32. *
  33. * Revision 2.2 92/01/16 00:21:17 rpd
  34. * Moved from user collection to mk collection.
  35. *
  36. * Revision 2.2 91/03/27 15:37:37 mrt
  37. * First checkin
  38. *
  39. */
  40. /*
  41. * File: errorlib.h
  42. * Author: Douglas Orr, Carnegie Mellon University
  43. * Date: Mar. 1988
  44. *
  45. * Error bases for subsystems errors.
  46. */
  47. #include <mach/error.h>
  48. #define KERN_DEVICE_MOD (err_kern|err_sub(1))
  49. #define BOOTSTRAP_FS_MOD (err_bootstrap|err_sub(0))
  50. #define MACH_IPC_SEND_MOD (err_mach_ipc|err_sub(0))
  51. #define MACH_IPC_RCV_MOD (err_mach_ipc|err_sub(1))
  52. #define MACH_IPC_MIG_MOD (err_mach_ipc|err_sub(2))
  53. #define IPC_SEND_MOD (err_ipc|err_sub(0))
  54. #define IPC_RCV_MOD (err_ipc|err_sub(1))
  55. #define IPC_MIG_MOD (err_ipc|err_sub(2))
  56. #define SERV_NETNAME_MOD (err_server|err_sub(0))
  57. #define SERV_ENV_MOD (err_server|err_sub(1))
  58. #define SERV_EXECD_MOD (err_server|err_sub(2))
  59. #define NO_SUCH_ERROR "unknown error code"
  60. struct error_subsystem {
  61. const char * subsys_name;
  62. int max_code;
  63. const char * const * codes;
  64. };
  65. struct error_system {
  66. int max_sub;
  67. const char * bad_sub;
  68. const struct error_subsystem * subsystem;
  69. };
  70. #define errors __mach_error_systems
  71. extern const struct error_system errors[err_max_system+1];
  72. #define errlib_count(s) (sizeof(s)/sizeof(s[0]))