import type { NativeProcessOwner } from "./deps.js"; /** Exec readiness of a spawned child. "unknown" fails closed: the caller * reports no owner rather than a possibly pre-exec one. */ export type ChildExecReadiness = "exec'd" | "unknown"; export interface ExecWaitOptions { readonly platform?: NodeJS.Platform; readonly readCmdline?: (pid: number) => string; readonly now?: () => number; readonly sleep?: (ms: number) => Promise; readonly budgetMs?: number; readonly pollMs?: number; } /** Wait until a spawned child has exec'd, Linux only. * * Cause: under Bun on Linux the `spawn` event can fire before the child has * called exec, so `/proc//exe` still names the parent's executable and * the start-time guard in `linuxOwner` cannot see the swap (exec does not * change the start time). The signal is `/proc//cmdline`: before exec * it equals the parent's `/proc/self/cmdline` (read once per wait), during * the swap it is briefly empty, and after exec it is the child's argv. This * assumes the child's argv never equals hcn's own argv (hcn never execs * itself with its own arguments). * * Bounded: stops after 2000 ms and reports "unknown", yielding to the event * loop between samples, never spinning. A read error (process gone) ends the * wait with "unknown" at once. * * On every non-Linux platform it returns "exec'd" at once. On macOS, Node * reports spawn only after exec and Bun spawns through posix_spawn, and * the interactive owner test has shown no pre-exec reading there. Issue * #191 holds the Linux measurements. */ export declare function waitForChildExec(pid: number, options?: ExecWaitOptions): Promise; /** Fresh kernel identity. Failure means unknown, never confirmed process absence. */ export declare function readNativeProcessOwner(pid: number): NativeProcessOwner | undefined; //# sourceMappingURL=process-identity.d.ts.map