annotate doc/posix-functions/posix_spawn.texi @ 39828:8d755c31408d

posix_spawn_file_actions_addchdir: New module. Suggested by Eric Blake in <https://lists.gnu.org/archive/html/bug-findutils/2018-09/msg00007.html>. * lib/spawn.in.h (posix_spawn_file_actions_addchdir): New declaration. * lib/spawn_int.h (struct __spawn_action): Add tag 'spawn_do_chdir' and union member 'chdir_action'. * lib/spawn_faction_addchdir.c: New file. * lib/spawni.c (__spawni): Implement the spawn_do_chdir action. * lib/spawn_faction_addclose.c: Test REPLACE_POSIX_SPAWN instead of HAVE_WORKING_POSIX_SPAWN. * lib/spawn_faction_adddup2.c: Likewise. * lib/spawn_faction_addopen.c: Likewise. * m4/posix_spawn_faction_addchdir.m4: New file. * m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): Test whether module 'posix_spawn_file_actions_addchdir' is present and whether posix_spawn_file_actions_addchdir_np exists. Define REPLACE_POSIX_SPAWN instead of HAVE_WORKING_POSIX_SPAWN. * m4/spawn_h.m4 (gl_SPAWN_H): Test whether posix_spawn_file_actions_addchdir is declared. (gl_SPAWN_H_DEFAULTS): Initialize GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR, HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR, REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR. * modules/spawn (Makefile.am): Substitute GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR, HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR, REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR. * modules/posix_spawn_file_actions_addchdir: New file. * modules/posix_spawn_file_actions_addclose (Depends-on, configure.ac): Test also REPLACE_POSIX_SPAWN. * modules/posix_spawn_file_actions_adddup2 (Depends-on, configure.ac): Likewise. * modules/posix_spawn_file_actions_addopen (Depends-on, configure.ac): Likewise. * tests/test-spawn-c++.cc (posix_spawn_file_actions_addchdir): Check signature. * doc/posix-functions/posix_spawn.texi: Mention the new module. * doc/posix-functions/posix_spawnp.texi: Likewise.
author Bruno Haible <bruno@clisp.org>
date Fri, 07 Sep 2018 23:35:52 +0200
parents 0f6b0bb3cee9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 @node posix_spawn
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 @section @code{posix_spawn}
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 @findex posix_spawn
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
13549
bb0ceefd22dc avoid some overlong lines from posix urls, etc.
Karl Berry <karl@freefriends.org>
parents: 10876
diff changeset
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/posix_spawn.html}
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
10525
47d5b14c7a94 New module 'posix_spawn'.
Bruno Haible <bruno@clisp.org>
parents: 9638
diff changeset
7 Gnulib module: posix_spawn
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 Portability problems fixed by Gnulib:
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 @itemize
10525
47d5b14c7a94 New module 'posix_spawn'.
Bruno Haible <bruno@clisp.org>
parents: 9638
diff changeset
11 @item
47d5b14c7a94 New module 'posix_spawn'.
Bruno Haible <bruno@clisp.org>
parents: 9638
diff changeset
12 This function is missing on some platforms:
19650
0f6b0bb3cee9 doc: Add info about Android versions 2.0 to 8.1.
Bruno Haible <bruno@clisp.org>
parents: 19639
diff changeset
13 Mac OS X 10.4, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 8.1.
10563
f6167115b0de Avoid the broken posix_spawn function on AIX 5.3 and 6.1.
Bruno Haible <bruno@clisp.org>
parents: 10525
diff changeset
14 @item
f6167115b0de Avoid the broken posix_spawn function on AIX 5.3 and 6.1.
Bruno Haible <bruno@clisp.org>
parents: 10525
diff changeset
15 When this function fails, it causes the stdio buffer contents to be output
f6167115b0de Avoid the broken posix_spawn function on AIX 5.3 and 6.1.
Bruno Haible <bruno@clisp.org>
parents: 10525
diff changeset
16 twice on some platforms:
f6167115b0de Avoid the broken posix_spawn function on AIX 5.3 and 6.1.
Bruno Haible <bruno@clisp.org>
parents: 10525
diff changeset
17 AIX 6.1.
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 @end itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 Portability problems not fixed by Gnulib:
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 @itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 @item
10525
47d5b14c7a94 New module 'posix_spawn'.
Bruno Haible <bruno@clisp.org>
parents: 9638
diff changeset
23 This function does not work on some platforms:
10563
f6167115b0de Avoid the broken posix_spawn function on AIX 5.3 and 6.1.
Bruno Haible <bruno@clisp.org>
parents: 10525
diff changeset
24 AIX 6.1 (under particular circumstances), mingw.
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 @end itemize
39828
8d755c31408d posix_spawn_file_actions_addchdir: New module.
Bruno Haible <bruno@clisp.org>
parents: 19650
diff changeset
26
8d755c31408d posix_spawn_file_actions_addchdir: New module.
Bruno Haible <bruno@clisp.org>
parents: 19650
diff changeset
27 The Gnulib module @code{posix_spawn_file_actions_addchdir} provides an
8d755c31408d posix_spawn_file_actions_addchdir: New module.
Bruno Haible <bruno@clisp.org>
parents: 19650
diff changeset
28 additional action, that consists in changing the current directory of
8d755c31408d posix_spawn_file_actions_addchdir: New module.
Bruno Haible <bruno@clisp.org>
parents: 19650
diff changeset
29 the child process before starting the specified program.