mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
When calling ‘reaper_add()’, the caller can provide a callback. If non-NULL, the reaper will call the callback to handle the actual reaping. If the callback is NULL, or if it returns false, the reaper reaps the child process.
15 lines
336 B
C
15 lines
336 B
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <sys/wait.h>
|
|
|
|
#include "fdm.h"
|
|
|
|
struct reaper;
|
|
|
|
struct reaper *reaper_init(struct fdm *fdm);
|
|
void reaper_destroy(struct reaper *reaper);
|
|
|
|
typedef bool (*reaper_cb)(struct reaper *reaper, pid_t pid, void *data);
|
|
|
|
void reaper_add(struct reaper *reaper, pid_t pid, reaper_cb cb, void *cb_data);
|