57#include "xtc_export.h"
67typedef struct xtc_osproc xtc_osproc_t;
69typedef struct xtc_osproc_opts {
79 int (*fn)(
int ctrl_fd,
void *arg);
97XTC_API
long xtc_osproc_pid(
const xtc_osproc_t *p);
103XTC_API
int xtc_osproc_ctrl_fd(
const xtc_osproc_t *p);
108XTC_API
int xtc_osproc_signal(
const xtc_osproc_t *p,
int sig);
114XTC_API
int xtc_osproc_try_wait(xtc_osproc_t *p,
int *status);
122XTC_API
int xtc_osproc_wait(xtc_osproc_t *p,
int *status, int64_t timeout_ns);
129XTC_API
void xtc_osproc_destroy(xtc_osproc_t *p);
147XTC_API
int xtc_osproc_isolated_spawn(
const char *name,
148 int (*fn)(
int ctrl_fd,
void *arg),
void *arg,
158XTC_API
int xtc_osproc_call(xtc_osproc_t *p,
const void *req,
size_t req_len,
159 void **reply,
size_t *reply_len,
size_t max_reply,
166typedef int (*xtc_osproc_handler_fn)(
const void *req,
size_t req_len,
167 void **reply,
size_t *reply_len,
176XTC_API
int xtc_osproc_serve(
int ctrl_fd, xtc_osproc_handler_fn handler,
void *arg);