reaper: new module, uses a signalfd to wait() on child processes

Use a signalfd to listen for SIGCHLD signals.

When we receive a SIGCHLD over the signalfd, reap all dead children by
looping over all registered child PIDs and call waitpid(WNOHANG) on
them.
This commit is contained in:
Daniel Eklöf 2020-05-21 20:15:10 +02:00
parent 5600cc68c0
commit f49742ebba
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 161 additions and 0 deletions

View file

@ -114,6 +114,7 @@ executable(
'misc.c', 'misc.h',
'osc.c', 'osc.h',
'quirks.c', 'quirks.h',
'reaper.c', 'reaper.h',
'render.c', 'render.h',
'search.c', 'search.h',
'selection.c', 'selection.h',