Back to index

glibc  2.9
errorlib.h
Go to the documentation of this file.
00001 /*
00002  * Mach Operating System
00003  * Copyright (c) 1991,1990,1989 Carnegie Mellon University
00004  * All Rights Reserved.
00005  *
00006  * Permission to use, copy, modify and distribute this software and its
00007  * documentation is hereby granted, provided that both the copyright
00008  * notice and this permission notice appear in all copies of the
00009  * software, derivative works or modified versions, and any portions
00010  * thereof, and that both notices appear in supporting documentation.
00011  *
00012  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
00013  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
00014  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
00015  *
00016  * Carnegie Mellon requests users of this software to return to
00017  *
00018  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
00019  *  School of Computer Science
00020  *  Carnegie Mellon University
00021  *  Pittsburgh PA 15213-3890
00022  *
00023  * any improvements or extensions that they make and grant Carnegie the
00024  * rights to redistribute these changes.
00025  */
00026 /*
00027  * (pre-GNU) HISTORY
00028  *
00029  * Revision 2.3  92/03/31  15:18:52  rpd
00030  *     Added KERN_DEVICE_MOD for device errors.
00031  *     [92/03/09            rpd]
00032  *
00033  * Revision 2.2  92/01/16  00:21:17  rpd
00034  *     Moved from user collection to mk collection.
00035  *
00036  * Revision 2.2  91/03/27  15:37:37  mrt
00037  *     First checkin
00038  *
00039  */
00040 /*
00041  *     File:  errorlib.h
00042  *     Author:       Douglas Orr, Carnegie Mellon University
00043  *     Date:  Mar. 1988
00044  *
00045  *     Error bases for subsytems errors.
00046  */
00047 
00048 #include <mach/error.h>
00049 
00050 #define KERN_DEVICE_MOD            (err_kern|err_sub(1))
00051 
00052 #define BOOTSTRAP_FS_MOD    (err_bootstrap|err_sub(0))
00053 
00054 #define       MACH_IPC_SEND_MOD    (err_mach_ipc|err_sub(0))
00055 #define       MACH_IPC_RCV_MOD     (err_mach_ipc|err_sub(1))
00056 #define       MACH_IPC_MIG_MOD     (err_mach_ipc|err_sub(2))
00057 
00058 #define       IPC_SEND_MOD         (err_ipc|err_sub(0))
00059 #define       IPC_RCV_MOD          (err_ipc|err_sub(1))
00060 #define       IPC_MIG_MOD          (err_ipc|err_sub(2))
00061 
00062 #define       SERV_NETNAME_MOD     (err_server|err_sub(0))
00063 #define       SERV_ENV_MOD         (err_server|err_sub(1))
00064 #define       SERV_EXECD_MOD              (err_server|err_sub(2))
00065 
00066 
00067 #define       NO_SUCH_ERROR        "unknown error code"
00068 
00069 struct error_subsystem {
00070        const char           * subsys_name;
00071        int                  max_code;
00072        const char           * const * codes;
00073 };
00074 
00075 struct error_system {
00076        int                  max_sub;
00077        const char           * bad_sub;
00078        const struct error_subsystem       * subsystem;
00079 };
00080 
00081 #define errors __mach_error_systems
00082 extern const struct error_system   errors[err_max_system+1];
00083 
00084 #define       errlib_count(s)             (sizeof(s)/sizeof(s[0]))