annotate lib/wait-process.h @ 40231:9b3c79fdfe0b

strtod: fix clash with strtold Problem reported for RHEL 5 by Jesse Caldwell (Bug#34817). * lib/strtod.c (compute_minus_zero, minus_zero): Simplify by remving the macro / external variable, and having just a function. User changed. This avoids the need for an external variable that might clash.
author Paul Eggert <eggert@cs.ucla.edu>
date Mon, 11 Mar 2019 16:40:29 -0700
parents b06060465f09
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4802
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Waiting for a subprocess to finish.
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 19484
diff changeset
2 Copyright (C) 2001-2003, 2006, 2008-2019 Free Software Foundation, Inc.
4802
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 Written by Bruno Haible <haible@clisp.cons.org>, 2001.
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 6761
diff changeset
5 This program is free software: you can redistribute it and/or modify
4802
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 6761
diff changeset
7 the Free Software Foundation; either version 3 of the License, or
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 6761
diff changeset
8 (at your option) any later version.
4802
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 GNU General Public License for more details.
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
19190
9759915b2aca all: prefer https: URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 18626
diff changeset
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
4802
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 #ifndef _WAIT_PROCESS_H
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #define _WAIT_PROCESS_H
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 /* Get pid_t. */
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #include <stdlib.h>
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #include <unistd.h>
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 #include <sys/types.h>
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #include <stdbool.h>
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 #ifdef __cplusplus
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 extern "C" {
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 #endif
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 /* Wait for a subprocess to finish. Return its exit code.
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 If it didn't terminate correctly, exit if exit_on_error is true, otherwise
6761
14eb5491c867 * lib/wait-process.c, lib/wait-process.h, lib/csharpcomp.c,
Derek R. Price <derek@ximbiot.com>
parents: 6759
diff changeset
36 return 127.
4927
bc5f62830252 Update from gettext.
Bruno Haible <bruno@clisp.org>
parents: 4802
diff changeset
37 Arguments:
bc5f62830252 Update from gettext.
Bruno Haible <bruno@clisp.org>
parents: 4802
diff changeset
38 - child is the pid of the subprocess.
bc5f62830252 Update from gettext.
Bruno Haible <bruno@clisp.org>
parents: 4802
diff changeset
39 - progname is the name of the program executed by the subprocess, used for
bc5f62830252 Update from gettext.
Bruno Haible <bruno@clisp.org>
parents: 4802
diff changeset
40 error messages.
bc5f62830252 Update from gettext.
Bruno Haible <bruno@clisp.org>
parents: 4802
diff changeset
41 - If ignore_sigpipe is true, consider a subprocess termination due to
bc5f62830252 Update from gettext.
Bruno Haible <bruno@clisp.org>
parents: 4802
diff changeset
42 SIGPIPE as equivalent to a success. This is suitable for processes whose
bc5f62830252 Update from gettext.
Bruno Haible <bruno@clisp.org>
parents: 4802
diff changeset
43 only purpose is to write to standard output. This flag can be safely set
bc5f62830252 Update from gettext.
Bruno Haible <bruno@clisp.org>
parents: 4802
diff changeset
44 to false when the process' standard output is known to go to DEV_NULL.
bc5f62830252 Update from gettext.
Bruno Haible <bruno@clisp.org>
parents: 4802
diff changeset
45 - If null_stderr is true, the usual error message to stderr will be omitted.
bc5f62830252 Update from gettext.
Bruno Haible <bruno@clisp.org>
parents: 4802
diff changeset
46 This is suitable when the subprocess does not fulfill an important task.
bc5f62830252 Update from gettext.
Bruno Haible <bruno@clisp.org>
parents: 4802
diff changeset
47 - slave_process should be set to true if the process has been launched as a
bc5f62830252 Update from gettext.
Bruno Haible <bruno@clisp.org>
parents: 4802
diff changeset
48 slave process.
bc5f62830252 Update from gettext.
Bruno Haible <bruno@clisp.org>
parents: 4802
diff changeset
49 - If exit_on_error is true, any error will cause the main process to exit
10197
d079dd7b69bc Add termsigp argument to execute() and wait_process().
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
50 with an error status.
11248
04d6b677b5e4 Omit an error message that the caller can do better.
Bruno Haible <bruno@clisp.org>
parents: 11235
diff changeset
51 - If termsigp is not NULL: *termsig will be set to the signal that
10197
d079dd7b69bc Add termsigp argument to execute() and wait_process().
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
52 terminated the subprocess (if supported by the platform: not on native
11248
04d6b677b5e4 Omit an error message that the caller can do better.
Bruno Haible <bruno@clisp.org>
parents: 11235
diff changeset
53 Windows platforms), otherwise 0, and the error message about the signal
04d6b677b5e4 Omit an error message that the caller can do better.
Bruno Haible <bruno@clisp.org>
parents: 11235
diff changeset
54 that terminated the subprocess will be omitted.
11235
6d6cc28a5313 Clarify specification of wait_subprocess.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
55 Prerequisites: The signal handler for SIGCHLD should not be set to SIG_IGN,
6d6cc28a5313 Clarify specification of wait_subprocess.
Bruno Haible <bruno@clisp.org>
parents: 10197
diff changeset
56 otherwise this function will not work. */
4802
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 extern int wait_subprocess (pid_t child, const char *progname,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11248
diff changeset
58 bool ignore_sigpipe, bool null_stderr,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11248
diff changeset
59 bool slave_process, bool exit_on_error,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11248
diff changeset
60 int *termsigp);
4802
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 /* Register a subprocess as being a slave process. This means that the
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 subprocess will be terminated when its creator receives a catchable fatal
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 signal or exits normally. Registration ends when wait_subprocess()
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 notices that the subprocess has exited. */
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 extern void register_slave_subprocess (pid_t child);
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 #ifdef __cplusplus
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 }
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 #endif
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73
16d77b789c30 New module 'wait-process'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 #endif /* _WAIT_PROCESS_H */