darwin_libproc_sys/listpids.rs
1//! Flavors for proc_listpids()
2
3// Declared at `bsd/sys/proc_info.h`,
4// ex. http://fxr.watson.org/fxr/source/bsd/sys/proc_info.h?v=xnu-2050.18.24#L48
5/// Return all processes.
6pub const PROC_ALL_PIDS: u32 = 1;
7/// Return all processes in a given group.
8pub const PROC_PGRP_ONLY: u32 = 2;
9/// Return all processes attached to a given TTY.
10pub const PROC_TTY_ONLY: u32 = 3;
11/// Return all processes with the given UID.
12pub const PROC_UID_ONLY: u32 = 4;
13/// Return all processes with the given RUID.
14pub const PROC_RUID_ONLY: u32 = 5;
15/// Return all processes with the given PPID.
16pub const PROC_PPID_ONLY: u32 = 6;
17
18extern "C" {
19 pub fn proc_listpids(
20 r#type: u32,
21 typeinfo: u32,
22 buffer: *mut libc::c_void,
23 buffersize: libc::c_int,
24 ) -> libc::c_int;
25}