unistr/u*-next: Add missing dependencies.
[gnulib.git] / lib / spawn.in.h
index 7e86737..c4bd80b 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for POSIX spawn interface.
-   Copyright (C) 2000, 2003, 2004, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2003-2004, 2008-2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -17,7 +17,9 @@
 
 #ifndef _GL_SPAWN_H
 
+#if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
+#endif
 
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_SPAWN_H@
 #ifndef _GL_SPAWN_H
 #define _GL_SPAWN_H
 
-#include <sched.h>
-#include <signal.h>
+/* Get definitions of 'struct sched_param' and 'sigset_t'.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <sched.h>
+# include <signal.h>
+#endif
+
 #include <sys/types.h>
 
 #ifndef __THROW
@@ -53,9 +60,9 @@
    sys/cdefs.h's definition of __restrict_arr, though, as it
    mishandles gcc -ansi -pedantic.  */
 #ifndef _Restrict_arr_
-# if ((199901L <= __STDC_VERSION__                                     \
-       || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__))    \
-          && !__STRICT_ANSI__))                                        \
+# if ((199901L <= __STDC_VERSION__                                      \
+       || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__))     \
+           && !__STRICT_ANSI__))                                        \
       && !defined __GNUG__)
 #  define _Restrict_arr_ _Restrict_
 # else
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
 
 /* Data structure to contain attributes for thread creation.  */
 #if @REPLACE_POSIX_SPAWN@
 # define posix_spawnattr_t rpl_posix_spawnattr_t
 #endif
+#if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWNATTR_T@
 typedef struct
 {
   short int _flags;
@@ -80,6 +90,7 @@ typedef struct
   int _policy;
   int __pad[16];
 } posix_spawnattr_t;
+#endif
 
 
 /* Data structure to contain information about the actions to be
@@ -87,6 +98,7 @@ typedef struct
 #if @REPLACE_POSIX_SPAWN@
 # define posix_spawn_file_actions_t rpl_posix_spawn_file_actions_t
 #endif
+#if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
 typedef struct
 {
   int _allocated;
@@ -94,17 +106,36 @@ typedef struct
   struct __spawn_action *_actions;
   int __pad[16];
 } posix_spawn_file_actions_t;
+#endif
 
 
 /* Flags to be set in the `posix_spawnattr_t'.  */
-#define POSIX_SPAWN_RESETIDS           0x01
-#define POSIX_SPAWN_SETPGROUP          0x02
-#define POSIX_SPAWN_SETSIGDEF          0x04
-#define POSIX_SPAWN_SETSIGMASK         0x08
-#define POSIX_SPAWN_SETSCHEDPARAM      0x10
-#define POSIX_SPAWN_SETSCHEDULER       0x20
-/* A GNU extension.  */
-#define POSIX_SPAWN_USEVFORK           0x40
+#if @REPLACE_POSIX_SPAWN@
+/* Use the values from the system, for better compatibility.  */
+/* But this implementation does not support AIX extensions.  */
+# undef POSIX_SPAWN_FORK_HANDLERS
+#else
+# define POSIX_SPAWN_RESETIDS           0x01
+# define POSIX_SPAWN_SETPGROUP          0x02
+# define POSIX_SPAWN_SETSIGDEF          0x04
+# define POSIX_SPAWN_SETSIGMASK         0x08
+# define POSIX_SPAWN_SETSCHEDPARAM      0x10
+# define POSIX_SPAWN_SETSCHEDULER       0x20
+#endif
+/* A GNU extension.  Use the next free bit position.  */
+#define POSIX_SPAWN_USEVFORK \
+  ((POSIX_SPAWN_RESETIDS | (POSIX_SPAWN_RESETIDS - 1)                   \
+    | POSIX_SPAWN_SETPGROUP | (POSIX_SPAWN_SETPGROUP - 1)               \
+    | POSIX_SPAWN_SETSIGDEF | (POSIX_SPAWN_SETSIGDEF - 1)               \
+    | POSIX_SPAWN_SETSIGMASK | (POSIX_SPAWN_SETSIGMASK - 1)             \
+    | POSIX_SPAWN_SETSCHEDPARAM | (POSIX_SPAWN_SETSCHEDPARAM - 1)       \
+    | POSIX_SPAWN_SETSCHEDULER | (POSIX_SPAWN_SETSCHEDULER - 1))        \
+   + 1)
+typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap
+            [2 * (((POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP
+                    | POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK
+                    | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER)
+                   & POSIX_SPAWN_USEVFORK) == 0) - 1];
 
 
 #ifdef __cplusplus
