mirror of
https://github.com/boostorg/process.git
synced 2026-01-21 05:02:16 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ca663c826 |
@@ -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> child_pids(pid_type pid, error_code & ec)
|
||||||
{
|
{
|
||||||
std::vector<pid_type> vec;
|
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));
|
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());
|
const auto sz = proc_listpids(PROC_PPID_ONLY, (uint32_t)pid, &vec[0], sizeof(pid_type) * vec.size());
|
||||||
if (sz < 0)
|
if (sz < 0)
|
||||||
@@ -186,6 +188,9 @@ std::vector<pid_type> child_pids(pid_type pid, error_code & ec)
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
vec.resize(sz);
|
vec.resize(sz);
|
||||||
|
#else
|
||||||
|
BOOST_PROCESS_V2_ASSIGN_EC(ec, ENOTSUP, system_category());
|
||||||
|
#endif
|
||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user