/** * Shared helpers for reading Linux `/proc//stat` process identity fields. * * The `comm` field (field 2, wrapped in parentheses) may itself contain spaces * and parentheses, so the only robust anchor is the *last* `)` in the stat * string. Field 22 (the process start time in clock ticks since boot) is the * 20th whitespace-separated token after that closing paren (index 19). Field 7 * (`tty_nr`) is the 5th token after the closing paren (index 4). */ export interface LinuxProcStatIdentity { state?: string; startTime: string; ttyDevice: string; } export type LinuxProcPidProbeResult = ({ kind: "live"; } & LinuxProcStatIdentity) | { kind: "absent"; } | { kind: "unverifiable"; reason: "unsupported_platform" | "invalid_pid" | "permission_denied" | "read_error" | "malformed_stat"; }; /** Parse field 22 (start time) from a `/proc//stat` record. */ export declare function parseLinuxProcStartTime(stat: string | null | undefined): string | null; /** Parse field 7 (`tty_nr`) from a `/proc//stat` record. */ export declare function parseLinuxProcTtyDevice(stat: string | null | undefined): string | null; /** Parse field 3 (single-letter process state) from a `/proc//stat` record. */ export declare function parseLinuxProcState(stat: string | null | undefined): string | null; export declare function probeLinuxProcPidSync(pid: number): LinuxProcPidProbeResult; export declare function probeLinuxProcPid(pid: number): Promise; /** * Read `/proc//stat` synchronously and return the parsed start time. * Returns `null` when the probe is absent or unverifiable. */ export declare function readLinuxProcStartTimeSync(pid: number): string | null; /** * Read `/proc//stat` asynchronously and return the parsed start time. * Returns `null` when the probe is absent or unverifiable. */ export declare function readLinuxProcStartTime(pid: number): Promise;