wait_for_exit.hpp
Go to the documentation of this file.
1 // Copyright (c) 2006, 2007 Julio M. Merino Vidal
2 // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
3 // Copyright (c) 2009 Boris Schaeling
4 // Copyright (c) 2010 Felipe Tanus, Boris Schaeling
5 // Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 
10 /**
11  * \file boost/process/wait_for_exit.hpp
12  *
13  * Defines a function to wait for a process to exit.
14  */
15 
16 #pragma once
17 
18 #include <boost/process/config.hpp>
19 
20 #include BOOST_PROCESS_PLATFORM_PROMOTE_PATH(wait_for_exit)
21 BOOST_PROCESS_PLATFORM_PROMOTE_NAMESPACE(wait_for_exit)
22 
23 #if defined(BOOST_PROCESS_DOXYGEN)
24 namespace boost::process
25 {
26 
27  /**
28  * Waits for a process to exit.
29  *
30  * On Window boost::process::wait_for_exit returns the exit code
31  * of the process. On POSIX the exit status is returned. You must
32  * use the macro \c WEXITSTATUS (defined in sys/wait.h) to fetch
33  * the exit code from the exit status.
34  *
35  * \note This is a blocking function.
36  *
37  * \throws boost::system::system_error in case of an error
38  */
39  template <class Process>
40  int_type wait_for_exit(const Process& p);
41 
42  /**
43  * Waits for a process to exit.
44  *
45  * On Window boost::process::wait_for_exit returns the exit code
46  * of the process. On POSIX the exit status is returned. You must
47  * use the macro \c WEXITSTATUS (defined in sys/wait.h) to fetch
48  * the exit code from the exit status.
49  *
50  * \note This is a blocking function.
51  */
52  template <class Process>
53  int_type wait_for_exit(const Process& p, boost::system::error_code& ec);
54 
55 }
56 #endif
57 
boost::process
Definition: mitigate.hpp:25
config.hpp
boost::process::windows::wait_for_exit
DWORD wait_for_exit(const Process &p, boost::system::error_code &ec)
Definition: wait_for_exit.hpp:37