mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
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.
12 lines
212 B
C
12 lines
212 B
C
#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);
|