MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / describeLinuxProcess

Function describeLinuxProcess

src/mcp/process-identity.ts:91–102  ·  view source on GitHub ↗
(pid: number)

Source from the content-addressed store, hash-verified

89}
90
91function describeLinuxProcess(pid: number): ProcessDescription {
92 let commandLine: string | null = null;
93 let name: string | null = null;
94 try {
95 const args = fs.readFileSync(`/proc/${pid}/cmdline`, 'utf8').split('\0').filter(Boolean);
96 if (args.length > 0) commandLine = args.join(' ');
97 } catch { /* gone, or hidden (hidepid) */ }
98 try {
99 name = fs.readFileSync(`/proc/${pid}/comm`, 'utf8').trim() || null;
100 } catch { /* gone, or hidden */ }
101 return { name, commandLine };
102}
103
104async function describePsProcess(pid: number): Promise<ProcessDescription> {
105 const [args, comm] = await Promise.all([

Callers 1

describeProcessFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected