spawn: add optional reaper callback, return pid_t

This will allow spawn() callers to do things when the spawned process
has terminated.
This commit is contained in:
Daniel Eklöf 2024-07-23 06:57:30 +02:00
parent 57af75f988
commit a42f990818
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 26 additions and 19 deletions

View file

@ -1,12 +1,14 @@
#pragma once
#include <stdbool.h>
#include <unistd.h>
#include "config.h"
#include "reaper.h"
bool spawn(struct reaper *reaper, const char *cwd, char *const argv[],
int stdin_fd, int stdout_fd, int stderr_fd,
const char *xdg_activation_token);
pid_t spawn(struct reaper *reaper, const char *cwd, char *const argv[],
int stdin_fd, int stdout_fd, int stderr_fd,
reaper_cb cb, void *cb_data, const char *xdg_activation_token);
bool spawn_expand_template(
const struct config_spawn_template *template,