]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
posix_spawn, posix_spawnp: Fix build error on Minix 3.3.
authorBruno Haible <bruno@clisp.org>
Thu, 13 May 2021 13:48:38 +0000 (15:48 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 13 May 2021 13:48:38 +0000 (15:48 +0200)
* m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): If posix_spawn does not exist
but is declared, set REPLACE_POSIX_SPAWN.
* doc/posix-functions/posix_spawn.texi: Update platforms list.
* doc/posix-functions/posix_spawnp.texi: Likewise.

ChangeLog
doc/posix-functions/posix_spawn.texi
doc/posix-functions/posix_spawnp.texi
m4/posix_spawn.m4

index 0bcb9e64850859b43e5f72ac9bd34be246347161..798bbac423139d9ae9943dbf44affeb7e3b4b91d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2021-05-13  Bruno Haible  <bruno@clisp.org>
+
+       posix_spawn, posix_spawnp: Fix build error on Minix 3.3.
+       * m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): If posix_spawn does not exist
+       but is declared, set REPLACE_POSIX_SPAWN.
+       * doc/posix-functions/posix_spawn.texi: Update platforms list.
+       * doc/posix-functions/posix_spawnp.texi: Likewise.
+
 2021-05-13  Bruno Haible  <bruno@clisp.org>
 
        reallocarray tests: Avoid test failure on NetBSD.
index d0cf1b919ce7be483590ac6ff46d839ab6af7360..5e709d4edf3e730abf71f76e71ba403c5da01f46 100644 (file)
@@ -10,7 +10,7 @@ Portability problems fixed by Gnulib:
 @itemize
 @item
 This function is missing on some platforms:
-FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin 1.7.x, mingw, MSVC 14, Android 8.1.
+FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.3, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin 1.7.x, mingw, MSVC 14, Android 8.1.
 @item
 When this function fails, it causes the stdio buffer contents to be output
 twice on some platforms:
index 88b6e40274c55dbd17f3ab7fdc9ba5b86c12f860..dd27fe8518ef60425e09126c54cfb50bae457e23 100644 (file)
@@ -10,7 +10,7 @@ Portability problems fixed by Gnulib:
 @itemize
 @item
 This function is missing on some platforms:
-FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin 1.7.x, mingw, MSVC 14, Android 8.1.
+FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.3, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin 1.7.x, mingw, MSVC 14, Android 8.1.
 @item
 When this function fails, it causes the stdio buffer contents to be output
 twice on some platforms:
index 84b7a13f2aabf595e9a99584180eedc855da4b7e..b358da6fe837fdfa3113fff2c5a8e81bff002d01 100644 (file)
@@ -1,4 +1,4 @@
-# posix_spawn.m4 serial 21
+# posix_spawn.m4 serial 22
 dnl Copyright (C) 2008-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,
@@ -32,6 +32,7 @@ AC_DEFUN([gl_POSIX_SPAWN_BODY],
   dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getsigmask])
   dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setsigmask])
   dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_destroy])
+  AC_CHECK_DECLS([posix_spawn], , , [[#include <spawn.h>]])
   if test $ac_cv_func_posix_spawn = yes; then
     m4_ifdef([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR],
       [dnl Module 'posix_spawn_file_actions_addchdir' is present.
@@ -101,6 +102,17 @@ AC_DEFUN([gl_POSIX_SPAWN_BODY],
            [gl_cv_func_spawnattr_setschedparam=no])
         ])
     fi
+  else
+    dnl The system does not have the main function. Therefore we have to
+    dnl provide our own implementation. This implies to define our own
+    dnl posix_spawn_file_actions_t and posix_spawnattr_t types.
+    if test $ac_cv_have_decl_posix_spawn = yes; then
+      dnl The system declares posix_spawn() already. This declaration uses
+      dnl the original posix_spawn_file_actions_t and posix_spawnattr_t types.
+      dnl But we need a declaration with our own posix_spawn_file_actions_t and
+      dnl posix_spawnattr_t types.
+      REPLACE_POSIX_SPAWN=1
+    fi
   fi
   if test $ac_cv_func_posix_spawn != yes || test $REPLACE_POSIX_SPAWN = 1; then
     AC_DEFINE([REPLACE_POSIX_SPAWN], [1],