#ifndef _PROCESS_H #define _PROCESS_H #include #include #include #include #include #include #include #include struct event_handler; typedef int (handle_event_fn_t)(struct event_handler *); struct event_handler { int fd; uint32_t events; handle_event_fn_t *handle_event; char *name; }; int register_event_handler(struct event_handler *handler); int get_child_count(void); int get_parent_count(void); int init_jobcontrol(int max_jobs_requested); int poll_job_requests(int timeout); int do_fork(void); int do_fork_limited(void); int run(const char *p, char *const argv[]); int harvest_zombies(int pid); int run_piped(const char *cmd, char *const argv[], int *stdinfd, int *stdoutfd, int *stderrfd); int run_piped_stream(const char *cmd, char *const argv[], FILE **stdinf, FILE **stdoutf, FILE **stderrf); #endif