Update from main archive 961219
[glibc.git] / mach / mach / error.h
blob83cf61ef8f74df51628be41a161b368cc191a51c
1 /* err_hurd added by roland@gnu.ai.mit.edu for GNU Hurd.
3 * Mach Operating System
4 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
5 * All Rights Reserved.
7 * Permission to use, copy, modify and distribute this software and its
8 * documentation is hereby granted, provided that both the copyright
9 * notice and this permission notice appear in all copies of the
10 * software, derivative works or modified versions, and any portions
11 * thereof, and that both notices appear in supporting documentation.
13 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
14 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
15 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 * Carnegie Mellon requests users of this software to return to
19 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
20 * School of Computer Science
21 * Carnegie Mellon University
22 * Pittsburgh PA 15213-3890
24 * any improvements or extensions that they make and grant Carnegie Mellon
25 * the rights to redistribute these changes.
28 * HISTORY
29 * $Log$
30 * Revision 1.2 1996/12/20 01:32:36 drepper
31 * Update from main archive 961219
33 * Revision 1.2 1996/12/19 20:23:56 drepper
34 * Spelling corrections.
36 * Revision 1.1 1993/12/17 21:40:28 roland
37 * entered into RCS
39 * Revision 2.6 93/01/14 17:41:31 danner
40 * Standardized include symbol name.
41 * [92/06/10 pds]
43 * Revision 2.5 92/03/31 15:18:11 rpd
44 * Added err_bootstrap for bootstrap errors.
45 * [92/03/09 rpd]
47 * Revision 2.4 91/05/14 16:51:24 mrt
48 * Correcting copyright
50 * Revision 2.3 91/02/05 17:31:48 mrt
51 * Changed to new Mach copyright
52 * [91/02/01 17:16:50 mrt]
54 * Revision 2.2 90/06/02 14:57:47 rpd
55 * Added err_mach_ipc for new IPC.
56 * [90/03/26 22:28:42 rpd]
58 * Revision 2.1 89/08/03 16:02:07 rwd
59 * Created.
61 * Revision 2.4 89/02/25 18:13:18 gm0w
62 * Changes for cleanup.
64 * Revision 2.3 89/02/07 00:51:57 mwyoung
65 * Relocated from sys/error.h
67 * Revision 2.2 88/10/18 00:37:31 mwyoung
68 * Added {system,sub and code}_emask
69 * [88/10/17 17:06:58 mrt]
71 * Added {system,sub and code}_emask
73 * 12-May-88 Mary Thompson (mrt) at Carnegie Mellon
74 * Changed mach_error_t from unsigned int to kern_return_t
75 * which is a 32 bit integer regardless of machine type.
76 * unsigned int was incompatible with old usages of mach_error.
78 * 10-May-88 Douglas Orr (dorr) at Carnegie-Mellon University
79 * Missing endif replaced
81 * 5-May-88 Mary Thompson (mrt) at Carnegie Mellon
82 * Changed typedef of mach_error_t from long to unsigned int
83 * to keep our Camelot users happy. Also moved the nonkernel
84 * function declarations from here to mach_error.h.
86 * 10-Feb-88 Douglas Orr (dorr) at Carnegie-Mellon University
87 * Created.
91 * File: mach/error.h
92 * Purpose:
93 * error module definitions
97 #ifndef _MACH_ERROR_H_
98 #define _MACH_ERROR_H_
99 #include <mach/kern_return.h>
102 * error number layout as follows:
104 * hi lo
105 * | system(6) | subsystem(12) | code(14) |
109 #define err_none (mach_error_t)0
110 #define ERR_SUCCESS (mach_error_t)0
111 #define ERR_ROUTINE_NIL (mach_error_fn_t)0
114 #define err_system(x) (((x)&0x3f)<<26)
115 #define err_sub(x) (((x)&0xfff)<<14)
117 #define err_get_system(err) (((err)>>26)&0x3f)
118 #define err_get_sub(err) (((err)>>14)&0xfff)
119 #define err_get_code(err) ((err)&0x3fff)
121 #define system_emask (err_system(0x3f))
122 #define sub_emask (err_sub(0xfff))
123 #define code_emask (0x3fff)
126 /* major error systems */
127 #define err_kern err_system(0x0) /* kernel */
128 #define err_us err_system(0x1) /* user space library */
129 #define err_server err_system(0x2) /* user space servers */
130 #define err_ipc err_system(0x3) /* old ipc errors */
131 #define err_mach_ipc err_system(0x4) /* mach-ipc errors */
132 #define err_bootstrap err_system(0x5) /* bootstrap errors */
133 #define err_hurd err_system(0x10) /* GNU Hurd server errors */
134 #define err_local err_system(0x3e) /* user defined errors */
135 #define err_ipc_compat err_system(0x3f) /* (compatibility) mach-ipc errors */
137 #define err_max_system 0x3f
140 /* unix errors get lumped into one subsystem */
141 #define unix_err(errno) (err_kern|err_sub(3)|errno)
143 typedef kern_return_t mach_error_t;
144 typedef mach_error_t (* mach_error_fn_t)();
146 #endif /* _MACH_ERROR_H_ */