mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-05 07:15:30 -04:00
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:
parent
5600cc68c0
commit
f49742ebba
4 changed files with 161 additions and 0 deletions
12
reaper.h
Normal file
12
reaper.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include "fdm.h"
|
||||
|
||||
struct reaper;
|
||||
|
||||
struct reaper *reaper_init(struct fdm *fdm);
|
||||
void reaper_destroy(struct reaper *reaper);
|
||||
|
||||
void reaper_add(struct reaper *reaper, pid_t pid);
|
||||
Loading…
Add table
Add a link
Reference in a new issue