diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2000-11-26 10:30:18 +0000 | 
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2000-11-26 10:30:18 +0000 | 
| commit | 798c1fd885d527f5ed4df8ae8fe432d3b82fe7af (patch) | |
| tree | b1cdc4cccc75b418d4ebf26459a495ec3a3eefc0 /lib/libc/stdlib/malloc.3 | |
| parent | a16f31237ae8e7c18d79136cad547dd1c77cec38 (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdlib/malloc.3')
| -rw-r--r-- | lib/libc/stdlib/malloc.3 | 20 | 
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/libc/stdlib/malloc.3 b/lib/libc/stdlib/malloc.3 index 03feaa37a01b..e7d53f955d08 100644 --- a/lib/libc/stdlib/malloc.3 +++ b/lib/libc/stdlib/malloc.3 @@ -57,7 +57,9 @@  .Ft void  .Fn free "void *ptr"  .Ft char * -.Va malloc_options; +.Va _malloc_options +.Ft void +.Va (*_malloc_message)(char *p1, char *p2, char *p3, char *p4)  .Sh DESCRIPTION  The  .Fn malloc @@ -146,7 +148,7 @@ The ``name'' of the file referenced by the symbolic link named  the value of the environment variable  .Ev MALLOC_OPTIONS ,  and the string pointed to by the global variable -.Va malloc_options  +.Va _malloc_options   will be interpreted, in that order, character by character as flags.  .Pp  Most flags are single letters, @@ -211,8 +213,7 @@ core (using  This option should be set at compile time by including the following in  the source code:  .Bd -literal -offset indent -extern char *malloc_options; -malloc_options = "X"; +_malloc_options = "X";  .Ed  .It Z  This option implicitly sets the @@ -249,8 +250,7 @@ ln -s 'A<' /etc/malloc.conf  To specify in the source that a program does no return value checking  on calls to these functions:  .Bd -literal -offset indent -extern char *malloc_options; -malloc_options = "X"; +_malloc_options = "X";  .Ed  .Sh ENVIRONMENT  The following environment variables affect the execution of the allocation @@ -364,6 +364,14 @@ If the  .Dq A  option is set, all warnings are treated as errors.  .Pp +The +.Va _malloc_message +variable allows the programmer to override the function which emits +the text strings forming the errors and warnings if for some reason +the stderr filedescriptor is not suitable for this. +Please note that doing anything which tries to allocate memory in +this function will certain suicide for the process. +.Pp  The following is a brief description of possible error messages and  their meanings:  .Pp  | 
