2
0
mirror of https://github.com/boostorg/process.git synced 2026-01-20 04:42:24 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Klemens Morgenstern
229faab9b1 added BOOST_PROCESS_V2_DISABLE_SIGNALSET option 2024-12-20 20:57:07 +08:00
Klemens Morgenstern
5e792f006c added BOOST_PROCESS_V2_PIPEFORK option 2024-12-20 20:57:07 +08:00
107 changed files with 240 additions and 485 deletions

View File

@@ -23,19 +23,19 @@ jobs:
include:
- { toolset: gcc-5, cxxstd: "11,14,1z", os: ubuntu-latest, container: 'ubuntu:18.04', install: g++-5 }
- { toolset: gcc-6, cxxstd: "11,14,1z", os: ubuntu-latest, container: 'ubuntu:18.04', install: g++-6 }
- { toolset: gcc-7, cxxstd: "11,14,17", os: ubuntu-latest, container: 'ubuntu:20.04', install: g++-7 }
- { toolset: gcc-7, cxxstd: "11,14,17", os: ubuntu-20.04, install: g++-7 }
- { toolset: gcc-10, cxxstd: "11,14,17,2a", os: ubuntu-22.04, install: g++-10 }
- { toolset: gcc-12, cxxstd: "11,14,17,20,2b", os: ubuntu-22.04, install: g++-12 }
- { toolset: clang, compiler: clang++-3.9, cxxstd: "11,14", os: ubuntu-latest, container: 'ubuntu:18.04', install: clang-3.9 }
- { toolset: clang, compiler: clang++-4.0, cxxstd: "11,14", os: ubuntu-latest, container: 'ubuntu:18.04', install: clang-4.0 }
- { toolset: clang, compiler: clang++-5.0, cxxstd: "11,14,1z", os: ubuntu-latest, container: 'ubuntu:18.04', install: clang-5.0 }
- { toolset: clang, compiler: clang++-6.0, cxxstd: "11,14,17", os: ubuntu-latest, container: 'ubuntu:20.04', install: clang-6.0 }
- { toolset: clang, compiler: clang++-7, cxxstd: "11,14,17", os: ubuntu-latest, container: 'ubuntu:20.04', install: clang-7 }
- { toolset: clang, compiler: clang++-8, cxxstd: "11,14,17", os: ubuntu-latest, container: 'ubuntu:20.04', install: clang-8 }
- { toolset: clang, compiler: clang++-9, cxxstd: "11,14,17,2a", os: ubuntu-latest, container: 'ubuntu:20.04', install: clang-9 }
- { toolset: clang, compiler: clang++-10, cxxstd: "11,14,17,2a", os: ubuntu-latest, container: 'ubuntu:20.04', install: clang-10 }
- { toolset: clang, compiler: clang++-11, cxxstd: "11,14,17,2a", os: ubuntu-22.04, install: clang-11 }
- { toolset: clang, compiler: clang++-12, cxxstd: "11,14,17,2a", os: ubuntu-22.04, install: clang-12 }
- { toolset: clang, compiler: clang++-6.0, cxxstd: "11,14,17", os: ubuntu-20.04, install: clang-6.0 }
- { toolset: clang, compiler: clang++-7, cxxstd: "11,14,17", os: ubuntu-20.04, install: clang-7 }
- { toolset: clang, compiler: clang++-8, cxxstd: "11,14,17", os: ubuntu-20.04, install: clang-8 }
- { toolset: clang, compiler: clang++-9, cxxstd: "11,14,17,2a", os: ubuntu-20.04, install: clang-9 }
- { toolset: clang, compiler: clang++-10, cxxstd: "11,14,17,2a", os: ubuntu-20.04, install: clang-10 }
- { toolset: clang, compiler: clang++-11, cxxstd: "11,14,17,2a", os: ubuntu-20.04, install: clang-11 }
- { toolset: clang, compiler: clang++-12, cxxstd: "11,14,17,2a", os: ubuntu-20.04, install: clang-12 }
- { toolset: clang, compiler: clang++-13, cxxstd: "11,14,17,20,2b", os: ubuntu-22.04, install: clang-13 }
- { toolset: clang, compiler: clang++-14, cxxstd: "11,14,17,20,2b", os: ubuntu-22.04, install: clang-14 }
- { toolset: clang, cxxstd: "11,14,17,2a", os: macos-13 }

View File

