]> git.itanic.dy.fi Git - rrdd/blobdiff - process.h
onewire_parser.c: Fix compiler warnings about string lengths
[rrdd] / process.h
index ae9db12b97457f90e5d4256c0e42e3ba5ffdb506..705ef889341bb486f020341b79e366dc32ac69c5 100644 (file)
--- a/process.h
+++ b/process.h
@@ -9,10 +9,12 @@
 #include <error.h>
 #include <errno.h>
 #include <stdint.h>
+#include <sys/epoll.h>
 
 struct event_handler;
 
 typedef int (handle_event_fn_t)(struct event_handler *);
+typedef int (work_fn_t)(void *);
 
 struct event_handler {
        int fd;
@@ -21,21 +23,26 @@ struct event_handler {
        char *name;
 };
 
-int register_event_handler(struct event_handler *handler);
-
-int get_child_count(void);
-int get_parent_count(void);
+int register_event_handler(struct event_handler *handler, int op);
 
 int init_jobcontrol(int max_jobs_requested);
 int poll_job_requests(int timeout);
+int notify_job_request(void);
 int do_fork(void);
-int do_fork_limited(void);
 int run(const char *p, char *const argv[]);
-int harvest_zombies(int pid);
+int clear_zombie(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);
 
+enum {
+       WORK_PRIORITY_HIGH,
+       WORK_PRIORITY_LOW,
+       WORK_PRIORITIES_NUM,
+};
+
+int queue_work(unsigned int priority, char *name,
+       int (work_fn)(void *arg), void *arg);
 
 #endif