- On startup, insert all valid PIDs into a tree.
- In our main loop, whenever a process terminates, remove its PID from the tree.
- On exit, if the -p flag was specified, print the remaining PIDs.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 68045 Build 64928: arc lint + arc unit
Event Timeline
Comment Actions
Rather than using a separate rbtree, can you just make each kevent's udata field point to a structure containing the kevent, the PID, and some state indicating whether the process has already exited?
Comment Actions
The tree serves the additional purposes of deduplication (which was previously handled by linear search, making the initialization code quadratic in the numbers of processes watched) and stable ordering.