Commit b11e683
authored
Monitor process termination with kqueue instead of DispatchSource (#290)
On FreeBSD, Subprocess spawns children with pdfork(2). Per the man page such a child will not cause SIGCHLD on termination, which means DispatchSource does not work with processes spawned via pdfork.
Replace the DispatchSource implementation with a kqueue-based monitor shared by all kqueue platforms, mirroring the Linux epoll/pidfd backend. This change also allows us to completely remove the use of Dispatch from Subprocess.1 parent e163c1b commit b11e683
7 files changed
Lines changed: 386 additions & 61 deletions
File tree
- Sources/Subprocess
- IO
- Platforms
- Tests/SubprocessTests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 41 | | |
55 | 42 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | 43 | | |
84 | 44 | | |
85 | 45 | | |
| |||
0 commit comments