Der Prozessbaum unter (und einschliesslich) pid.
(pid)
| 44 | |
| 45 | /** Der Prozessbaum unter (und einschliesslich) pid. */ |
| 46 | async function processTree(pid) { |
| 47 | const seen = new Set(); |
| 48 | const queue = [pid]; |
| 49 | while (queue.length > 0) { |
| 50 | const current = queue.shift(); |
| 51 | if (seen.has(current)) { |
| 52 | continue; |
| 53 | } |
| 54 | seen.add(current); |
| 55 | for (const child of await childPids(current)) { |
| 56 | if (!seen.has(child)) { |
| 57 | queue.push(child); |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | return [...seen]; |
| 62 | } |
| 63 | |
| 64 | async function sockets(pids) { |
| 65 | if (pids.length === 0) { |