Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:13

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_PID_HPP
0007 #define BOOST_PROCESS_V2_PID_HPP
0008 
0009 #include <boost/process/v2/detail/config.hpp>
0010 #include <boost/process/v2/detail/throw_error.hpp>
0011 
0012 BOOST_PROCESS_V2_BEGIN_NAMESPACE
0013 
0014 #if defined(GENERATING_DOCUMENTATION)
0015 
0016 //An integral type representing a process id.
0017 typedef implementation_defined pid_type;
0018 
0019 #else
0020 
0021 #if defined(BOOST_PROCESS_V2_WINDOWS)
0022 
0023 typedef unsigned long pid_type;
0024 
0025 #else
0026 
0027 typedef int pid_type;
0028 
0029 #endif
0030 #endif
0031 
0032 #if (defined(BOOST_PROCESS_V2_WINDOWS) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__sun))
0033 constexpr static pid_type root_pid = 0;
0034 #elif (defined(__APPLE__) && defined(__MACH__) || defined(__linux__) || defined(__ANDROID__) || defined(__OpenBSD__))
0035 constexpr static pid_type root_pid = 1;
0036 #endif
0037 
0038 /// Get the process id of the current process.
0039 BOOST_PROCESS_V2_DECL pid_type current_pid();
0040 
0041 /// List all available pids.
0042 BOOST_PROCESS_V2_DECL std::vector<pid_type> all_pids(boost::system::error_code & ec);
0043 
0044 /// List all available pids.
0045 BOOST_PROCESS_V2_DECL std::vector<pid_type> all_pids();
0046 
0047 // return parent pid of pid.
0048 BOOST_PROCESS_V2_DECL pid_type parent_pid(pid_type pid, boost::system::error_code & ec);
0049 
0050 // return parent pid of pid.
0051 BOOST_PROCESS_V2_DECL pid_type parent_pid(pid_type pid);
0052 
0053 // return child pids of pid.
0054 BOOST_PROCESS_V2_DECL std::vector<pid_type> child_pids(pid_type pid, boost::system::error_code & ec);
0055 
0056 // return child pids of pid.
0057 BOOST_PROCESS_V2_DECL std::vector<pid_type> child_pids(pid_type pid);
0058 
0059 BOOST_PROCESS_V2_END_NAMESPACE
0060 
0061 #if defined(BOOST_PROCESS_V2_HEADER_ONLY)
0062 #include <boost/process/v2/impl/pid.ipp>
0063 #endif
0064 
0065 #endif // BOOST_PROCESS_V2_PID_HPP
0066