From: Bruno Haible Date: Mon, 7 Dec 2020 18:43:06 +0000 (+0100) Subject: get-rusage-data: Fix link error on FreeBSD 12.2/arm64. X-Git-Tag: v1.0~3404 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=c3ffa09c79b3046ef6b06a5a5f4381e60de74ea9;p=gnulib.git get-rusage-data: Fix link error on FreeBSD 12.2/arm64. * modules/get-rusage-data (configure.ac): Test whether sbrk exists. * lib/get-rusage-data.c (get_rusage_data_via_setrlimit): Define trivially of sbrk is not available. * doc/glibc-functions/sbrk.texi: Mention that the function does not exist in FreeBSD 12.2/arm64. * doc/glibc-functions/brk.texi: Likewise. --- diff --git a/ChangeLog b/ChangeLog index 249a50ba11..3458610f9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2020-12-07 Bruno Haible + + get-rusage-data: Fix link error on FreeBSD 12.2/arm64. + * modules/get-rusage-data (configure.ac): Test whether sbrk exists. + * lib/get-rusage-data.c (get_rusage_data_via_setrlimit): Define + trivially of sbrk is not available. + * doc/glibc-functions/sbrk.texi: Mention that the function does not + exist in FreeBSD 12.2/arm64. + * doc/glibc-functions/brk.texi: Likewise. + 2020-12-07 Bruno Haible Correct interaction between gl_ANSI_CXX and AC_PROG_CXX. diff --git a/doc/glibc-functions/brk.texi b/doc/glibc-functions/brk.texi index bc046ca4dd..2ca966dd4c 100644 --- a/doc/glibc-functions/brk.texi +++ b/doc/glibc-functions/brk.texi @@ -25,5 +25,5 @@ Portability problems not fixed by Gnulib: @itemize @item This function is missing on some platforms: -AIX 5.1, Cygwin 2.9, mingw, MSVC 14. +FreeBSD 12.2/arm64, AIX 5.1, Cygwin 2.9, mingw, MSVC 14. @end itemize diff --git a/doc/glibc-functions/sbrk.texi b/doc/glibc-functions/sbrk.texi index 8a3d5ab677..c09459fc9b 100644 --- a/doc/glibc-functions/sbrk.texi +++ b/doc/glibc-functions/sbrk.texi @@ -14,5 +14,5 @@ Portability problems not fixed by Gnulib: @itemize @item This function is missing on some platforms: -AIX 5.1, mingw, MSVC 14. +FreeBSD 12.2/arm64, AIX 5.1, mingw, MSVC 14. @end itemize diff --git a/lib/get-rusage-data.c b/lib/get-rusage-data.c index 411be94423..234442c36e 100644 --- a/lib/get-rusage-data.c +++ b/lib/get-rusage-data.c @@ -150,7 +150,7 @@ #if !(defined __APPLE__ && defined __MACH__) || defined TEST /* Implement get_rusage_data_via_setrlimit(). */ -# if HAVE_SETRLIMIT && defined RLIMIT_DATA && !defined __HAIKU__ +# if HAVE_SETRLIMIT && defined RLIMIT_DATA && HAVE_SBRK && !defined __HAIKU__ # ifdef _AIX # define errno_expected() (errno == EINVAL || errno == EFAULT) @@ -166,9 +166,9 @@ get_rusage_data_via_setrlimit (void) struct rlimit orig_limit; # ifdef __hpux - /* On HP-UX 11.00, setrlimit() RLIMIT_DATA of does not work: It cannot + /* On HP-UX 11.00, setrlimit() of RLIMIT_DATA does not work: It cannot restore the previous limits. - On HP-UX 11.11, setrlimit() RLIMIT_DATA of does not work: It sometimes + On HP-UX 11.11, setrlimit() of RLIMIT_DATA does not work: It sometimes has no effect on the next sbrk() call. */ { struct utsname buf; diff --git a/modules/get-rusage-data b/modules/get-rusage-data index 6840116589..4206ec9642 100644 --- a/modules/get-rusage-data +++ b/modules/get-rusage-data @@ -14,7 +14,7 @@ getpagesize vma-iter configure.ac: -AC_CHECK_FUNCS_ONCE([setrlimit]) +AC_CHECK_FUNCS_ONCE([sbrk setrlimit]) gl_FUNC_MMAP_ANON Makefile.am: