Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-09 08:25:04

0001 // Copyright (c) 2022 Klemens D. Morgenstern
0002 // Copyright (c) 2022 Samuel Venable
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 #ifndef BOOST_PROCESS_V2_CWD_HPP
0007 #define BOOST_PROCESS_V2_CWD_HPP
0008 
0009 #include <boost/process/v2/detail/config.hpp>
0010 
0011 #include <boost/process/v2/detail/throw_error.hpp>
0012 #include <boost/process/v2/pid.hpp>
0013 #include <boost/process/v2/process_handle.hpp>
0014 
0015 BOOST_PROCESS_V2_BEGIN_NAMESPACE
0016 
0017 namespace ext {
0018 
0019 #if defined(BOOST_PROCESS_V2_WINDOWS)
0020 BOOST_PROCESS_V2_DECL filesystem::path cwd(HANDLE handle, error_code & ec);
0021 BOOST_PROCESS_V2_DECL filesystem::path cwd(HANDLE handle);
0022 #endif
0023 
0024 /// @{
0025 /// Obtain the current path of another process
0026 BOOST_PROCESS_V2_DECL filesystem::path cwd(pid_type pid, error_code & ec);
0027 BOOST_PROCESS_V2_DECL filesystem::path cwd(pid_type pid);
0028 
0029 template<typename Executor>
0030 BOOST_PROCESS_V2_DECL filesystem::path cwd(basic_process_handle<Executor> & handle, error_code & ec)
0031 {
0032 #if defined(BOOST_PROCESS_V2_WINDOWS)
0033     return cwd(handle.native_handle(), ec);
0034 #else
0035     return cwd(handle.id(), ec);
0036 #endif
0037 }
0038 
0039 template<typename Executor>
0040 BOOST_PROCESS_V2_DECL filesystem::path cwd(basic_process_handle<Executor> & handle)
0041 {
0042 #if defined(BOOST_PROCESS_V2_WINDOWS)
0043     return cwd(handle.native_handle());
0044 #else
0045     return cwd(handle.id());
0046 #endif
0047 }
0048 
0049 /// @}
0050 
0051 } // namespace ext
0052 
0053 BOOST_PROCESS_V2_END_NAMESPACE
0054 
0055 #endif // BOOST_PROCESS_V2_CWD_HPP