--- /dev/null
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+/*
+ * HISTORY
+ * $Log$
+ * Revision 1.1 1992/10/06 18:29:52 roland
+ * Initial revision
+ *
+ * Revision 2.3 92/04/01 19:38:02 rpd
+ * Added err_codes_device.
+ * [92/03/09 rpd]
+ *
+ * Revision 2.2 92/01/16 00:08:50 rpd
+ * Moved from user collection to mk collection.
+ *
+ * Revision 2.3 91/08/29 15:51:22 rpd
+ * Updated err_codes_kern.
+ * [91/08/15 rpd]
+ *
+ * Revision 2.2 91/03/27 16:05:27 mrt
+ * First checkin
+ *
+ */
+/*
+ * File: err_kern.sub
+ * Author: Douglas Orr, Carnegie Mellon University
+ * Date: Mar, 1988
+ *
+ * error codes for Mach and Unix kernels
+ */
+
+static char * err_codes_kern[] = {
+ "(os/kern) successful",
+ "(os/kern) invalid address",
+ "(os/kern) protection failure",
+ "(os/kern) no space available",
+ "(os/kern) invalid argument",
+ "(os/kern) failure",
+ "(os/kern) resource shortage",
+ "(os/kern) not receiver",
+ "(os/kern) no access",
+ "(os/kern) memory failure",
+ "(os/kern) memory error",
+ "(os/kern) already in set",
+ "(os/kern) not in set",
+ "(os/kern) name exists",
+ "(os/kern) aborted",
+ "(os/kern) invalid name",
+ "(os/kern) invalid task",
+ "(os/kern) invalid right",
+ "(os/kern) invalid value",
+ "(os/kern) urefs overflow",
+ "(os/kern) invalid capability",
+ "(os/kern) right exists",
+ "(os/kern) invalid host",
+ "(os/kern) memory present",
+};
+
+static char * err_codes_device[] = {
+ "(os/device) hardware IO error",
+ "(os/device) operation would block",
+ "(os/device) no such device",
+ "(os/device) device already open",
+ "(os/device) device is shut down",
+ "(os/device) invalid operation",
+ "(os/device) invalid record number",
+ "(os/device) invalid IO size",
+ "(os/device) memory allocation failure",
+ "(os/device) read only",
+};
+
+static char * err_codes_unix[] = {
+ NO_SUCH_ERROR,
+ "(os/unix) no rights to object",
+ "(os/unix) file or directory does not exist",
+ "(os/unix) no such process",
+ "(os/unix) interrupted system call",
+ "(os/unix) i/o error",
+ "(os/unix) device does not exist",
+ "(os/unix) argument list is too long",
+ "(os/unix) invalid executable object format",
+ "(os/unix) bad file descriptor number",
+ "(os/unix) no child processes are present",
+ "(os/unix) no more processes are available",
+ "(os/unix) insufficient memory",
+ "(os/unix) access denied",
+ "(os/unix) memory access fault",
+ "(os/unix) block device required for operation",
+ "(os/unix) mount device busy",
+ "(os/unix) file already exists",
+ "(os/unix) cross device link",
+ "(os/unix) device does not exist",
+ "(os/unix) object is not a directory",
+ "(os/unix) object is a directory",
+ "(os/unix) invalid argument",
+ "(os/unix) internal file table overflow",
+ "(os/unix) maximum number of open files reached",
+ "(os/unix) object is not a tty-like device",
+ "(os/unix) executable object is in use",
+ "(os/unix) file is too large",
+ "(os/unix) no space is left on device",
+ "(os/unix) illegal seek attempt",
+ "(os/unix) read-only file system",
+ "(os/unix) too many links",
+ "(os/unix) broken pipe",
+ "(os/unix) argument is too large",
+ "(os/unix) result is out of range",
+ "(os/unix) operation on device would block",
+ "(os/unix) operation is now in progress",
+ "(os/unix) operation is already in progress",
+ "(os/unix) socket operation attempted on non-socket object",
+ "(os/unix) destination address is required",
+ "(os/unix) message is too long",
+ "(os/unix) protocol type is incorrect for socket",
+ "(os/unix) protocol type is not availaible",
+ "(os/unix) protocol type is not supported",
+ "(os/unix) socket type is not supported",
+ "(os/unix) operation is not supported on sockets",
+ "(os/unix) protocol family is not supported",
+ "(os/unix) address family is not supported by protocol family",
+ "(os/unix) address is already in use",
+ "(os/unix) can't assign requested address",
+ "(os/unix) network is down",
+ "(os/unix) network is unreachable",
+ "(os/unix) network dropped connection on reset",
+ "(os/unix) software aborted connection",
+ "(os/unix) connection reset by peer",
+ "(os/unix) no buffer space is available",
+ "(os/unix) socket is already connected",
+ "(os/unix) socket is not connected",
+ "(os/unix) can't send after socket shutdown",
+ "(os/unix) too many references; can't splice",
+ "(os/unix) connection timed out",
+ "(os/unix) connection was refused",
+ "(os/unix) too many levels of symbolic links",
+ "(os/unix) file name exceeds system maximum limit",
+ "(os/unix) host is down",
+ "(os/unix) there is no route to host",
+ "(os/unix) directory is not empty",
+ "(os/unix) quota on number of processes exceeded",
+ "(os/unix) quota on number of users exceeded",
+ "(os/unix) quota on available disk space exceeded",
+};
+
+static struct error_subsystem err_os_sub[] = {
+ {
+ "(os/kern)",
+ errlib_count(err_codes_kern),
+ err_codes_kern,
+ },
+ {
+ "(os/device)",
+ errlib_count(err_codes_device),
+ err_codes_device,
+ },
+ {
+ "(os/?)",
+ 0,
+ },
+ {
+ "(os/unix)",
+ errlib_count(err_codes_unix),
+ err_codes_unix,
+ },
+};
--- /dev/null
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+/*
+ * HISTORY
+ * $Log$
+ * Revision 1.1 1992/10/06 18:29:53 roland
+ * Initial revision
+ *
+ * Revision 2.3 92/03/31 15:18:52 rpd
+ * Added KERN_DEVICE_MOD for device errors.
+ * [92/03/09 rpd]
+ *
+ * Revision 2.2 92/01/16 00:21:17 rpd
+ * Moved from user collection to mk collection.
+ *
+ * Revision 2.2 91/03/27 15:37:37 mrt
+ * First checkin
+ *
+ */
+/*
+ * File: errorlib.h
+ * Author: Douglas Orr, Carnegie Mellon University
+ * Date: Mar. 1988
+ *
+ * Error bases for subsytems errors.
+ */
+
+#include <mach/error.h>
+
+#define KERN_DEVICE_MOD (err_kern|err_sub(1))
+
+#define BOOTSTRAP_FS_MOD (err_bootstrap|err_sub(0))
+
+#define MACH_IPC_SEND_MOD (err_mach_ipc|err_sub(0))
+#define MACH_IPC_RCV_MOD (err_mach_ipc|err_sub(1))
+#define MACH_IPC_MIG_MOD (err_mach_ipc|err_sub(2))
+
+#define IPC_SEND_MOD (err_ipc|err_sub(0))
+#define IPC_RCV_MOD (err_ipc|err_sub(1))
+#define IPC_MIG_MOD (err_ipc|err_sub(2))
+
+#define SERV_NETNAME_MOD (err_server|err_sub(0))
+#define SERV_ENV_MOD (err_server|err_sub(1))
+#define SERV_EXECD_MOD (err_server|err_sub(2))
+
+
+#define NO_SUCH_ERROR "unknown error code"
+
+struct error_subsystem {
+ char * subsys_name;
+ int max_code;
+ char * * codes;
+};
+
+struct error_system {
+ int max_sub;
+ char * bad_sub;
+ struct error_subsystem * subsystem;
+};
+
+extern struct error_system errors[err_max_system+1];
+
+#define errlib_count(s) (sizeof(s)/sizeof(s[0]))
--- /dev/null
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+/*
+ * HISTORY
+ * $Log$
+ * Revision 1.1 1992/10/06 18:29:54 roland
+ * Initial revision
+ *
+ * Revision 2.2 92/01/16 00:08:10 rpd
+ * Moved from user collection to mk collection.
+ *
+ * Revision 2.2 91/03/27 15:39:13 mrt
+ * First checkin
+ *
+ */
+/*
+ * File: mach_error.h
+ * Author: Douglas Orr, Carnegie Mellon University
+ * Date: Mar. 1988
+ *
+ * Definitions of routines in mach_error.c
+ */
+
+#ifndef _MACH_ERROR_
+#define _MACH_ERROR_ 1
+
+#include <mach/error.h>
+
+char *mach_error_string(
+/*
+ * Returns a string appropriate to the error argument given
+ */
+#if c_plusplus
+ mach_error_t error_value
+#endif c_plusplus
+ );
+
+void mach_error(
+/*
+ * Prints an appropriate message on the standard error stream
+ */
+#if c_plusplus
+ char *str,
+ mach_error_t error_value
+#endif c_plusplus
+ );
+
+char *mach_error_type(
+/*
+ * Returns a string with the error system, subsystem and code
+*/
+#if c_plusplus
+ mach_error_t error_value
+#endif c_plusplus
+ );
+
+#endif _MACH_ERROR_