diff --git a/include/stdlib.h b/include/stdlib.h index a76f8edb9a78..086cdddc0f10 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -124,7 +124,7 @@ int mbtowc(wchar_t *, const char *, size_t); size_t wcstombs(char *, const wchar_t *, size_t); #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) -extern char *_malloc_options; +extern const char *_malloc_options; extern void (*_malloc_message)(char *p1, char *p2, char *p3, char *p4); int putenv(const char *); diff --git a/lib/libc/stdlib/malloc.3 b/lib/libc/stdlib/malloc.3 index 4271ff80c576..a78d83016394 100644 --- a/lib/libc/stdlib/malloc.3 +++ b/lib/libc/stdlib/malloc.3 @@ -56,8 +56,8 @@ .Fn reallocf "void *ptr" "size_t size" .Ft void .Fn free "void *ptr" -.Ft char * -.Va _malloc_options +.Ft const char * +.Va _malloc_options; .Ft void .Fn \*(lp*_malloc_message\*(rp "char *p1" "char *p2" "char *p3" "char *p4" .Sh DESCRIPTION diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 43aad2d79211..d2371bdd69a2 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -267,7 +267,7 @@ static void *malloc_brk; static struct pgfree *px; /* compile-time options */ -char *_malloc_options; +const char *_malloc_options; /* Name of the current public function */ static char *malloc_func;