@@ -123,12 +154,19 @@ extern "C" {
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawn (pid_t *_Restrict_ __pid,
-                       const char *_Restrict_ __path,
-                       const posix_spawn_file_actions_t *_Restrict_ __file_actions,
-                       const posix_spawnattr_t *_Restrict_ __attrp,
-                       char *const argv[_Restrict_arr_],
-                       char *const envp[_Restrict_arr_]);
-# endif
+                        const char *_Restrict_ __path,
+                        const posix_spawn_file_actions_t *_Restrict_ __file_actions,
+                        const posix_spawnattr_t *_Restrict_ __attrp,
+                        char *const argv[_Restrict_arr_],
+                        char *const envp[_Restrict_arr_])
+     _GL_ARG_NONNULL ((2, 5, 6));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawn
+# define posix_spawn(a,b,c,d,e,f)                   \
+  (GL_LINK_WARNING ("posix_spawn is unportable - "        \
+                    "use gnulib module posix_spawn for portability"),   \
+   posix_spawn (a, b, c, d, e, f))
 #endif
 
 #if @GNULIB_POSIX_SPAWNP@
@@ -141,10 +179,17 @@ extern int posix_spawn (pid_t *_Restrict_ __pid,
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawnp (pid_t *__pid, const char *__file,
-                        const posix_spawn_file_actions_t *__file_actions,
-                        const posix_spawnattr_t *__attrp,
-                        char *const argv[], char *const envp[]);
-# endif
+                         const posix_spawn_file_actions_t *__file_actions,
+                         const posix_spawnattr_t *__attrp,
+                         char *const argv[], char *const envp[])
+     _GL_ARG_NONNULL ((2, 5, 6));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnp
+# define posix_spawnp(a,b,c,d,e,f)                   \
+  (GL_LINK_WARNING ("posix_spawnp is unportable - "        \
+                    "use gnulib module posix_spawnp for portability"),   \
+   posix_spawnp (a, b, c, d, e, f))
 #endif
 
 
@@ -154,8 +199,15 @@ extern int posix_spawnp (pid_t *__pid, const char *__file,
 #  define posix_spawnattr_init rpl_posix_spawnattr_init
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
-extern int posix_spawnattr_init (posix_spawnattr_t *__attr) __THROW;
-# endif
+extern int posix_spawnattr_init (posix_spawnattr_t *__attr)
+     __THROW _GL_ARG_NONNULL ((1));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_init
+# define posix_spawnattr_init(a)                   \
+  (GL_LINK_WARNING ("posix_spawnattr_init is unportable - "        \
+                    "use gnulib module posix_spawnattr_init for portability"), \
+   posix_spawnattr_init (a))
 #endif
 
 #if @GNULIB_POSIX_SPAWNATTR_DESTROY@
@@ -164,8 +216,15 @@ extern int posix_spawnattr_init (posix_spawnattr_t *__attr) __THROW;
 #  define posix_spawnattr_destroy rpl_posix_spawnattr_destroy
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
-extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr) __THROW;
-# endif
+extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr)
+     __THROW _GL_ARG_NONNULL ((1));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_destroy
+# define posix_spawnattr_destroy(a)                   \
+  (GL_LINK_WARNING ("posix_spawnattr_destroy is unportable - "        \
+                    "use gnulib module posix_spawnattr_destroy for portability"), \
+   posix_spawnattr_destroy (a))
 #endif
 
 #if @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
