Skip to main content

read_process_cmdline

Function read_process_cmdline 

Source
pub fn read_process_cmdline(pid: u32) -> Result<String>
Expand description

Read the live command line of pid using the negotiated no-admin per-OS primitive for the LaunchedProcessTree scope.

Returns the command line as a UTF-8 (potentially lossy on Windows where the source is UTF-16) String, or an io::Error if the PID cannot be opened, has already exited, or the kernel rejected the query.

On platforms where the backend hasn’t shipped yet (TraceScope::LaunchedProcessTree cmdline backend for that OS is still Unavailable), returns ErrorKind::Unsupported with a reason that names the future slice. This lets downstream callers code against the stable surface today.