#proc

bin+lib proc-ctl

A helper library for querying and manipulating processes

4 releases

0.2.1 May 3, 2023
0.2.0 May 2, 2023
0.1.1 May 2, 2023
0.1.0 May 2, 2023

MPL-2.0 license

16KB
316 lines

proc-ctl

A helper library for querying and manipulating processes.

Find what port a process is using

use proc_ctl::PortQuery;

let query = PortQuery::new()
    .tcp_only()
    .ip_v4_only()
    .process_id(55932) // Get a process ID from somewhere
    .expect_min_num_ports(1);

query.execute().unwrap();

Find the children of a given process

use proc_ctl::ProcQuery;

let query = ProcQuery::new()
        .process_id(55932) // Get a process ID from somewhere
        .expect_min_num_children(1);

query.children().unwrap();

Dependencies

~1–13MB
~132K SLoC