@@ -176,9 +235,15 @@ extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr) __THROW;
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawnattr_getsigdefault (const posix_spawnattr_t *_Restrict_ __attr,
-                                         sigset_t *_Restrict_ __sigdefault)
-     __THROW;
-# endif
+                                          sigset_t *_Restrict_ __sigdefault)
+     __THROW _GL_ARG_NONNULL ((1, 2));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_getsigdefault
+# define posix_spawnattr_getsigdefault(a, b)                         \
+  (GL_LINK_WARNING ("posix_spawnattr_getsigdefault is unportable - "        \
+                    "use gnulib module posix_spawnattr_getsigdefault for portability"), \
+   posix_spawnattr_getsigdefault (a, b))
 #endif
 
 #if @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
@@ -188,9 +253,15 @@ extern int posix_spawnattr_getsigdefault (const posix_spawnattr_t *_Restrict_ __
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawnattr_setsigdefault (posix_spawnattr_t *_Restrict_ __attr,
-                                         const sigset_t *_Restrict_ __sigdefault)
-     __THROW;
-# endif
+                                          const sigset_t *_Restrict_ __sigdefault)
+     __THROW _GL_ARG_NONNULL ((1, 2));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_setsigdefault
+# define posix_spawnattr_setsigdefault(a, b)                         \
+  (GL_LINK_WARNING ("posix_spawnattr_setsigdefault is unportable - "        \
+                    "use gnulib module posix_spawnattr_setsigdefault for portability"), \
+   posix_spawnattr_setsigdefault (a, b))
 #endif
 
 #if @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
@@ -200,8 +271,15 @@ extern int posix_spawnattr_setsigdefault (posix_spawnattr_t *_Restrict_ __attr,
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawnattr_getsigmask (const posix_spawnattr_t *_Restrict_ __attr,
-                                      sigset_t *_Restrict_ __sigmask) __THROW;
-# endif
+                                       sigset_t *_Restrict_ __sigmask)
+     __THROW _GL_ARG_NONNULL ((1, 2));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_getsigmask
+# define posix_spawnattr_getsigmask(a, b)                         \
+  (GL_LINK_WARNING ("posix_spawnattr_getsigmask is unportable - "        \
+                    "use gnulib module posix_spawnattr_getsigmask for portability"), \
+   posix_spawnattr_getsigmask (a, b))
 #endif
 
 #if @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
@@ -211,9 +289,15 @@ extern int posix_spawnattr_getsigmask (const posix_spawnattr_t *_Restrict_ __att
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawnattr_setsigmask (posix_spawnattr_t *_Restrict_ __attr,
-                                      const sigset_t *_Restrict_ __sigmask)
-     __THROW;
-# endif
+                                       const sigset_t *_Restrict_ __sigmask)
+     __THROW _GL_ARG_NONNULL ((1, 2));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_setsigmask
+# define posix_spawnattr_setsigmask(a, b)                         \
+  (GL_LINK_WARNING ("posix_spawnattr_setsigmask is unportable - "        \
+                    "use gnulib module posix_spawnattr_setsigmask for portability"), \
+   posix_spawnattr_setsigmask (a, b))
 #endif
 
 #if @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
@@ -223,8 +307,15 @@ extern int posix_spawnattr_setsigmask (posix_spawnattr_t *_Restrict_ __attr,
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawnattr_getflags (const posix_spawnattr_t *_Restrict_ __attr,
-                                    short int *_Restrict_ __flags) __THROW;
-# endif
+                                     short int *_Restrict_ __flags)
+     __THROW _GL_ARG_NONNULL ((1, 2));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_getflags
+# define posix_spawnattr_getflags(a, b)                         \
+  (GL_LINK_WARNING ("posix_spawnattr_getflags is unportable - "        \
+                    "use gnulib module posix_spawnattr_getflags for portability"), \
+   posix_spawnattr_getflags (a, b))
 #endif
 
 #if @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
@@ -234,8 +325,15 @@ extern int posix_spawnattr_getflags (const posix_spawnattr_t *_Restrict_ __attr,
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawnattr_setflags (posix_spawnattr_t *__attr,
-                                    short int __flags) __THROW;
-# endif
+                                     short int __flags)
+     __THROW _GL_ARG_NONNULL ((1));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_setflags
+# define posix_spawnattr_setflags(a, b)                         \
+  (GL_LINK_WARNING ("posix_spawnattr_setflags is unportable - "        \
+                    "use gnulib module posix_spawnattr_setflags for portability"), \
+   posix_spawnattr_setflags (a, b))
 #endif
 
 #if @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
