Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Function get_handles

boost::this_process::get_handles

Synopsis

// In header: <boost/process/handles.hpp>


std::vector< native_handle_type > get_handles();
std::vector< native_handle_type > get_handles(std::error_code & ec);

Description

Get a snapshot of all handles of the process (i.e. file descriptors on posix and handles on windows) of the current process.

[Note] Note

This function might not work on certain posix systems.

[Note] Note

On Windows version older than windows 8 this function will iterate all the system handles, meaning it might be quite slow.

[Warning] Warning

This functionality is utterly prone to race conditions, since other threads might open or close handles.

Returns:

The list of all open handles of the current process


PrevUpHomeNext