MCPcopy Index your code
hub / github.com/callstack/agent-device / isProcessGroupAlive

Function isProcessGroupAlive

src/utils/process-identity.ts:21–29  ·  view source on GitHub ↗
(pid: number)

Source from the content-addressed store, hash-verified

19}
20
21export function isProcessGroupAlive(pid: number): boolean {
22 if (!Number.isInteger(pid) || pid <= 0) return false;
23 try {
24 process.kill(-pid, 0);
25 return true;
26 } catch (err) {
27 return (err as NodeJS.ErrnoException).code === 'EPERM';
28 }
29}
30
31export function readProcessStartTime(pid: number): string | null {
32 if (!Number.isInteger(pid) || pid <= 0) return null;

Callers 2

isRunnerProcessTreeAliveFunction · 0.90

Calls 1

killMethod · 0.45

Tested by

no test coverage detected