@@ -245,9 +343,15 @@ extern int posix_spawnattr_setflags (posix_spawnattr_t *__attr,
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawnattr_getpgroup (const posix_spawnattr_t *_Restrict_ __attr,
-                                     pid_t *_Restrict_ __pgroup)
-     __THROW;
-# endif
+                                      pid_t *_Restrict_ __pgroup)
+     __THROW _GL_ARG_NONNULL ((1, 2));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_getpgroup
+# define posix_spawnattr_getpgroup(a, b)                         \
+  (GL_LINK_WARNING ("posix_spawnattr_getpgroup is unportable - "        \
+                    "use gnulib module posix_spawnattr_getpgroup for portability"), \
+   posix_spawnattr_getpgroup (a, b))
 #endif
 
 #if @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
@@ -257,8 +361,15 @@ extern int posix_spawnattr_getpgroup (const posix_spawnattr_t *_Restrict_ __attr
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawnattr_setpgroup (posix_spawnattr_t *__attr,
-                                     pid_t __pgroup) __THROW;
-# endif
+                                      pid_t __pgroup)
+     __THROW _GL_ARG_NONNULL ((1));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_setpgroup
+# define posix_spawnattr_setpgroup(a, b)                         \
+  (GL_LINK_WARNING ("posix_spawnattr_setpgroup is unportable - "        \
+                    "use gnulib module posix_spawnattr_setpgroup for portability"), \
+   posix_spawnattr_setpgroup (a, b))
 #endif
 
 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
@@ -268,9 +379,15 @@ extern int posix_spawnattr_setpgroup (posix_spawnattr_t *__attr,
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawnattr_getschedpolicy (const posix_spawnattr_t *_Restrict_ __attr,
-                                          int *_Restrict_ __schedpolicy)
-     __THROW;
-# endif
+                                           int *_Restrict_ __schedpolicy)
+     __THROW _GL_ARG_NONNULL ((1, 2));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_getschedpolicy
+# define posix_spawnattr_getschedpolicy(a, b)                         \
+  (GL_LINK_WARNING ("posix_spawnattr_getschedpolicy is unportable - "        \
+                    "use gnulib module posix_spawnattr_getschedpolicy for portability"), \
+   posix_spawnattr_getschedpolicy (a, b))
 #endif
 
 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
@@ -280,8 +397,15 @@ extern int posix_spawnattr_getschedpolicy (const posix_spawnattr_t *_Restrict_ _
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawnattr_setschedpolicy (posix_spawnattr_t *__attr,
-                                          int __schedpolicy) __THROW;
-# endif
+                                           int __schedpolicy)
+     __THROW _GL_ARG_NONNULL ((1));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_setschedpolicy
+# define posix_spawnattr_setschedpolicy(a, b)                         \
+  (GL_LINK_WARNING ("posix_spawnattr_setschedpolicy is unportable - "        \
+                    "use gnulib module posix_spawnattr_setschedpolicy for portability"), \
+   posix_spawnattr_setschedpolicy (a, b))
 #endif
 
 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
@@ -291,8 +415,15 @@ extern int posix_spawnattr_setschedpolicy (posix_spawnattr_t *__attr,
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawnattr_getschedparam (const posix_spawnattr_t *_Restrict_ __attr,
-                                         struct sched_param *_Restrict_ __schedparam) __THROW;
-# endif
+                                          struct sched_param *_Restrict_ __schedparam)
+     __THROW _GL_ARG_NONNULL ((1, 2));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_getschedparam
+# define posix_spawnattr_getschedparam(a, b)                         \
+  (GL_LINK_WARNING ("posix_spawnattr_getschedparam is unportable - "        \
+                    "use gnulib module posix_spawnattr_getschedparam for portability"), \
+   posix_spawnattr_getschedparam (a, b))
 #endif
 
 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
