Sammelt den Prozessbaum unter (und einschliesslich) pid.
(pid)
| 81 | |
| 82 | /** Sammelt den Prozessbaum unter (und einschliesslich) pid. */ |
| 83 | async function processTree(pid) { |
| 84 | const seen = new Set(); |
| 85 | const queue = [pid]; |
| 86 | while (queue.length > 0) { |
| 87 | const current = queue.shift(); |
| 88 | if (seen.has(current)) { continue; } |
| 89 | seen.add(current); |
| 90 | for (const child of await childPids(current)) { |
| 91 | if (!seen.has(child)) { queue.push(child); } |
| 92 | } |
| 93 | } |
| 94 | return [...seen]; |
| 95 | } |
| 96 | |
| 97 | // ------------------------------------------------------------------ lsof --- |
| 98 |
no test coverage detected