glibc/mach/errorlib.h

91 lines
2.5 KiB
C
Raw Normal View History

1995-02-18 02:27:10 +01:00
/*
* 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$
Sun Mar 12 18:21:10 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> * malloc/malloc.h (_malloc_internal, _realloc_internal): Declare these. * malloc/realloc.c (_realloc_internal): Renamed from realloc; don't use __realloc_hook. (realloc): New function; call __realloc_hook ?: _realloc_internal. * malloc/malloc.c (_malloc_internal): Renamed from malloc; don't use __malloc_hook. (malloc): New function; call __malloc_hook ?: _malloc_internal. (initialize): Set up _heaplimit to cover the _heapinfo table. (morecore_recursing): New static variable. (morecore): If that is set, return null immediately. When growing the info table, before getting new core from the system for it, set morecore_recursing and try moving _heapinfo with _realloc_internal. When that fails and we get new core, set _heaplimit to cover the core for the new _heapinfo table. (register_heapinfo): New function. Record the _heapinfo table's own blocks in that table and in the statistics variables. (initialize, _malloc_internal): Use it after allocating new table. Fri Mar 10 22:26:28 1995 Jim Meyering (meyering@comco.com) * sysdeps/generic/memchr.c: Remove ansidecl.h and clean up for use by other packages. [LONG_MAX <= LONG_MAX_32_BITS]: Don't compile 64-bit code. * mach/errorlib.h (errors): Use const for decl. * time/tzfile.c (uc2ul, _uc2ul): Macros removed. (decode): New inline function; decode signed 32-bit integers, and sign-extend properly when long is longer than 32 bits. (__tzfile_read): Changed all uses of uc2ul to decode. Decode the transition times properly when sizeof (time_t) > 4. * stdio/vfprintf.c [USE_IN_LIBIO] (PAD): Use return value of _IO_padn. (buffered_vfprintf): Remove line buffer when flush failed.
1995-03-13 01:37:23 +01:00
* Revision 1.5 1995/03/10 23:57:44 roland
* (errors): Use const for decl.
*
* Revision 1.4 1993/12/17 21:56:16 roland
1995-02-18 02:27:10 +01:00
* entered into RCS
*
* 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 {
const char * subsys_name;
int max_code;
const char * const * codes;
};
struct error_system {
int max_sub;
const char * bad_sub;
const struct error_subsystem * subsystem;
};
#define errors __mach_error_systems
Sun Mar 12 18:21:10 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> * malloc/malloc.h (_malloc_internal, _realloc_internal): Declare these. * malloc/realloc.c (_realloc_internal): Renamed from realloc; don't use __realloc_hook. (realloc): New function; call __realloc_hook ?: _realloc_internal. * malloc/malloc.c (_malloc_internal): Renamed from malloc; don't use __malloc_hook. (malloc): New function; call __malloc_hook ?: _malloc_internal. (initialize): Set up _heaplimit to cover the _heapinfo table. (morecore_recursing): New static variable. (morecore): If that is set, return null immediately. When growing the info table, before getting new core from the system for it, set morecore_recursing and try moving _heapinfo with _realloc_internal. When that fails and we get new core, set _heaplimit to cover the core for the new _heapinfo table. (register_heapinfo): New function. Record the _heapinfo table's own blocks in that table and in the statistics variables. (initialize, _malloc_internal): Use it after allocating new table. Fri Mar 10 22:26:28 1995 Jim Meyering (meyering@comco.com) * sysdeps/generic/memchr.c: Remove ansidecl.h and clean up for use by other packages. [LONG_MAX <= LONG_MAX_32_BITS]: Don't compile 64-bit code. * mach/errorlib.h (errors): Use const for decl. * time/tzfile.c (uc2ul, _uc2ul): Macros removed. (decode): New inline function; decode signed 32-bit integers, and sign-extend properly when long is longer than 32 bits. (__tzfile_read): Changed all uses of uc2ul to decode. Decode the transition times properly when sizeof (time_t) > 4. * stdio/vfprintf.c [USE_IN_LIBIO] (PAD): Use return value of _IO_padn. (buffered_vfprintf): Remove line buffer when flush failed.
1995-03-13 01:37:23 +01:00
extern const struct error_system errors[err_max_system+1];
1995-02-18 02:27:10 +01:00
#define errlib_count(s) (sizeof(s)/sizeof(s[0]))