16 typedef int (handle_event_fn_t)(struct event_handler *);
18 struct event_handler {
21 handle_event_fn_t *handle_event;
33 int register_event_handler(struct event_handler *handler);
35 int get_child_count(void);
36 int get_parent_count(void);
38 int init_jobcontrol(int max_jobs_requested);
39 int poll_job_requests(int timeout);
41 int do_fork_limited(void);
42 int run(const char *p, char *const argv[]);
43 int harvest_zombies(int pid);
44 int run_piped(const char *cmd, char *const argv[],
45 int *stdinfd, int *stdoutfd, int *stderrfd);
46 int run_piped_stream(const char *cmd, char *const argv[],
47 FILE **stdinf, FILE **stdoutf, FILE **stderrf);
49 void _mutex_lock_acquired(struct mutex *lock, char *file, int line);
50 int _mutex_lock(struct mutex *lock, char *file, int line);
51 int _mutex_unlock(struct mutex *lock);
53 #define mutex_lock(lock) _mutex_lock(lock, __FILE__, __LINE__)
54 #define mutex_unlock(lock) _mutex_unlock(lock)
55 #define mutex_lock_acquired(lock) _mutex_lock_acquired(lock, __FILE__, __LINE__)