1 /* Waiting for a subprocess to finish.
2 Copyright (C) 2001-2003 Free Software Foundation, Inc.
3 Written by Bruno Haible <haible@clisp.cons.org>, 2001.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
19 #ifndef _WAIT_PROCESS_H
20 #define _WAIT_PROCESS_H
27 #include <sys/types.h>
37 /* Wait for a subprocess to finish. Return its exit code.
38 If it didn't terminate correctly, exit if exit_on_error is true, otherwise
40 extern int wait_subprocess (pid_t child, const char *progname,
42 bool slave_process, bool exit_on_error);
44 /* Register a subprocess as being a slave process. This means that the
45 subprocess will be terminated when its creator receives a catchable fatal
46 signal or exits normally. Registration ends when wait_subprocess()
47 notices that the subprocess has exited. */
48 extern void register_slave_subprocess (pid_t child);
56 #endif /* _WAIT_PROCESS_H */