]> git.itanic.dy.fi Git - rrdd/blob - process.h
plugins: Add version checking
[rrdd] / process.h
1 #ifndef _PROCESS_H
2 #define _PROCESS_H
3
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <unistd.h>
7 #include <string.h>
8 #include <sys/wait.h>
9 #include <error.h>
10 #include <errno.h>
11 #include <stdint.h>
12
13 struct event_handler;
14
15 typedef int (handle_event_fn_t)(struct event_handler *);
16
17 struct event_handler {
18         int fd;
19         uint32_t events;
20         handle_event_fn_t *handle_event;
21         char *name;
22 };
23
24 int register_event_handler(struct event_handler *handler);
25
26 int get_child_count(void);
27 int get_parent_count(void);
28
29 int init_jobcontrol(int max_jobs_requested);
30 int poll_job_requests(int timeout);
31 int do_fork(void);
32 int do_fork_limited(void);
33 int run(const char *p, char *const argv[]);
34 int harvest_zombies(int pid);
35 int run_piped(const char *cmd, char *const argv[],
36               int *stdinfd, int *stdoutfd, int *stderrfd);
37 int run_piped_stream(const char *cmd, char *const argv[],
38                      FILE **stdinf, FILE **stdoutf, FILE **stderrf);
39
40
41 #endif