2 * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
3 * You may copy, distribute, and use this software as long as this
4 * copyright statement is not removed.
9 char rcsid
[] = "$Id: m_perror.c,v 1.2 2006-07-25 10:08:21 rt Exp $";
13 * malloc errno error strings...
16 char *malloc_err_strings
[] =
19 "Malloc chain is corrupted, pointers out of order",
20 "Malloc chain is corrupted, end before end pointer",
21 "Pointer is not within malloc area",
22 "Malloc region does not have valid magic number in header",
23 "Pointers between this segment and ajoining segments are invalid",
24 "Data has overrun beyond requested number of bytes",
25 "Data in free'd area has been modified",
26 "Data are is not in use (can't be freed or realloced)",
27 "Unable to get additional memory from the system",
28 "Pointer within malloc region, but outside of malloc data bounds",
33 * Function: malloc_perror()
35 * Purpose: to print malloc_errno error message
37 * Arguments: str - string to print with error message
39 * Returns: nothing of any value
47 extern int malloc_errno
;
58 (void) write(2,str
,(unsigned)(s
-str
));
59 (void) write(2,": ",(unsigned)2);
62 t
= malloc_err_strings
[malloc_errno
];
69 (void) write(2,t
,(unsigned)(s
-t
));
71 (void) write(2,"\n",(unsigned)1);