1 // Copyright (c) 2016 Klemens D. Morgenstern
2 //
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef BOOST_PROCESS_POSIX_HPP_
6 #define BOOST_PROCESS_POSIX_HPP_
7 
8 #include <boost/process/detail/posix/fd.hpp>
9 #include <boost/process/detail/posix/handler.hpp>
10 #include <boost/process/detail/posix/use_vfork.hpp>
11 #include <boost/process/detail/posix/signal.hpp>
12 
13 
14 /** \file boost/process/posix.hpp
15  *
16  *    Header which provides the posix extensions.
17 \xmlonly
18 <programlisting>
19 namespace boost {
20   namespace process {
21     namespace posix {
22       <emphasis>unspecified</emphasis> <globalname alt="boost::process::posix::fd">fd</globalname>;
23       <emphasis>unspecified</emphasis> <globalname alt="boost::process::posix::sig">sig</globalname>;
24       <emphasis>unspecified</emphasis> <globalname alt="boost::process::posix::use_vfork">use_vfork</globalname>;
25     }
26   }
27 }
28 </programlisting>
29  *  \endxmlonly
30  *   \warning Only available on posix. See the documentation of [fork](http://pubs.opengroup.org/onlinepubs/009695399/functions/fork.html),
31  *   [execve](http://pubs.opengroup.org/onlinepubs/009695399/functions/execve.html) and
32  *   [vfork](http://pubs.opengroup.org/onlinepubs/009695399/functions/vfork.html).
33  *
34  */
35 
36 namespace boost { namespace process {
37 
38 ///Namespace containing the posix exensions.
39 namespace posix {
40 
41 /** This property lets you modify file-descriptors other than the standard ones (0,1,2).
42  *
43  * It provides the functions `bind`, which implements [dup2](http://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html)
44  * and [close](http://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html).
45  *
46  * Close can also be called with a range of file-descriptors to be closed.
47  *
48  */
49 constexpr ::boost::process::detail::posix::fd_ fd;
50 
51 /** This property lets you modify the handling of `SIGCHLD` for this call. It will be reset afterwards.
52 
53 It can be set to default, by the expression `sig.dfl()`, set to ignore with `sig.ign()` or
54 assigned a custom handler. A custom handler must have the type `sighandler_t`and can be assigned with the following syntax:
55 
56 \code{.cpp}
57 sig = handler;
58 sig(handler);
59 \endcode
60 
61 \warning @ref spawn will automatically use `sig.ign()`, which will override if you pass a custom handler.
62  */
63 constexpr ::boost::process::detail::posix::sig_       sig;
64 /** This property will replace the usage of [fork](http://pubs.opengroup.org/onlinepubs/9699919799/functions/fork.html) by [vfork](http://pubs.opengroup.org/onlinepubs/009695399/functions/vfork.html).
65  \note `vfork` is no longer an official part of the posix standard.
66 
67  */
68 constexpr ::boost::process::detail::posix::use_vfork_ use_vfork;
69 
70 
71 using ::boost::process::detail::posix::sighandler_t;
72 
73 }}}
74 
75 #endif /* BOOST_PROCESS_POSIX_HPP_ */
76