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.
13 * Purpose: to set options for the malloc debugging library
17 * Returns: nothing of any value
25 char rcs_hdr
[] = "$Id: mallopt.c,v 1.2 2006-07-25 10:09:05 rt Exp $";
31 union malloptarg value
;
34 extern int malloc_checking
;
35 extern char * malloc_data_start
;
36 extern int malloc_errfd
;
37 extern int malloc_fatal_level
;
39 extern int malloc_warn_level
;
43 * If not initialized...
45 if( malloc_data_start
== (char *) 0)
54 malloc_warn_level
= value
.i
;
58 malloc_fatal_level
= value
.i
;
62 malloc_checking
= value
.i
;
67 i
= open(value
.str
,O_CREAT
|O_APPEND
|O_WRONLY
,0666);
71 "Unable to open malloc error file: ",
73 for(s
=value
.str
; *s
; s
++)
77 (void) write(2,value
.str
,
78 (unsigned)(s
-value
.str
));
79 (void) write(2,"\n",(unsigned)1);
83 if( malloc_errfd
!= 2 )
85 (void) close(malloc_errfd
);