4 ms·
This is actually a well known technique, often called the self-pipe trick. There’s a good overview in the following SO answer from Rich Felker, muslc’s author:
by grodriguez100 1y ago
This is actually a well known technique, often called the self-pipe trick. There’s a good overview in the following SO answer from Rich Felker, muslc’s author:
https://stackoverflow.com/questions/3703013/what-can-cause-exec-to-fail-what-happens-next/3703179#3703179 https://stackoverflow.com/questions/3703013/what-can-cause-e...
- listeria 1y agoThe technique described in the SO answer doesn't really apply here, since the write end of the pipe would be closed on exec in that case. Whereas in this case they're waiting for it to be closed after the child dies.
- grodriguez100 1y agoSure, it may not apply in this specific case. But you said “This is the first I've heard of using an open pipe to poll for subprocess termination” and I was just pointing out that this is a well known technique.