Skip to main content

run

Function run 

Source
pub fn run<T: Tracer>(
    tracer: &T,
    args: &[CString],
    env: &[CString],
) -> Result<i32>
Expand description

Fork and execute the target program, running tracer against the resulting child process.

This helper forks the current process. The child will exec the provided args/env and the parent will invoke the supplied tracer with the child’s PID.

§Arguments

  • tracer - The tracer implementation to use for binary inspection.
  • args - Command-line arguments for the binary to be inspected (the first element is the program path).
  • env - Environment variables for the child process.

§Errors

Returns Err if the fork fails or if the tracer returns an error while inspecting the child process.

§Returns

Returns Ok(status) where status is the numeric exit/status code produced by the tracer (typically 0 for success). On failure an Err is returned.