1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! Stop a process and everything it started (ADR-089). Killing only the
//! child would leave what it forked running, reparented; the agent cannot
//! go in a process group of its own, which would take it out of the
//! terminal's foreground group. So the tree is found in `/proc` by parent:
//! each process found is stopped (`SIGSTOP`) at once so it cannot fork past
//! the walk, the walk repeats until it finds no new one, then all are killed.
use Child;
use ;
/// Stop `child` and every process below it, then reap `child`.
/// Send `signal` to `pid`; one that is gone already is no error.
/// The processes whose parent is in `parents` and that are not in it.
/// The parent in a `/proc/<pid>/stat` line: the field after the state,
/// which follows the command name in parentheses (a name may hold spaces and
/// parentheses, so the last `)` ends it).