@@ -302,8 +433,15 @@ extern int posix_spawnattr_getschedparam (const posix_spawnattr_t *_Restrict_ __
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawnattr_setschedparam (posix_spawnattr_t *_Restrict_ __attr,
-                                         const struct sched_param *_Restrict_ __schedparam) __THROW;
-# endif
+                                          const struct sched_param *_Restrict_ __schedparam)
+     __THROW _GL_ARG_NONNULL ((1, 2));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawnattr_setschedparam
+# define posix_spawnattr_setschedparam(a, b)                         \
+  (GL_LINK_WARNING ("posix_spawnattr_setschedparam is unportable - "        \
+                    "use gnulib module posix_spawnattr_setschedparam for portability"), \
+   posix_spawnattr_setschedparam (a, b))
 #endif
 
 
@@ -313,8 +451,15 @@ extern int posix_spawnattr_setschedparam (posix_spawnattr_t *_Restrict_ __attr,
 #  define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
-extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *__file_actions) __THROW;
-# endif
+extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *__file_actions)
+     __THROW _GL_ARG_NONNULL ((1));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawn_file_actions_init
+# define posix_spawn_file_actions_init(a)                         \
+  (GL_LINK_WARNING ("posix_spawn_file_actions_init is unportable - "        \
+                    "use gnulib module posix_spawn_file_actions_init for portability"), \
+   posix_spawn_file_actions_init (a))
 #endif
 
 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
@@ -323,8 +468,15 @@ extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *__file_act
 #  define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
-extern int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *__file_actions) __THROW;
-# endif
+extern int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *__file_actions)
+     __THROW _GL_ARG_NONNULL ((1));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawn_file_actions_destroy
+# define posix_spawn_file_actions_destroy(a)                         \
+  (GL_LINK_WARNING ("posix_spawn_file_actions_destroy is unportable - "        \
+                    "use gnulib module posix_spawn_file_actions_destroy for portability"), \
+   posix_spawn_file_actions_destroy (a))
 #endif
 
 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
@@ -335,11 +487,17 @@ extern int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *__file_
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *_Restrict_ __file_actions,
-                                            int __fd,
-                                            const char *_Restrict_ __path,
-                                            int __oflag, mode_t __mode)
-     __THROW;
-# endif
+                                             int __fd,
+                                             const char *_Restrict_ __path,
+                                             int __oflag, mode_t __mode)
+     __THROW _GL_ARG_NONNULL ((1, 3));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawn_file_actions_addopen
+# define posix_spawn_file_actions_addopen(a, b, c, d, e)                     \
+  (GL_LINK_WARNING ("posix_spawn_file_actions_addopen is unportable - "        \
+                    "use gnulib module posix_spawn_file_actions_addopen for portability"), \
+   posix_spawn_file_actions_addopen (a, b, c, d, e))
 #endif
 
 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
@@ -350,9 +508,15 @@ extern int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *_Restri
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *__file_actions,
-                                             int __fd)
-     __THROW;
-# endif
+                                              int __fd)
+     __THROW _GL_ARG_NONNULL ((1));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawn_file_actions_addclose
+# define posix_spawn_file_actions_addclose(a,b)                          \
+  (GL_LINK_WARNING ("posix_spawn_file_actions_addclose is unportable - "        \
+                    "use gnulib module posix_spawn_file_actions_addclose for portability"), \
+   posix_spawn_file_actions_addclose (a, b))
 #endif
 
 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
@@ -363,8 +527,15 @@ extern int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *__file
 # endif
 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
 extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *__file_actions,
-                                            int __fd, int __newfd) __THROW;
-# endif
+                                             int __fd, int __newfd)
+     __THROW _GL_ARG_NONNULL ((1));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawn_file_actions_adddup2
+# define posix_spawn_file_actions_adddup2(a,b,c)                         \
+  (GL_LINK_WARNING ("posix_spawn_file_actions_adddup2 is unportable - "        \
+                    "use gnulib module posix_spawn_file_actions_adddup2 for portability"), \
+   posix_spawn_file_actions_adddup2 (a, b, c))
 #endif