]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
malloc-gnu, realloc-gnu, calloc-gnu: Ensure errno gets set to ENOMEM.
authorBruno Haible <bruno@clisp.org>
Fri, 14 May 2021 17:04:05 +0000 (19:04 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 14 May 2021 17:04:05 +0000 (19:04 +0200)
* m4/malloc.m4 (gl_CHECK_MALLOC_POSIX): Set gl_cv_func_malloc_posix to
'no' also on Solaris.

ChangeLog
m4/malloc.m4

index 8136a343885ab77b0e188ed557bc07d9e5e097ae..191f4549e4227b529f193576c9bb6b667c14d17b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-05-14  Bruno Haible  <bruno@clisp.org>
+
+       malloc-gnu, realloc-gnu, calloc-gnu: Ensure errno gets set to ENOMEM.
+       * m4/malloc.m4 (gl_CHECK_MALLOC_POSIX): Set gl_cv_func_malloc_posix to
+       'no' also on Solaris.
+
 2021-05-14  Bruno Haible  <bruno@clisp.org>
 
        DEPENDENCIES: Mention the requirement for 'join'.
index 6fcd4adb67473e367dd4d2c3ecd37e5ca91f4256..972e808ab7eb5815d06db1ea75080abca409d9b8 100644 (file)
@@ -1,4 +1,4 @@
-# malloc.m4 serial 26
+# malloc.m4 serial 27
 dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -113,7 +113,7 @@ AC_DEFUN([gl_FUNC_MALLOC_POSIX],
   fi
 ])
 
-# Test whether malloc, realloc, calloc set errno on failure.
+# Test whether malloc, realloc, calloc set errno to ENOMEM on failure.
 # Set gl_cv_func_malloc_posix to yes or no accordingly.
 AC_DEFUN([gl_CHECK_MALLOC_POSIX],
 [
@@ -129,9 +129,13 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
       case "$host_os" in
         mingw*)
           gl_cv_func_malloc_posix=no ;;
-        irix*)
-          dnl The three functions return NULL with errno unset when the
-          dnl argument is larger than PTRDIFF_MAX. Here is a test program:
+        irix* | solaris*)
+          dnl On IRIX 6.5, the three functions return NULL with errno unset
+          dnl when the argument is larger than PTRDIFF_MAX.
+          dnl On Solaris 11.3, the three functions return NULL with errno set
+          dnl to EAGAIN, not ENOMEM, when the argument is larger than
+          dnl PTRDIFF_MAX.
+          dnl Here is a test program:
 m4_divert_push([KILL])
 #include <errno.h>
 #include <stdio.h>