@@ -7,8 +7,6 @@ cmake_minimum_required(VERSION 3.5...3.16)
project(boost_process VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
option(BOOST_PROCESS_USE_STD_FS "Use std::filesystem instead of Boost.Filesystem" OFF)
add_library(boost_process
src/detail/environment_posix.cpp
src/detail/environment_win.cpp
@@ -37,6 +35,7 @@ target_link_libraries(boost_process
Boost::asio
Boost::config
Boost::core
Boost::filesystem
Boost::fusion
Boost::iterator
Boost::move
@@ -51,14 +50,13 @@ target_compile_definitions(boost_process
PRIVATE BOOST_PROCESS_SOURCE=1
)
if(BOOST_PROCESS_USE_STD_FS)
target_compile_definitions(boost_process PUBLIC BOOST_PROCESS_USE_STD_FS)
target_compile_features(boost_process PUBLIC cxx_std_17)
if (BOOST_PROCESS_USE_STD_FS)
target_compile_definitions(boost_process PUBLIC BOOST_PROCESS_USE_STD_FS=1 )
else()
target_link_libraries(boost_process PUBLIC Boost::filesystem)
endif()
if(WIN32)
if (WIN32)
target_link_libraries(boost_process PUBLIC ntdll shell32 advapi32 user32 ws2_32)
endif()

View File

@@ -8,6 +8,6 @@ A special thank you goes to [http://www.intra2net.com/(Intra2net AG) (especially
Great thanks also goes to Boris Schaeling, who despite having boost.process rejected, went on to work on it and maintained it up until this day and participated in the development of the current version.
Many Thanks, to [https://github.com/samuelvenable](Samuel Venable) for contributing the <<v2::ext>> functionality and all the research that went into it.
Many Thanks, to [https://github.com/time-killer-games](Samuel Venable) for contributing the <<v2::ext>> functionality and all the research that went into it.

View File

@@ -7,5 +7,5 @@ Boost process v2 can be configured in the following ways:
| Macro | Description
| `BOOST_PROCESS_V2_STANDALONE` | Build boost.process for standalone asio
| `BOOST_PROCESS_USE_STD_FS` | Use std::filesystem instead of boost::filesystem
| `BOOST_PROCESS_USE_STD_FS` | Use std::filesystem instead of boost::filsystem
| `BOOST_PROCESS_V2_POSIX_FORCE_DISABLE_CLOSE_RANGE` | Disable usage of `close_range`.

View File

@@ -9,7 +9,7 @@ template<typename Launcher, typename ... Init>
auto bind_launcher(Launcher && launcher, Init && ... init);
// Calls bind_launcher with the default_launcher as the first parameter.
// The new launcher with bound parameters
// The new launcher with bound paramaters
template<typename ... Init>
auto bind_default_launcher(Init && ... init);
----

View File

@@ -3,7 +3,7 @@
=== `environment`
The `environment` header provides facilities to manipulate the current environment and set it for new processes.
The `environment` header provides facilities to maniuplate the current environment and set it for new processes.
An environment is a a `range` of `T` fulfilling these requirements:
@@ -22,16 +22,16 @@ namespace environment
// A char traits type that reflects the OS rules for string representing environment keys.
/* Can be an alias of std::char_traits. May only be defined for `char` and `wchar_t`.
*
* Windows treats keys as case-insensitive yet preserving. The char traits are made to reflect
* Windows treats keys as case-insensitive yet perserving. The char traits are made to reflect
* that behaviour.
*/
template<typename Char>
tempalte<typename Char>
using key_char_traits = implementation_defined ;
// A char traits type that reflects the OS rules for string representing environment values.
/* Can be an alias of std::char_traits. May only be defined for `char` and `wchar_t`.
*/
template<typename Char>
tempalte<typename Char>
using value_char_traits = implementation_defined ;
// The character type used by the environment. Either `char` or `wchar_t`.

View File

@@ -2,7 +2,7 @@
[#process_handle]
A process handle is an unmanaged version of a process.
This means it does not terminate the process on destruction and
This means it does not terminate the proces on destruction and
will not keep track of the exit-code.
NOTE: that the exit code might be discovered early, during a call to `running`.

View File

@@ -16,7 +16,7 @@ automatically connected and the other side will get assigned to the child proces
include::../example/stdio.cpp[tag=readable_pipe]
----
readable pipes can be assigned to `out` and `err`, while writable_pipes can be assigned to `in`.
readable pipes can be assigned to `out` an `err`, while writable_pipes can be assigned to `in`.
== `FILE*`

View File

@@ -13,7 +13,7 @@ The major changes are
* separate compilation
* fd safe by default
Version 2 is now the default. In order to discourage usage of the deprecated v1, it's documentation has been removed.
Version 2 is now the defauled. In order to discourage usage of the deprecated v1, it's documentation has been removed.
== Simplified Interface
@@ -64,7 +64,7 @@ This concerns especially the `wait_for` and `wait_until` functions on the proces
The latter are easy to do on windows, but posix does not provide an API for this.
Thus the wait_for used signals or fork, which was all but safe.
Since process v2 is based on asio and thus supports cancellation,
a wait_for can now safely be implemented with an async_wait + timeout.
a wait_for can not safely be implemented with an async_wait + timeout.
== UTF-8

View File

@@ -1 +1 @@
#include <boost/process/v2/posix/bind_fd.hpp>
#include <boost/process/v2/bind_fd.hpp>

View File

@@ -1 +1 @@
#include <boost/process/v2/posix/default_launcher.hpp>
#include <boost/process/v2/default_launcher.hpp>

View File

@@ -1 +1 @@
#include <boost/process/v2/posix/fork_and_forget_launcher.hpp>
#include <boost/process/v2/fork_and_forget_launcher.hpp>

View File

@@ -1 +1 @@
#include <boost/process/v2/posix/pdfork_launcher.hpp>
#include <boost/process/v2/pdfork_launcher.hpp>

View File

@@ -1 +1 @@
#include <boost/process/v2/posix/vfork_launcher.hpp>
#include <boost/process/v2/vfork_launcher.hpp>

View File

@@ -114,7 +114,7 @@ io_context ios;
child c("ls", ios, on_exit=[](int exit, const std::error_code& ec_in){});
std::future<int> exit_code;
child c2("ls", ios, on_exit=exit_code);
chlid c2("ls", ios, on_exit=exit_code);
\endcode

View File

@@ -26,7 +26,7 @@ namespace boost { namespace process { BOOST_PROCESS_V1_INLINE namespace v1 {
#if defined(BOOST_PROCESS_DOXYGEN)
/** Class implementing an asynchronous I/O-Object for use with boost.asio.
/** Class implementing an asnychronous I/O-Object for use with boost.asio.
* It is based on the corresponding I/O Object, that is either boost::asio::windows::stream_handle or
* boost::asio::posix::stream_descriptor.
*

View File

@@ -39,7 +39,7 @@ child::child(Args&&...args)
typedef ::boost::process::v1::detail::api::pid_t pid_t;
#if defined(BOOST_PROCESS_DOXYGEN)
/** The main class to hold a child process. It is similar to [std::thread](http://en.cppreference.com/w/cpp/thread/thread),
/** The main class to hold a child process. It is simliar to [std::thread](http://en.cppreference.com/w/cpp/thread/thread),
* in that it has a join and detach function.
*
* @attention The destructor will call terminate on the process if not joined or detached without any warning.
@@ -128,7 +128,7 @@ class child
/** Same as valid, for convenience. */
explicit operator bool() const;
/** Check if the the child process is in any process group. */
/** Check if the the chlid process is in any process group. */
bool in_group() const;
/** \overload bool in_group() const */

View File

@@ -107,7 +107,7 @@ public:
using string_type = std::basic_string<char_type>;
using native_handle_type = char_type **;
void reload() {this->_env_impl = environ;}
void reload() {this->_env_impl = ::environ;}
string_type get(const pointer_type id) { return getenv(id); }
void set(const pointer_type id, const pointer_type value)
@@ -136,7 +136,7 @@ public:
native_environment_impl & operator=(native_environment_impl && ) = default;
native_handle_type _env_impl = environ;
native_handle_type native_handle() const {return environ;}
native_handle_type native_handle() const {return ::environ;}
};

View File

@@ -275,7 +275,7 @@ class executor
prepare_cmd_style_fn = exe;
if ((prepare_cmd_style_fn.find('/') == std::string::npos) && ::access(prepare_cmd_style_fn.c_str(), X_OK))
{
const auto * e = environ;
const auto * e = ::environ;
while ((e != nullptr) && (*e != nullptr) && !boost::starts_with(*e, "PATH="))
e++;
@@ -316,7 +316,7 @@ public:
const char * exe = nullptr;
char *const* cmd_line = nullptr;
bool cmd_style = false;
char **env = environ;
char **env = ::environ;
pid_t pid = -1;
std::shared_ptr<std::atomic<int>> exit_status = std::make_shared<std::atomic<int>>(still_active);

View File

@@ -31,8 +31,6 @@ inline std::string make_pipe_name()
static std::atomic_size_t cnt{0};
name += std::to_string(pid);
name += "_";
name += std::to_string(intptr_t(&cnt)); // to unclash Boost instances in plug-in DLLs
name += "_";
name += std::to_string(cnt++);
return name;
@@ -62,6 +60,8 @@ public:
async_pipe(boost::asio::io_context & ios_source, boost::asio::io_context & ios_sink, const std::string & name)
: async_pipe(ios_source, ios_sink, name, false) {}
inline async_pipe(const async_pipe& rhs);
async_pipe(async_pipe&& rhs) : _source(std::move(rhs._source)), _sink(std::move(rhs._sink))
{
@@ -153,6 +153,7 @@ public:
return _sink.write_some(buffers);
}
template<typename MutableBufferSequence>
std::size_t read_some(const MutableBufferSequence & buffers, boost::system::error_code & ec) noexcept
{
@@ -280,6 +281,7 @@ async_pipe::async_pipe(const async_pipe& p) :
_sink. assign(sink);
}
async_pipe::async_pipe(boost::asio::io_context & ios_source,
boost::asio::io_context & ios_sink,
const std::string & name, bool private_) : _source(ios_source), _sink(ios_sink)
@@ -296,6 +298,7 @@ async_pipe::async_pipe(boost::asio::io_context & ios_source,
| FILE_FLAG_OVERLAPPED_, //write flag
0, private_ ? 1 : ::boost::winapi::PIPE_UNLIMITED_INSTANCES_, 8192, 8192, 0, nullptr);
if (source == boost::winapi::INVALID_HANDLE_VALUE_)
::boost::process::v1::detail::throw_last_error("create_named_pipe(" + name + ") failed");

View File

@@ -222,7 +222,7 @@ basic_environment_impl<Char>::basic_environment_impl(const native_environment_im
while ((*p != null_char<Char>()) || (*(p+1) != null_char<Char>()))
p++;
p++; //pointing to the second nullchar
p++; //to get the pointer behind the second nullchar, so it's end.
p++; //to get the pointer behing the second nullchar, so it's end.
this->_data.assign(beg, p);
this->reload();

View File

@@ -627,7 +627,7 @@ public:
using base_type::operator=;
};
///Type definition to hold a separate environment.
///Type definition to hold a seperate environment.
template<typename Char>
class basic_environment : public basic_environment_impl<Char, detail::api::basic_environment_impl>
{
@@ -646,10 +646,10 @@ typedef basic_native_environment<char> native_environment;
typedef basic_native_environment<wchar_t> wnative_environment;
#if !defined(BOOST_NO_ANSI_APIS)
///Type definition to hold a separate environment.
///Type definition to hold a seperate environment.
typedef basic_environment<char> environment;
#endif
///Type definition to hold a separate environment.
///Type definition to hold a seperate environment.
typedef basic_environment<wchar_t> wenvironment;
}}
@@ -673,10 +673,10 @@ inline int get_id() { return ::boost::process::v1::detail::a
///Get the native handle of the current process.
inline native_handle_type native_handle() { return ::boost::process::v1::detail::api::native_handle();}
#if !defined(BOOST_NO_ANSI_APIS)
///Get the environment of the current process.
///Get the enviroment of the current process.
inline native_environment environment() { return ::boost::process::v1:: native_environment(); }
#endif
///Get the environment of the current process.
///Get the enviroment of the current process.
inline wnative_environment wenvironment() { return ::boost::process::v1::wnative_environment(); }
///Get the path environment variable of the current process runs.
inline std::vector<boost::process::v1::filesystem::path> path()

View File

@@ -124,7 +124,7 @@ struct handler
template <class Executor>
void on_setup(Executor&) const {}
/** This function is invoked if an error occurred while trying to launch the process.
/** This function is invoked if an error occured while trying to launch the process.
* \note It is not required to be const.
*/
template <class Executor>
@@ -136,7 +136,7 @@ struct handler
template <class Executor>
void on_success(Executor&) const {}
/**This function is invoked if an error occurred during the call of `fork`.
/**This function is invoked if an error occured during the call of `fork`.
* \note This function will only be called on posix.
*/
template<typename Executor>
@@ -249,7 +249,7 @@ struct posix_executor
///A pointer to the argument-vector.
char *const* cmd_line = nullptr;
///A pointer to the environment variables, as default it is set to [environ](http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html)
char **env = environ;
char **env = ::environ;
///The pid of the process - it will be -1 before invoking [fork](http://pubs.opengroup.org/onlinepubs/009695399/functions/fork.html), and after forking either 0 for the new process or a positive value if in the current process. */
pid_t pid = -1;
///This shared-pointer holds the exit code. It's done this way, so it can be shared between an `asio::io_context` and \ref child.
@@ -335,7 +335,7 @@ struct windows_executor
void set_startup_info_ex();
///This element is an instance or a reference (if \ref startup_info_ex exists) to the [startup-info](https://msdn.microsoft.com/en-us/library/windows/desktop/ms686331.aspx) for the process.
startup_info_t startup_info;
///This element is the instance of the [extended startup-info](https://msdn.microsoft.com/de-de/library/windows/desktop/ms686329.aspx). It is only available with a winapi-version equal or higher than 6.
///This element is the instance of the [extended startup-info](https://msdn.microsoft.com/de-de/library/windows/desktop/ms686329.aspx). It is only available with a winapi-version equal or highter than 6.
startup_info_ex_t startup_info_ex;
};

View File

@@ -78,9 +78,8 @@ inline std::locale default_locale()
std::locale global_loc = std::locale();
return std::locale(global_loc, new std::codecvt_utf8<wchar_t>);
# else // Other POSIX
// ISO C calls std::locale("") "the locale-specific native environment", and this
// locale is the default for many POSIX-based operating systems such as Linux.
return std::locale("");
// Return a default locale object.
return std::locale();
# endif
}

View File

@@ -14,13 +14,8 @@
#include <boost/process/v2/detail/config.hpp>
#include <boost/process/v2/cstring_ref.hpp>
#if defined(__APPLE__)
# include <crt_externs.h>
# if !defined(environ)
# define environ (*_NSGetEnviron())
# endif
#elif defined(__MACH__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun)
extern "C" { extern char **environ; }
#if defined(__APPLE__) || defined(__MACH__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun)
extern "C" { extern char **environ; }
#endif
BOOST_PROCESS_V2_BEGIN_NAMESPACE

View File

@@ -85,7 +85,7 @@ struct key_char_traits
if (s1 < s2)
return std::move(s2, s2 + n, s1);
else
return std::move_backward(s2, s2 + n, s1 + n);
return std::move_backward(s2, s2 + n, s1);
}
BOOST_CONSTEXPR static

View File

@@ -319,7 +319,7 @@ struct basic_process_handle_signal
}
template<typename Self>
void operator()(Self &&self, error_code ec, int /*sig*/)
void operator()(Self &&self, error_code ec, int sig)
{
if (ec == net::error::operation_aborted &&
self.get_cancellation_state().cancelled()

View File

@@ -40,16 +40,16 @@ namespace environment
/// A char traits type that reflects the OS rules for string representing environment keys.
/** Can be an alias of std::char_traits. May only be defined for `char` and `wchar_t`.
*
* Windows treats keys as case-insensitive yet preserving. The char traits are made to reflect
* Windows treats keys as case-insensitive yet perserving. The char traits are made to reflect
* that behaviour.
*/
template<typename Char>
tempalte<typename Char>
using key_char_traits = implementation_defined ;
/// A char traits type that reflects the OS rules for string representing environment values.
/** Can be an alias of std::char_traits. May only be defined for `char` and `wchar_t`.
*/
template<typename Char>
tempalte<typename Char>
using value_char_traits = implementation_defined ;
/// The character type used by the environment. Either `char` or `wchar_t`.
@@ -1372,8 +1372,6 @@ struct current_view
environment::native_iterator iterator_;
};
using const_iterator = iterator;
iterator begin() const {return iterator(handle_.get());}
iterator end() const {return iterator(detail::find_end(handle_.get()));}

View File

@@ -26,17 +26,11 @@
#endif
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#if defined(__APPLE__)
# include <crt_externs.h>
# if !defined(environ)
# define environ (*_NSGetEnviron())
# endif
#elif defined(__MACH__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun)
extern "C" { extern char **environ; }
#if defined(__APPLE__) || defined(__MACH__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun)
extern "C" { extern char **environ; }
#endif
BOOST_PROCESS_V2_BEGIN_NAMESPACE
@@ -102,7 +96,7 @@ template<typename Launcher, typename Init>
inline auto invoke_on_error(Launcher & launcher, const filesystem::path &executable,
const char * const * (&cmd_line),
const error_code & ec, Init && init, derived && )
-> decltype(init.on_error(launcher, executable, cmd_line, ec))
-> decltype(init.on_error(launcher, ec, executable, cmd_line, ec))
{
init.on_error(launcher, executable, cmd_line, ec);
}
@@ -166,7 +160,7 @@ template<typename Launcher, typename Init>
inline auto invoke_on_fork_error(Launcher & launcher, const filesystem::path &executable,
const char * const * (&cmd_line),
const error_code & ec, Init && init, derived && )
-> decltype(init.on_fork_error(launcher, executable, cmd_line, ec))
-> decltype(init.on_fork_error(launcher, ec, executable, cmd_line, ec))
{
init.on_fork_error(launcher, executable, cmd_line, ec);
}
@@ -188,6 +182,41 @@ inline void on_fork_error(Launcher & launcher, const filesystem::path &executabl
on_fork_error(launcher, executable, cmd_line, ec, inits...);
}
template<typename Launcher, typename Init>
inline void invoke_on_fork_success(Launcher & /*launcher*/, const filesystem::path &/*executable*/,
const char * const * (&/*cmd_line*/),
Init && /*init*/, base && )
{
}
template<typename Launcher, typename Init>
inline auto invoke_on_fork_success(Launcher & launcher, const filesystem::path &executable,
const char * const * (&cmd_line),
Init && init, derived && )
-> decltype(init.on_fork_success(launcher, executable, cmd_line))
{
init.on_fork_success(launcher, executable, cmd_line);
}
template<typename Launcher>
inline void on_fork_success(Launcher & /*launcher*/, const filesystem::path &/*executable*/,
const char * const * (&/*cmd_line*/))
{
}
template<typename Launcher, typename Init1, typename ... Inits>
inline void on_fork_success(Launcher & launcher, const filesystem::path &executable,
const char * const * (&cmd_line),
Init1 && init1, Inits && ... inits)
{
invoke_on_fork_success(launcher, executable, cmd_line, init1, derived{});
on_fork_success(launcher, executable, cmd_line, inits...);
}
template<typename Launcher, typename Init>
inline error_code invoke_on_exec_setup(Launcher & /*launcher*/, const filesystem::path &/*executable*/,
const char * const * (&/*cmd_line*/),
@@ -237,7 +266,7 @@ template<typename Launcher, typename Init>
inline auto invoke_on_exec_error(Launcher & launcher, const filesystem::path &executable,
const char * const * (&cmd_line),
const error_code & ec, Init && init, derived && )
-> decltype(init.on_exec_error(launcher, executable, cmd_line, ec))
-> decltype(init.on_exec_error(launcher, ec, executable, cmd_line, ec))
{
init.on_exec_error(launcher, executable, cmd_line, ec);
}
@@ -264,7 +293,7 @@ inline void on_exec_error(Launcher & launcher, const filesystem::path &executabl
struct default_launcher
{
/// The pointer to the environment forwarded to the subprocess.
const char * const * env = environ;
const char * const * env = ::environ;
/// The pid of the subprocess - will be assigned after fork.
int pid = -1;
@@ -411,7 +440,6 @@ struct default_launcher
if (ec)
{
detail::on_error(*this, executable, argv, ec, inits...);
do { ::waitpid(pid, nullptr, 0); } while (errno == EINTR);
return basic_process<Executor>{exec};
}
}

View File

@@ -124,7 +124,6 @@ struct fork_and_forget_launcher : default_launcher
if (ec)
{
detail::on_error(*this, executable, argv, ec, inits...);
do { ::waitpid(pid, nullptr, 0); } while (errno == EINTR);
return basic_process<Executor>{exec};
}
}

View File

@@ -161,7 +161,6 @@ struct pdfork_launcher : default_launcher
if (ec)
{
detail::on_error(*this, executable, argv, ec, inits...);
do { ::waitpid(pid, nullptr, 0); } while (errno == EINTR);
return basic_process<Executor>{exec};
}
}

View File

@@ -121,7 +121,6 @@ struct vfork_launcher : default_launcher
if (ec)
{
detail::on_error(*this, executable, argv, ec, inits...);
do { ::waitpid(pid, nullptr, 0); } while (errno == EINTR);
return basic_process<Executor>{exec};
}

View File

@@ -231,7 +231,7 @@ struct basic_process
void resume()
{
error_code ec;
resume(ec);
suspend(ec);
if (ec)
detail::throw_error(ec, "resume");
}
@@ -355,7 +355,8 @@ private:
}
};
net::post(handle.get_executor(), completer{static_cast<int>(res), std::move(self)});
net::post(handle.get_executor(),
completer{static_cast<int>(res), std::move(self)});
}
else
handle.async_wait(std::move(self));
@@ -370,10 +371,7 @@ private:
{
if (!ec)
res = code;
else if (ec == boost::system::errc::no_child_process)
std::move(self).complete({}, evaluate_exit_code(res));
else
std::move(self).complete(ec, evaluate_exit_code(code));
std::move(self).complete(ec, evaluate_exit_code(code));
}
}
};

View File

@@ -26,7 +26,7 @@ BOOST_PROCESS_V2_BEGIN_NAMESPACE
#if defined(GENERATING_DOCUMENTATION)
/** A process handle is an unmanaged version of a process.
* This means it does not terminate the process on destruction and
* This means it does not terminate the proces on destruction and
* will not keep track of the exit-code.
*
* Note that the exit code might be discovered early, during a call to `running`.

View File

@@ -31,33 +31,8 @@
#endif
BOOST_PROCESS_V2_BEGIN_NAMESPACE
template<typename T>
struct is_readable_pipe : std::false_type
{
};
template<typename Executor>
struct is_readable_pipe<asio::basic_readable_pipe<Executor>> : std::true_type
{
};
template<typename T>
struct is_writable_pipe : std::false_type
{
};
template<typename Executor>
struct is_writable_pipe<asio::basic_writable_pipe<Executor>> : std::true_type
{
};
namespace detail
{
#if defined(BOOST_PROCESS_V2_WINDOWS)
struct handle_closer
@@ -129,10 +104,16 @@ struct process_io_binding
}
template<typename ReadablePipe>
process_io_binding(ReadablePipe & pipe,
typename std::enable_if<is_readable_pipe<ReadablePipe>::value && Target != STD_INPUT_HANDLE>::type * = nullptr)
template<typename Executor>
process_io_binding(net::basic_readable_pipe<Executor> & pipe)
{
if (Target == STD_INPUT_HANDLE)
{
auto h_ = pipe.native_handle();
h = std::unique_ptr<void, handle_closer>{h_, get_flags(h_)};
return ;
}
net::detail::native_pipe_handle p[2];
error_code ec;
net::detail::create_pipe(p, ec);
@@ -144,10 +125,15 @@ struct process_io_binding
}
template<typename WritablePipe>
process_io_binding(WritablePipe & pipe,
typename std::enable_if<is_writable_pipe<WritablePipe>::value && Target == STD_INPUT_HANDLE>::type * = nullptr)
template<typename Executor>
process_io_binding(net::basic_writable_pipe<Executor> & pipe)
{
if (Target != STD_INPUT_HANDLE)
{
auto h_ = pipe.native_handle();
h = std::unique_ptr<void, handle_closer>{h_, get_flags(h_)};
return ;
}
net::detail::native_pipe_handle p[2];
error_code ec;
net::detail::create_pipe(p, ec);
@@ -180,31 +166,6 @@ struct process_io_binding
}
process_io_binding() = default;
process_io_binding(const process_io_binding &) = delete;
process_io_binding & operator=(const process_io_binding &) = delete;
process_io_binding(process_io_binding && other) noexcept
: fd(other.fd), fd_needs_closing(other.fd), ec(other.ec)
{
other.fd = target;
other.fd_needs_closing = false;
other.ec = {};
}
process_io_binding & operator=(process_io_binding && other) noexcept
{
if (fd_needs_closing)
::close(fd);
fd = other.fd;
fd_needs_closing = other.fd_needs_closing;
ec = other.ec;
other.fd = target;
other.fd_needs_closing = false;
other.ec = {};
return *this;
}
template<typename Stream>
process_io_binding(Stream && str, decltype(std::declval<Stream>().native_handle()) * = nullptr)
@@ -221,10 +182,15 @@ struct process_io_binding
{
}
template<typename ReadablePipe>
process_io_binding(ReadablePipe & readable_pipe,
typename std::enable_if<is_readable_pipe<ReadablePipe>::value && Target != STDIN_FILENO>::type * = nullptr)
template<typename Executor>
process_io_binding(net::basic_readable_pipe<Executor> & readable_pipe)
{
if (Target == STDIN_FILENO)
{
fd = readable_pipe.native_handle();
return ;
}
net::detail::native_pipe_handle p[2];
net::detail::create_pipe(p, ec);
if (ec)
@@ -241,10 +207,15 @@ struct process_io_binding
}
template<typename WritablePipe>
process_io_binding(WritablePipe & writable_pipe,
typename std::enable_if<is_writable_pipe<WritablePipe>::value && Target == STDIN_FILENO>::type * = nullptr)
template<typename Executor>
process_io_binding(net::basic_writable_pipe<Executor> & writable_pipe)
{
if (Target != STDIN_FILENO)
{
fd = writable_pipe.native_handle();
return ;
}
net::detail::native_pipe_handle p[2];
error_code ec;
net::detail::create_pipe(p, ec);
@@ -267,7 +238,7 @@ struct process_io_binding
return ec;
}
error_code on_exec_setup(posix::default_launcher &,
error_code on_exec_setup(posix::default_launcher & launcher,
const filesystem::path &, const char * const *)
{
if (::dup2(fd, target) == -1)

View File

@@ -97,7 +97,7 @@ inline void invoke_on_error(Launcher & /*launcher*/, const filesystem::path &/*e
template<typename Launcher, typename Init>
inline auto invoke_on_error(Launcher & launcher, const filesystem::path &executable, std::wstring &cmd_line,
const error_code & ec, Init && init, derived && )
-> decltype(init.on_error(launcher, executable, cmd_line, ec))
-> decltype(init.on_error(launcher, ec, executable, cmd_line, ec))
{
init.on_error(launcher, executable, cmd_line, ec);
}
@@ -109,7 +109,7 @@ inline std::false_type probe_on_error(
template<typename Launcher, typename Init>
inline auto probe_on_error(Launcher & launcher, Init && init, derived && )
-> std::is_same<error_code, decltype(init.on_error(launcher, std::declval<const filesystem::path &>(), std::declval<std::wstring &>(), std::declval<error_code&>()))>;
-> std::is_same<error_code, decltype(init.on_error(launcher, std::declval<const filesystem::path &>(), std::declval<std::wstring &>(), std::declval<std::error_code&>()))>;
template<typename Launcher, typename Init>
using has_on_error = decltype(probe_on_error(std::declval<Launcher&>(), std::declval<Init>(), derived{}));

View File

@@ -10,7 +10,7 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=doc/html/index.html">
<meta http-equiv="refresh" content="0; url=../../doc/html/process.html">
<title>Boost.Process</title>
<style>
body {
@@ -26,7 +26,7 @@
<body>
<p>
Automatic redirection failed, please go to
<a href="doc/html/index.html">doc/html/index.html</a>
<a href="../../doc/html/process.html">../../doc/html/process.html</a>
</p>
<p>
&copy; 2016 Klemens D. Morgenstern

View File

@@ -51,7 +51,7 @@ void unset(basic_cstring_ref<char_type, key_char_traits<char_type>> key, error_c
}
native_handle_type load_native_handle() { return environ; }
native_handle_type load_native_handle() { return ::environ; }
native_iterator next(native_iterator nh)

View File

@@ -54,8 +54,6 @@ std::size_t size_as_utf8(const wchar_t * in, std::size_t size, error_code & ec)
std::size_t size_as_wide(const char * in, std::size_t size, error_code & ec)
{
if (size == 0u)
return 0u;
auto res = ::MultiByteToWideChar(
CP_UTF8, // CodePage
0, // dwFlags
@@ -90,8 +88,6 @@ std::size_t convert_to_utf8(const wchar_t *in, std::size_t size, char * out,
std::size_t convert_to_wide(const char *in, std::size_t size, wchar_t * out,
std::size_t max_size, error_code & ec)
{
if (size == 0u)
return 0u;
auto res = ::MultiByteToWideChar(
CP_UTF8, // CodePage
0, // dwFlags
@@ -214,8 +210,10 @@ std::size_t size_as_wide(const char * in, std::size_t size, error_code &)
const auto from = in;
const auto from_end = from + size;
const char * from_next = from;
std::size_t char_count = 0u;
while (from_next < from_end)
{
++char_count;
unsigned int octet_count = get_octet_count(*from_next);
// The buffer may represent incomplete characters, so terminate early if one is found
if (octet_count > static_cast<std::size_t>(from_end - from_next))

View File

@@ -100,7 +100,7 @@ struct exit_code_category final : public error_category
# if defined(SIGILL)
case SIGILL: return "SIGILL: Illegal Instruction";
# endif
# if defined(SIGINFO) && SIGINFO != SIGPWR
# if defined(SIGINFO)
case SIGINFO: return "SIGINFO: A synonym for SIGPWR";
# endif
# if defined(SIGINT)

View File

@@ -31,7 +31,7 @@
#endif
#endif
#if (defined(__linux__) || defined(__ANDROID__) || defined(__gnu_hurd__))
#if (defined(__linux__) || defined(__ANDROID__))
#include <cstdio>
#endif
@@ -211,7 +211,7 @@ shell cmd(boost::process::v2::pid_type pid, error_code & ec)
return make_cmd_shell_::make(std::move(procargs), argc, argv.release(), fr_func);
}
#elif (defined(__linux__) || defined(__ANDROID__) || defined(__gnu_hurd__))
#elif (defined(__linux__) || defined(__ANDROID__))
shell cmd(boost::process::v2::pid_type pid, error_code & ec)
{
@@ -403,10 +403,10 @@ shell cmd(boost::process::v2::pid_type pid, error_code & ec)
}
#else
shell cmd(boost::process::v2::pid_type, error_code & ec)
filesystem::path cmd(boost::process::v2::pid_type, error_code & ec)
{
BOOST_PROCESS_V2_ASSIGN_EC(ec, ENOTSUP, system_category());
return {};
return "";
}
#endif

View File

@@ -124,7 +124,7 @@ filesystem::path cwd(boost::process::v2::pid_type pid, error_code & ec)
filesystem::path("/proc") / std::to_string(pid) / "cwd", ec
);
#elif defined(__sun)
return filesystem::canonical(
return fileystem::canonical(
filesystem::path("/proc") / std::to_string(pid) / "path/cwd", ec
);
#endif

View File

@@ -246,7 +246,7 @@ env_view env(boost::process::v2::pid_type pid, error_code & ec)
return {};
}
#elif (defined(__APPLE__) && defined(__MACH__)) && !TARGET_OS_IOS
#elif (defined(__APPLE___) || defined(__MACH__)) && !TARGET_OS_IOS
env_view env(boost::process::v2::pid_type pid, error_code & ec)
{
@@ -309,7 +309,7 @@ env_view env(boost::process::v2::pid_type pid, error_code & ec)
return ev;
}
#elif (defined(__linux__) || defined(__ANDROID__)) || defined(__gnu_hurd__)
#elif (defined(__linux__) || defined(__ANDROID__))
env_view env(boost::process::v2::pid_type pid, error_code & ec)
{

View File

@@ -141,7 +141,7 @@ filesystem::path exe(boost::process::v2::pid_type pid, error_code & ec)
filesystem::path("/proc") / std::to_string(pid) / "exe", ec
);
#elif defined(__sun)
return filesystem::canonical(
return fileystem::canonical(
filesystem::path("/proc") / std::to_string(pid) / "path/a.out", ec
);
#endif

View File

@@ -178,7 +178,6 @@ pid_type parent_pid(pid_type pid, error_code & ec)
std::vector<pid_type> child_pids(pid_type pid, error_code & ec)
{
std::vector<pid_type> vec;
#if defined(PROC_PPID_ONLY)
vec.resize(proc_listpids(PROC_PPID_ONLY, (uint32_t)pid, nullptr, 0) / sizeof(pid_type));
const auto sz = proc_listpids(PROC_PPID_ONLY, (uint32_t)pid, &vec[0], sizeof(pid_type) * vec.size());
if (sz < 0)
@@ -187,16 +186,6 @@ std::vector<pid_type> child_pids(pid_type pid, error_code & ec)
return {};
}
vec.resize(sz);
#else
std::vector<pid_type> pids = all_pids(ec);
for (std::size_t i = 0; i < pids.size(); i++)
{
if (pid == parent_pid(pids[i], ec))
{
vec.push_back(pids[i]);
}
}
#endif
return vec;
}

View File

@@ -185,7 +185,7 @@ void close_all(const std::vector<int> & whitelist, error_code & ec)
return ;
}
auto dir_fd = dirfd(dir.get());
auto dir_fd = ::dirfd(dir.get());
if (dir_fd == -1)
{
ec = BOOST_PROCESS_V2_NAMESPACE::detail::get_last_error();

View File

@@ -21,7 +21,9 @@
#include <boost/algorithm/string/predicate.hpp>
namespace bp = boost::process::v1;
namespace bp = boost::process;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(args, *boost::unit_test::timeout(2))
{

View File

@@ -19,7 +19,7 @@
#include <boost/process/v1/error.hpp>
#include <boost/process/v1/child.hpp>
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(implicit_args_fs_path)

View File

@@ -3,34 +3,11 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#define BOOST_ASIO_NO_DEPRECATED 1
#include <boost/process/v1/args.hpp>
#include <boost/process/v1/async.hpp>
#include <boost/process/v1/async_pipe.hpp>
#include <boost/process/v1/async_system.hpp>
#include <boost/process/v1/child.hpp>
#include <boost/process/v1/cmd.hpp>
#include <boost/process/v1/env.hpp>
#include <boost/process/v1/environment.hpp>
#include <boost/process/v1/error.hpp>
#include <boost/process/v1/exception.hpp>
#include <boost/process/v1/exe.hpp>
#include <boost/process/v1/extend.hpp>
#include <boost/process/v1/filesystem.hpp>
#include <boost/process/v1/group.hpp>
#include <boost/process/v1/handles.hpp>
#include <boost/process/v1/io.hpp>
#include <boost/process/v1/locale.hpp>
#include <boost/process/v1/pipe.hpp>
#include <boost/process/v1/search_path.hpp>
#include <boost/process/v1/shell.hpp>
#include <boost/process/v1/spawn.hpp>
#include <boost/process/v1/start_dir.hpp>
#include <boost/process/v1/system.hpp>
#include <boost/process.hpp>
int main() {}
#if defined(BOOST_POSIX_API)
#include <boost/process/v1/posix.hpp>
#else
#include <boost/process/v1/windows.hpp>
#endif
#endif

View File

@@ -25,7 +25,7 @@
using namespace std;
namespace bp = boost::process::v1;
namespace bp = boost::process;
#if __APPLE__
auto abort_sig = signal(SIGALRM, +[](int){std::terminate();});

View File

@@ -29,7 +29,7 @@ BOOST_AUTO_TEST_SUITE( async );
using namespace std;
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(async_out_future, *boost::unit_test::timeout(2))
{
@@ -103,4 +103,4 @@ BOOST_AUTO_TEST_CASE(emtpy_out, *boost::unit_test::timeout(2))
BOOST_CHECK_EQUAL(fut.get(), "");
}
BOOST_AUTO_TEST_SUITE_END();
BOOST_AUTO_TEST_SUITE_END();

View File

@@ -20,7 +20,7 @@
#include <boost/asio/streambuf.hpp>
using namespace std;
namespace bp = boost::process::v1;
namespace bp = boost::process;
namespace asio = boost::asio;
BOOST_AUTO_TEST_SUITE( async );

View File

@@ -18,7 +18,7 @@
#include <boost/process/v1/async_system.hpp>
#include <system_error>
namespace bp = boost::process::v1;
namespace bp = boost::process;;
void fail_func()
{

View File

@@ -23,7 +23,7 @@
#include <vector>
#include <array>
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_SUITE( async );
BOOST_AUTO_TEST_CASE(future, *boost::unit_test::timeout(15))

View File

@@ -27,7 +27,7 @@
#include <array>
BOOST_AUTO_TEST_SUITE( async );
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(stackful, *boost::unit_test::timeout(15))
{
using boost::unit_test::framework::master_test_suite;

View File

@@ -26,7 +26,7 @@
#include <array>
BOOST_AUTO_TEST_SUITE( async );
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(stackful, *boost::unit_test::timeout(15))
{
using boost::unit_test::framework::master_test_suite;

View File

@@ -26,7 +26,7 @@
#include <array>
BOOST_AUTO_TEST_SUITE( async );
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(stackful_except, *boost::unit_test::timeout(15))
{
using boost::unit_test::framework::master_test_suite;

View File

@@ -25,7 +25,7 @@
#include <array>
BOOST_AUTO_TEST_SUITE( async );
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(stackless, *boost::unit_test::timeout(15))
{
using boost::unit_test::framework::master_test_suite;

View File

@@ -39,7 +39,7 @@ typedef boost::asio::posix::stream_descriptor pipe_end;
#endif
namespace fs = boost::process::v1::filesystem;
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_SUITE( bind_stderr );
BOOST_AUTO_TEST_CASE(sync_io, *boost::unit_test::timeout(2))

View File

@@ -43,7 +43,7 @@ typedef boost::asio::posix::stream_descriptor pipe_end;
namespace fs = boost::process::v1::filesystem;
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(sync_io, *boost::unit_test::timeout(10))
{

View File

@@ -22,7 +22,7 @@
#include <string>
#include <iostream>
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_SUITE( bind_stdin_stdout );
BOOST_AUTO_TEST_CASE(sync_io, *boost::unit_test::timeout(10))

View File

@@ -42,7 +42,7 @@ BOOST_AUTO_TEST_SUITE( bind_stdout );
namespace fs = boost::process::v1::filesystem;
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(sync_io, *boost::unit_test::timeout(5))
{

View File

@@ -34,7 +34,7 @@ typedef boost::asio::windows::stream_handle pipe_end;
typedef boost::asio::posix::stream_descriptor pipe_end;
#endif
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_SUITE( bind_stdout_stderr );

View File

@@ -22,7 +22,7 @@
# include <sys/wait.h>
#endif
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(close_stderr)

View File

@@ -22,7 +22,7 @@
# include <sys/wait.h>
#endif
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(close_stdin)
{

View File

@@ -22,7 +22,7 @@
# include <sys/wait.h>
#endif
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(close_stdout)
{

View File

@@ -26,7 +26,7 @@
#include <boost/system/error_code.hpp>
#include <cstdlib>
namespace bp = boost::process::v1;
namespace bp = boost::process;
namespace fs = boost::process::v1::filesystem;

View File

@@ -27,7 +27,7 @@
#include <stdlib.h>
#include <list>
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(inherit_env, *boost::unit_test::timeout(2))
{

View File

@@ -12,7 +12,7 @@
#include <boost/test/included/unit_test.hpp>
#include <boost/process/v1/environment.hpp>
namespace bp = boost::process::v1;
namespace bp = boost::process;
namespace std

View File

@@ -19,7 +19,7 @@
namespace bp = boost::process::v1;
namespace bp = boost::process;
struct err_set
{

View File

@@ -26,7 +26,7 @@ typedef boost::asio::windows::stream_handle pipe_end;
typedef boost::asio::posix::stream_descriptor pipe_end;
#endif
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(sync_wait, *boost::unit_test::timeout(10))
{

View File

@@ -17,7 +17,7 @@
#include <boost/process/v1/extend.hpp>
namespace bp = boost::process::v1;
namespace bp = boost::process;
struct run_exe

View File

@@ -29,7 +29,7 @@
#include <iostream>
#include <cstdlib>
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(group_test, *boost::unit_test::timeout(5))
{

View File

@@ -30,7 +30,7 @@
#include <iostream>
#include <cstdlib>
namespace bp = boost::process::v1;
namespace bp = boost::process;

View File

@@ -7,7 +7,9 @@
#define BOOST_TEST_IGNORE_SIGCHLD
#include <boost/test/included/unit_test.hpp>
#include <boost/process/v1/system.hpp>
#include <iostream>
#include <boost/process.hpp>
#include <boost/process/v1/handles.hpp>
#include <boost/process/v1/pipe.hpp>
#include <boost/process/v1/io.hpp>
@@ -30,7 +32,8 @@
#include <dirent.h>
#endif
namespace bp = boost::process::v1;
namespace fs = boost::process::v1::filesystem;
namespace bp = boost::process;
namespace bt = boost::this_process;
BOOST_AUTO_TEST_CASE(leak_test, *boost::unit_test::timeout(5))
@@ -107,7 +110,7 @@ BOOST_AUTO_TEST_CASE(leak_test, *boost::unit_test::timeout(5))
BOOST_CHECK(!bt::is_stream_handle(event_fd , ec)); BOOST_CHECK_MESSAGE(!ec, ec.message());
#endif
auto od = ::opendir(".");
int dir_fd = dirfd(od);
int dir_fd = ::dirfd(od);
BOOST_CHECK(!bt::is_stream_handle(dir_fd , ec)); BOOST_CHECK_MESSAGE(!ec, ec.message());
#endif

View File

@@ -4,32 +4,4 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/process/v1/args.hpp>
#include <boost/process/v1/async.hpp>
#include <boost/process/v1/async_pipe.hpp>
#include <boost/process/v1/async_system.hpp>
#include <boost/process/v1/child.hpp>
#include <boost/process/v1/cmd.hpp>
#include <boost/process/v1/env.hpp>
#include <boost/process/v1/environment.hpp>
#include <boost/process/v1/error.hpp>
#include <boost/process/v1/exception.hpp>
#include <boost/process/v1/exe.hpp>
#include <boost/process/v1/extend.hpp>
#include <boost/process/v1/filesystem.hpp>
#include <boost/process/v1/group.hpp>
#include <boost/process/v1/handles.hpp>
#include <boost/process/v1/io.hpp>
#include <boost/process/v1/locale.hpp>
#include <boost/process/v1/pipe.hpp>
#include <boost/process/v1/search_path.hpp>
#include <boost/process/v1/shell.hpp>
#include <boost/process/v1/spawn.hpp>
#include <boost/process/v1/start_dir.hpp>
#include <boost/process/v1/system.hpp>
#if defined(BOOST_POSIX_API)
#include <boost/process/v1/posix.hpp>
#else
#include <boost/process/v1/windows.hpp>
#endif
#include <boost/process.hpp>

View File

@@ -3,32 +3,4 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/process/v1/args.hpp>
#include <boost/process/v1/async.hpp>
#include <boost/process/v1/async_pipe.hpp>
#include <boost/process/v1/async_system.hpp>
#include <boost/process/v1/child.hpp>
#include <boost/process/v1/cmd.hpp>
#include <boost/process/v1/env.hpp>
#include <boost/process/v1/environment.hpp>
#include <boost/process/v1/error.hpp>
#include <boost/process/v1/exception.hpp>
#include <boost/process/v1/exe.hpp>
#include <boost/process/v1/extend.hpp>
#include <boost/process/v1/filesystem.hpp>
#include <boost/process/v1/group.hpp>
#include <boost/process/v1/handles.hpp>
#include <boost/process/v1/io.hpp>
#include <boost/process/v1/locale.hpp>
#include <boost/process/v1/pipe.hpp>
#include <boost/process/v1/search_path.hpp>
#include <boost/process/v1/shell.hpp>
#include <boost/process/v1/spawn.hpp>
#include <boost/process/v1/start_dir.hpp>
#include <boost/process/v1/system.hpp>
#if defined(BOOST_POSIX_API)
#include <boost/process/v1/posix.hpp>
#else
#include <boost/process/v1/windows.hpp>
#endif
#include <boost/process.hpp>

View File

@@ -6,30 +6,5 @@
#include <boost/system/api_config.hpp>
#if defined(BOOST_WINDOWS_API)
#define BOOST_NO_ANSI_APIS 1
#include <boost/process/v1/args.hpp>
#include <boost/process/v1/async.hpp>
#include <boost/process/v1/async_pipe.hpp>
#include <boost/process/v1/async_system.hpp>
#include <boost/process/v1/child.hpp>
#include <boost/process/v1/cmd.hpp>
#include <boost/process/v1/env.hpp>
#include <boost/process/v1/environment.hpp>
#include <boost/process/v1/error.hpp>
#include <boost/process/v1/exception.hpp>
#include <boost/process/v1/exe.hpp>
#include <boost/process/v1/extend.hpp>
#include <boost/process/v1/filesystem.hpp>
#include <boost/process/v1/group.hpp>
#include <boost/process/v1/handles.hpp>
#include <boost/process/v1/io.hpp>
#include <boost/process/v1/locale.hpp>
#include <boost/process/v1/pipe.hpp>
#include <boost/process/v1/search_path.hpp>
#include <boost/process/v1/shell.hpp>
#include <boost/process/v1/spawn.hpp>
#include <boost/process/v1/start_dir.hpp>
#include <boost/process/v1/system.hpp>
#include <boost/process/v1/windows.hpp>
#endif
int main() {}
#include <boost/process.hpp>

View File

@@ -10,8 +10,7 @@
#define BOOST_TEST_MAIN
#define BOOST_TEST_IGNORE_SIGCHLD
#include <boost/test/included/unit_test.hpp>
#include <boost/process/v1/async.hpp>
#include <boost/process/v1/child.hpp>
#include <boost/process.hpp>
#include <boost/asio.hpp>
#include <chrono>
#include <thread>
@@ -27,7 +26,7 @@ BOOST_AUTO_TEST_CASE(single_ios, *boost::unit_test::timeout(6))
return;
}
namespace bp = boost::process::v1;
namespace bp = boost::process;
boost::asio::io_context ios;
std::chrono::steady_clock::time_point p1, p2;

View File

@@ -10,8 +10,7 @@
#define BOOST_TEST_MAIN
#define BOOST_TEST_IGNORE_SIGCHLD
#include <boost/test/included/unit_test.hpp>
#include <boost/process/v1/async.hpp>
#include <boost/process/v1/child.hpp>
#include <boost/process.hpp>
#include <boost/asio.hpp>
#include <chrono>
#include <thread>
@@ -27,7 +26,7 @@ BOOST_AUTO_TEST_CASE(double_ios, *boost::unit_test::timeout(6))
return;
}
namespace bp = boost::process::v1;
namespace bp = boost::process;
boost::asio::io_context ios;
std::chrono::steady_clock::time_point p1, p2;

View File

@@ -10,8 +10,7 @@
#define BOOST_TEST_MAIN
#define BOOST_TEST_IGNORE_SIGCHLD
#include <boost/test/included/unit_test.hpp>
#include <boost/process/v1/async.hpp>
#include <boost/process/v1/child.hpp>
#include <boost/process.hpp>
#include <boost/asio.hpp>
#include <chrono>
#include <thread>
@@ -27,7 +26,7 @@ BOOST_AUTO_TEST_CASE(double_ios_threaded, *boost::unit_test::timeout(6))
return;
}
namespace bp = boost::process::v1;
namespace bp = boost::process;
boost::asio::io_context ios;
std::chrono::steady_clock::time_point p1, p2;

View File

@@ -14,7 +14,7 @@
#include <boost/process/v1/environment.hpp>
using namespace std;
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_SUITE( pipe_tests );

View File

@@ -29,7 +29,7 @@
BOOST_AUTO_TEST_SUITE( pipe_tests );
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(sync_io, *boost::unit_test::timeout(5))
{

View File

@@ -11,14 +11,10 @@
#define BOOST_TEST_IGNORE_SIGCHLD
#include <boost/test/included/unit_test.hpp>
#include <boost/process/v1/child.hpp>
#include <boost/process/v1/environment.hpp>
#include <boost/process/v1/filesystem.hpp>
#include <boost/process/v1/io.hpp>
#include <boost/process/v1/pipe.hpp>
#include <boost/process.hpp>
#include <boost/process/v1/posix.hpp>
#include <boost/process/v1/spawn.hpp>
#include <boost/process/v1/system.hpp>
#include <boost/process/v1/filesystem.hpp>
#if !defined(BOOST_PROCESS_USE_STD_FS)
#include <boost/filesystem/directory.hpp>
@@ -33,7 +29,7 @@
#include <errno.h>
namespace fs = boost::process::v1::filesystem;
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(bind_fd, *boost::unit_test::timeout(2))
{

View File

@@ -15,7 +15,7 @@
#include <boost/process/v1/error.hpp>
#include <boost/process/v1/child.hpp>
namespace bp = boost::process::v1;
namespace bp = boost::process;
int main(int argc, char* argv[])
{

View File

@@ -18,7 +18,7 @@
#include <boost/process/v1/error.hpp>
#include <boost/process/v1/child.hpp>
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(run_exe_success)

View File

@@ -13,7 +13,7 @@
#include <boost/process/v1/filesystem.hpp>
#include <string>
namespace bp = boost::process::v1;
namespace bp = boost::process;
namespace fs = boost::process::v1::filesystem;
BOOST_AUTO_TEST_CASE(search_path)

View File

@@ -22,7 +22,7 @@
#include <boost/process/v1/child.hpp>
#include <boost/process/v1/shell.hpp>
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(shell_simple, *boost::unit_test::timeout(5))

View File

@@ -13,7 +13,7 @@
#include <boost/process/v1/filesystem.hpp>
#include <system_error>
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(shell_set_on_error)
{

View File

@@ -39,7 +39,7 @@ typedef boost::asio::posix::stream_descriptor pipe_end;
#endif
namespace fs = boost::process::v1::filesystem;
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(sync_spawn, *boost::unit_test::timeout(5))
{

View File

@@ -35,7 +35,7 @@ typedef boost::asio::posix::stream_descriptor pipe_end;
#endif
namespace fs = boost::process::v1::filesystem;
namespace bp = boost::process::v1;
namespace bp = boost::process;
int main()
{

View File

@@ -10,19 +10,14 @@
#define BOOST_TEST_MAIN
#define BOOST_TEST_IGNORE_SIGCHLD
#include <boost/test/included/unit_test.hpp>
#include <boost/process.hpp>
#include <boost/system/error_code.hpp>
#include <boost/process/v1/args.hpp>
#include <boost/process/v1/child.hpp>
#include <boost/process/v1/exe.hpp>
#include <boost/process/v1/filesystem.hpp>
#include <boost/process/v1/io.hpp>
#include <boost/process/v1/pipe.hpp>
#include <boost/process/v1/start_dir.hpp>
#include <boost/algorithm/string/compare.hpp>
#include <string>
#include <iostream>
namespace bp = boost::process::v1;
namespace bp = boost::process;
struct test_dir

View File

@@ -2,9 +2,7 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/process/v1/child.hpp>
#include <boost/process/v1/io.hpp>
#include <boost/process/v1/group.hpp>
#include <boost/process.hpp>
#include <boost/program_options.hpp>
#include <vector>
@@ -22,7 +20,7 @@ int main(int argc, char *argv[])
{
using namespace std;
using namespace boost::program_options;
using namespace boost::process::v1;
using namespace boost::process;
bool launch_detached = false;
bool launch_attached = false;

View File

@@ -44,7 +44,7 @@ typedef boost::asio::posix::stream_descriptor pipe_end;
#endif
namespace fs = boost::process::v1::filesystem;
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(system_exit_code, *boost::unit_test::timeout(5))
{

View File

@@ -38,7 +38,7 @@
#include <cstdlib>
namespace fs = boost::process::v1::filesystem;
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(explicit_async_io, *boost::unit_test::timeout(2))
{

View File

@@ -20,7 +20,7 @@
#include <system_error>
#include <thread>
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_CASE(terminate_set_on_error, *boost::unit_test::timeout(5))
{

View File

@@ -9,11 +9,11 @@
#include <boost/core/lightweight_test.hpp>
#include <boost/process/v1/child.hpp>
#include <boost/process.hpp>
#include <boost/process/v1/cmd.hpp>
#include <system_error>
namespace bp = boost::process::v1;
namespace bp = boost::process;
int main(int argc, char* argv[])
{

View File

@@ -11,7 +11,7 @@
#define BOOST_TEST_IGNORE_SIGCHLD
#include <boost/test/included/unit_test.hpp>
#include <boost/process/v1.hpp>
#include <boost/process.hpp>
#include <boost/process/v1/posix.hpp>
#include <system_error>
@@ -21,7 +21,7 @@
#include <sys/wait.h>
#include <errno.h>
namespace bp = boost::process::v1;
namespace bp = boost::process;
#if defined(BOOST_POSIX_HAS_VFORK)

View File

@@ -22,7 +22,7 @@
# include <signal.h>
#endif
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_SUITE( wait_test );

View File

@@ -21,7 +21,7 @@
# include <signal.h>
#endif
namespace bp = boost::process::v1;
namespace bp = boost::process;
BOOST_AUTO_TEST_SUITE( wait_test);
BOOST_AUTO_TEST_CASE(wait_for)

Some files were not shown because too many files have changed in this diff Show More