check for __sbrk

__sbrk is not defined in musl so add a check for it in configure.ac and
replace the check on ifndef __UCLIBC__ by a check on ifdef HAVE__SBRK
in src/malloc_hook_mmap_linux.h

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
This commit is contained in:
Fabrice Fontaine 2018-10-06 20:43:19 +02:00 committed by Aliaksey Kandratsenka
parent 1de76671d4
commit 1561f0946f
2 changed files with 2 additions and 1 deletions

View File

@ -191,6 +191,7 @@ AC_CHECK_TYPES([__int64]) # defined in some windows platforms
AC_CHECK_TYPES([struct mallinfo],,, [#include <malloc.h>]) AC_CHECK_TYPES([struct mallinfo],,, [#include <malloc.h>])
AC_CHECK_TYPES([Elf32_Versym],,, [#include <elf.h>]) # for vdso_support.h AC_CHECK_TYPES([Elf32_Versym],,, [#include <elf.h>]) # for vdso_support.h
AC_CHECK_FUNCS(sbrk) # for tcmalloc to get memory AC_CHECK_FUNCS(sbrk) # for tcmalloc to get memory
AC_CHECK_FUNCS(__sbrk) # for tcmalloc to get memory
AC_CHECK_FUNCS(geteuid) # for turning off services when run as root AC_CHECK_FUNCS(geteuid) # for turning off services when run as root
AC_CHECK_FUNCS(fork) # for the pthread_atfork setup AC_CHECK_FUNCS(fork) # for the pthread_atfork setup
AC_CHECK_HEADERS(features.h) # for vdso_support.h AC_CHECK_HEADERS(features.h) # for vdso_support.h

View File

@ -207,7 +207,7 @@ extern "C" void* mremap(void* old_addr, size_t old_size, size_t new_size,
return result; return result;
} }
#ifndef __UCLIBC__ #ifdef HAVE___SBRK
// libc's version: // libc's version:
extern "C" void* __sbrk(intptr_t increment); extern "C" void* __sbrk(intptr_t increment);