Check if sbrk is available

The only use of sbrk in libgtop is in an example which always calls it
with 0. Since the use of sbrk provides no functionality, just skip these
calls when sbrk is not available.

This problem was first reported on FreeBSD Bugzilla because FreeBSD
decides not to support sbrk on ARM64 and RISC-V:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221751

Fix https://gitlab.gnome.org/GNOME/libgtop/issues/46
This commit is contained in:
Ting-Wei Lan
2019-12-02 21:46:50 +08:00
committed by Robert Roth
parent 9e98bbd98b
commit 4229d1ea20
2 changed files with 7 additions and 1 deletions

View File

@@ -213,7 +213,7 @@ AC_FUNC_ALLOCA
AC_FUNC_MMAP
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname)
AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv sbrk strdup strtoul uname)
# FIXME: Remove AM_GNU_GETTEXT_VERSION once autoreconf supports REQUIRE_VERSION
AM_GNU_GETTEXT_VERSION([0.19.6])