mirror of
https://github.com/boostorg/process.git
synced 2026-01-19 04:22:15 +00:00
@@ -178,6 +178,8 @@ 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)
|
||||
@@ -186,6 +188,9 @@ std::vector<pid_type> child_pids(pid_type pid, error_code & ec)
|
||||
return {};
|
||||
}
|
||||
vec.resize(sz);
|
||||
#else
|
||||
BOOST_PROCESS_V2_ASSIGN_EC(ec, ENOTSUP, system_category());
|
||||
#endif
|
||||
return vec;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user