* lib/spawn.in.h (posix_spawn_file_actions_addfchdir): New declaration.
* lib/spawn_int.h (struct __spawn_action): Add tag 'spawn_do_fchdir' and
union member 'fchdir_action'.
* lib/spawn_faction_addfchdir.c: New file.
* lib/spawni.c (__spawni): Implement the spawn_do_fchdir action.
* m4/posix_spawn_faction_addfchdir.m4: New file.
* m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): Test whether module
'posix_spawn_file_actions_addfchdir' is present and whether
posix_spawn_file_actions_addfchdir_np exists. Set REPLACE_POSIX_SPAWN.
* m4/spawn_h.m4 (gl_SPAWN_H): Test whether
posix_spawn_file_actions_addfchdir is declared.
(gl_SPAWN_H_DEFAULTS): Initialize
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR,
HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR,
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR.
* modules/spawn (Makefile.am): Substitute
GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR,
HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR,
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR.
* modules/posix_spawn_file_actions_addfchdir: New file.
* tests/test-spawn-c++.cc (posix_spawn_file_actions_addfchdir): Check
signature.
* doc/posix-functions/posix_spawn.texi: Mention the new module.
* doc/posix-functions/posix_spawnp.texi: Likewise.
* doc/glibc-functions/posix_spawn_file_actions_addfchdir_np.texi:
Likewise.
+2019-06-10 Bruno Haible <bruno@clisp.org>
+
+ posix_spawn_file_actions_addfchdir: New module.
+ * lib/spawn.in.h (posix_spawn_file_actions_addfchdir): New declaration.
+ * lib/spawn_int.h (struct __spawn_action): Add tag 'spawn_do_fchdir' and
+ union member 'fchdir_action'.
+ * lib/spawn_faction_addfchdir.c: New file.
+ * lib/spawni.c (__spawni): Implement the spawn_do_fchdir action.
+ * m4/posix_spawn_faction_addfchdir.m4: New file.
+ * m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): Test whether module
+ 'posix_spawn_file_actions_addfchdir' is present and whether
+ posix_spawn_file_actions_addfchdir_np exists. Set REPLACE_POSIX_SPAWN.
+ * m4/spawn_h.m4 (gl_SPAWN_H): Test whether
+ posix_spawn_file_actions_addfchdir is declared.
+ (gl_SPAWN_H_DEFAULTS): Initialize
+ GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR,
+ HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR,
+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR.
+ * modules/spawn (Makefile.am): Substitute
+ GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR,
+ HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR,
+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR.
+ * modules/posix_spawn_file_actions_addfchdir: New file.
+ * tests/test-spawn-c++.cc (posix_spawn_file_actions_addfchdir): Check
+ signature.
+ * doc/posix-functions/posix_spawn.texi: Mention the new module.
+ * doc/posix-functions/posix_spawnp.texi: Likewise.
+ * doc/glibc-functions/posix_spawn_file_actions_addfchdir_np.texi:
+ Likewise.
+
2019-06-10 Bruno Haible <bruno@clisp.org>
doc: Document existence of posix_spawn_file_actions_addchdir module.
This function is missing on all non-glibc platforms:
glibc 2.28, Mac OS X 10.5, FreeBSD 12.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.31, IRIX 6.5, OSF/1 5.1, Solaris 11.4, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 9.0.
@end itemize
+
+Note: Gnulib has a module @code{posix_spawn_file_actions_addfchdir} that
+provides equivalent functionality, just without the suffix @code{_np}.
AIX 6.1 (under particular circumstances), mingw.
@end itemize
-The Gnulib module @code{posix_spawn_file_actions_addchdir} provides an
-additional action, that consists in changing the current directory of
-the child process before starting the specified program.
+The Gnulib modules @code{posix_spawn_file_actions_addchdir} and
+@code{posix_spawn_file_actions_addfchdir} provide additional actions,
+that consist in changing the current directory of the child process
+before starting the specified program.
AIX 6.1 (under particular circumstances), mingw.
@end itemize
-The Gnulib module @code{posix_spawn_file_actions_addchdir} provides an
-additional action, that consists in changing the current directory of
-the child process before starting the specified program.
+The Gnulib modules @code{posix_spawn_file_actions_addchdir} and
+@code{posix_spawn_file_actions_addfchdir} provide additional actions,
+that consist in changing the current directory of the child process
+before starting the specified program.
# endif
#endif
+#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
+/* Add an action to FILE-ACTIONS which tells the implementation to call
+ 'fchdir' to the given directory during the 'spawn' call. */
+# if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define posix_spawn_file_actions_addfchdir rpl_posix_spawn_file_actions_addfchdir
+# endif
+_GL_FUNCDECL_RPL (posix_spawn_file_actions_addfchdir, int,
+ (posix_spawn_file_actions_t *_Restrict_ __file_actions,
+ int __fd)
+ __THROW _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (posix_spawn_file_actions_addfchdir, int,
+ (posix_spawn_file_actions_t *_Restrict_ __file_actions,
+ int __fd));
+# else
+# if !@HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
+_GL_FUNCDECL_SYS (posix_spawn_file_actions_addfchdir, int,
+ (posix_spawn_file_actions_t *_Restrict_ __file_actions,
+ int __fd)
+ __THROW _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (posix_spawn_file_actions_addfchdir, int,
+ (posix_spawn_file_actions_t *_Restrict_ __file_actions,
+ int __fd));
+# endif
+_GL_CXXALIASWARN (posix_spawn_file_actions_addfchdir);
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawn_file_actions_addfchdir
+# if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR
+_GL_WARN_ON_USE (posix_spawn_file_actions_addfchdir,
+ "posix_spawn_file_actions_addfchdir is unportable - "
+ "use gnulib module posix_spawn_file_actions_addfchdir for portability");
+# endif
+#endif
+
#endif /* _@GUARD_PREFIX@_SPAWN_H */
#endif /* _@GUARD_PREFIX@_SPAWN_H */
--- /dev/null
+/* Copyright (C) 2018-2019 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <spawn.h>
+
+#include <errno.h>
+#include <unistd.h>
+
+#if !_LIBC
+# define __sysconf(open_max) getdtablesize ()
+#endif
+
+#if REPLACE_POSIX_SPAWN
+# include "spawn_int.h"
+#endif
+
+/* Add an action to FILE-ACTIONS which tells the implementation to call
+ 'fchdir' to the given directory during the 'spawn' call. */
+int
+posix_spawn_file_actions_addfchdir (posix_spawn_file_actions_t *file_actions,
+ int fd)
+#undef posix_spawn_file_actions_addfchdir
+{
+ int maxfd = __sysconf (_SC_OPEN_MAX);
+
+ /* Test for the validity of the file descriptor. */
+ if (fd < 0 || fd >= maxfd)
+ return EBADF;
+
+#if !REPLACE_POSIX_SPAWN
+ return posix_spawn_file_actions_addfchdir_np (file_actions, fd);
+#else
+ /* Allocate more memory if needed. */
+ if (file_actions->_used == file_actions->_allocated
+ && __posix_spawn_file_actions_realloc (file_actions) != 0)
+ /* This can only mean we ran out of memory. */
+ return ENOMEM;
+
+ {
+ struct __spawn_action *rec;
+
+ /* Add the new value. */
+ rec = &file_actions->_actions[file_actions->_used];
+ rec->tag = spawn_do_fchdir;
+ rec->action.fchdir_action.fd = fd;
+
+ /* Account for the new entry. */
+ ++file_actions->_used;
+
+ return 0;
+ }
+#endif
+}
spawn_do_close,
spawn_do_dup2,
spawn_do_open,
- spawn_do_chdir
+ spawn_do_chdir,
+ spawn_do_fchdir
} tag;
union
{
const char *path;
} chdir_action;
+ struct
+ {
+ int fd;
+ } fchdir_action;
} action;
};
/* The 'chdir' call failed. */
_exit (SPAWN_ERROR);
break;
+
+ case spawn_do_fchdir:
+ if (fchdir (action->action.fchdir_action.fd) < 0)
+ /* The 'fchdir' call failed. */
+ _exit (SPAWN_ERROR);
+ break;
}
}
}
-# posix_spawn.m4 serial 16
+# posix_spawn.m4 serial 17
dnl Copyright (C) 2008-2019 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
REPLACE_POSIX_SPAWN=1
fi
])
+ m4_ifdef([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR],
+ [dnl Module 'posix_spawn_file_actions_addfchdir' is present.
+ AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addfchdir_np])
+ if test $ac_cv_func_posix_spawn_file_actions_addfchdir_np = no; then
+ dnl In order to implement the posix_spawn_file_actions_addfchdir
+ dnl function, we need to replace the entire posix_spawn facility.
+ REPLACE_POSIX_SPAWN=1
+ fi
+ ])
if test $REPLACE_POSIX_SPAWN = 0; then
gl_POSIX_SPAWN_WORKS
case "$gl_cv_func_posix_spawn_works" in
--- /dev/null
+# posix_spawn_faction_addfchdir.m4 serial 1
+dnl Copyright (C) 2018-2019 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR],
+[
+ AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
+ AC_REQUIRE([AC_PROG_CC])
+ gl_POSIX_SPAWN
+ AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addfchdir posix_spawn_file_actions_addfchdir_np])
+ if test $ac_cv_func_posix_spawn_file_actions_addfchdir = yes; then
+ dnl This function is not yet standardized. Therefore override the
+ dnl system's implementation always.
+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR=1
+ else
+ HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR=0
+ fi
+])
-# spawn_h.m4 serial 17
+# spawn_h.m4 serial 18
dnl Copyright (C) 2008-2019 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
posix_spawnattr_getschedparam posix_spawnattr_setschedparam
posix_spawn_file_actions_init posix_spawn_file_actions_destroy
posix_spawn_file_actions_addopen posix_spawn_file_actions_addclose
- posix_spawn_file_actions_adddup2 posix_spawn_file_actions_addchdir])
+ posix_spawn_file_actions_adddup2 posix_spawn_file_actions_addchdir
+ posix_spawn_file_actions_addfchdir])
])
dnl Checks whether the system has the functions posix_spawn.
AC_DEFUN([gl_SPAWN_H_DEFAULTS],
[
- GNULIB_POSIX_SPAWN=0; AC_SUBST([GNULIB_POSIX_SPAWN])
- GNULIB_POSIX_SPAWNP=0; AC_SUBST([GNULIB_POSIX_SPAWNP])
- GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT])
- GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR])
- GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE])
- GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2])
- GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN])
- GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY])
- GNULIB_POSIX_SPAWNATTR_INIT=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_INIT])
- GNULIB_POSIX_SPAWNATTR_GETFLAGS=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETFLAGS])
- GNULIB_POSIX_SPAWNATTR_SETFLAGS=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETFLAGS])
- GNULIB_POSIX_SPAWNATTR_GETPGROUP=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETPGROUP])
- GNULIB_POSIX_SPAWNATTR_SETPGROUP=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETPGROUP])
- GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM])
- GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM])
- GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY])
- GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY])
- GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT])
- GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT])
- GNULIB_POSIX_SPAWNATTR_GETSIGMASK=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSIGMASK])
- GNULIB_POSIX_SPAWNATTR_SETSIGMASK=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSIGMASK])
- GNULIB_POSIX_SPAWNATTR_DESTROY=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_DESTROY])
+ GNULIB_POSIX_SPAWN=0; AC_SUBST([GNULIB_POSIX_SPAWN])
+ GNULIB_POSIX_SPAWNP=0; AC_SUBST([GNULIB_POSIX_SPAWNP])
+ GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT])
+ GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR])
+ GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE])
+ GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2])
+ GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR])
+ GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN])
+ GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY])
+ GNULIB_POSIX_SPAWNATTR_INIT=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_INIT])
+ GNULIB_POSIX_SPAWNATTR_GETFLAGS=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETFLAGS])
+ GNULIB_POSIX_SPAWNATTR_SETFLAGS=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETFLAGS])
+ GNULIB_POSIX_SPAWNATTR_GETPGROUP=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETPGROUP])
+ GNULIB_POSIX_SPAWNATTR_SETPGROUP=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETPGROUP])
+ GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM])
+ GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM])
+ GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY])
+ GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY])
+ GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT])
+ GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT])
+ GNULIB_POSIX_SPAWNATTR_GETSIGMASK=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSIGMASK])
+ GNULIB_POSIX_SPAWNATTR_SETSIGMASK=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSIGMASK])
+ GNULIB_POSIX_SPAWNATTR_DESTROY=0; AC_SUBST([GNULIB_POSIX_SPAWNATTR_DESTROY])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_POSIX_SPAWN=1; AC_SUBST([HAVE_POSIX_SPAWN])
HAVE_POSIX_SPAWNATTR_T=1; AC_SUBST([HAVE_POSIX_SPAWNATTR_T])
AC_SUBST([HAVE_POSIX_SPAWN_FILE_ACTIONS_T])
HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=1;
AC_SUBST([HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR])
+ HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR=1;
+ AC_SUBST([HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR])
REPLACE_POSIX_SPAWN=0; AC_SUBST([REPLACE_POSIX_SPAWN])
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=0;
AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR])
AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE])
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0;
AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2])
+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR=0;
+ AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR])
REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0;
AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN])
])
--- /dev/null
+Description:
+posix_spawn_file_actions_addfchdir() function: augment a child process actions
+specification.
+
+Files:
+lib/spawn_faction_addfchdir.c
+lib/spawn_int.h
+m4/posix_spawn_faction_addfchdir.m4
+
+Depends-on:
+spawn
+posix_spawn_file_actions_init [test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1 || test $HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = 1]
+
+configure.ac:
+gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR
+if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1 || test $HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = 1; then
+ AC_LIBOBJ([spawn_faction_addfchdir])
+fi
+gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_addfchdir])
+
+Makefile.am:
+
+Include:
+<spawn.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all
-e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)/g' \
-e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)/g' \
-e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)/g' \
+ -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR)/g' \
-e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)/g' \
-e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY)/g' \
-e 's/@''GNULIB_POSIX_SPAWNATTR_INIT''@/$(GNULIB_POSIX_SPAWNATTR_INIT)/g' \
-e 's|@''HAVE_POSIX_SPAWNATTR_T''@|$(HAVE_POSIX_SPAWNATTR_T)|g' \
-e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_T''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_T)|g' \
-e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)|g' \
+ -e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR)|g' \
-e 's|@''REPLACE_POSIX_SPAWN''@|$(REPLACE_POSIX_SPAWN)|g' \
-e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)|g' \
-e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)|g' \
-e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)|g' \
+ -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR)|g' \
-e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
(posix_spawn_file_actions_t *, const char *));
#endif
+#if GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR
+SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawn_file_actions_addfchdir, int,
+ (posix_spawn_file_actions_t *, int));
+#endif
+
int
main ()