62#include "xtc_export.h"
72typedef struct xtc_osproc xtc_osproc_t;
74typedef struct xtc_osproc_opts {
85 int (*fn)(
int ctrl_fd,
void *arg);
91#define XTC_OSPROC_OPTS_INIT { .size = sizeof(xtc_osproc_opts_t) }
105XTC_API
long xtc_osproc_pid(
const xtc_osproc_t *p);
111XTC_API
int xtc_osproc_ctrl_fd(
const xtc_osproc_t *p);
116XTC_API
int xtc_osproc_signal(
const xtc_osproc_t *p,
int sig);
122XTC_API
int xtc_osproc_try_wait(xtc_osproc_t *p,
int *status);
130XTC_API
int xtc_osproc_wait(xtc_osproc_t *p,
int *status, int64_t timeout_ns);
137XTC_API
void xtc_osproc_destroy(xtc_osproc_t *p);
155XTC_API
int xtc_osproc_isolated_spawn(
const char *name,
156 int (*fn)(
int ctrl_fd,
void *arg),
void *arg,
166XTC_API
int xtc_osproc_call(xtc_osproc_t *p,
const void *req,
size_t req_len,
167 void **reply,
size_t *reply_len,
size_t max_reply,
174typedef int (*xtc_osproc_handler_fn)(
const void *req,
size_t req_len,
175 void **reply,
size_t *reply_len,
184XTC_API
int xtc_osproc_serve(
int ctrl_fd, xtc_osproc_handler_fn handler,
void *arg);