1 // Copyright (c) 2016 Klemens D. Morgenstern
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_
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>
14 /** \file boost/process/posix.hpp
16 * Header which provides the posix extensions.
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>;
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).
36 namespace boost { namespace process {
38 ///Namespace containing the posix exensions.
41 /** This property lets you modify file-descriptors other than the standard ones (0,1,2).
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).
46 * Close can also be called with a range of file-descriptors to be closed.
49 constexpr ::boost::process::detail::posix::fd_ fd;
51 /** This property lets you modify the handling of `SIGCHLD` for this call. It will be reset afterwards.
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:
61 \warning @ref spawn will automatically use `sig.ign()`, which will override if you pass a custom handler.
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.
68 constexpr ::boost::process::detail::posix::use_vfork_ use_vfork;
71 using ::boost::process::detail::posix::sighandler_t;
75 #endif /* BOOST_PROCESS_POSIX_HPP_ */