1 /* (c) 2007,2008 Andrei Nigmatulin */ 2 3 #ifndef FPM_CHILDREN_H 4 #define FPM_CHILDREN_H 1 5 6 #include <sys/time.h> 7 #include <sys/types.h> 8 9 #include "fpm_worker_pool.h" 10 #include "fpm_events.h" 11 #include "zlog.h" 12 13 struct fpm_child_s; 14 15 int fpm_children_create_initial(struct fpm_worker_pool_s *wp); 16 int fpm_children_free(struct fpm_child_s *child); 17 void fpm_children_bury(void); 18 int fpm_children_init_main(void); 19 int fpm_children_make(struct fpm_worker_pool_s *wp, int in_event_loop, int nb_to_spawn, int is_debug); 20 struct fpm_child_s *fpm_child_find(pid_t pid); 21 22 struct fpm_child_s { 23 struct fpm_child_s *prev, *next; 24 struct timeval started; 25 struct fpm_worker_pool_s *wp; 26 struct fpm_event_s ev_stdout, ev_stderr, ev_free; 27 int shm_slot_i; 28 int fd_stdout, fd_stderr; 29 void (*tracer)(struct fpm_child_s *); 30 struct timeval slow_logged; 31 bool idle_kill; 32 bool postponed_free; 33 pid_t pid; 34 int scoreboard_i; 35 struct zlog_stream *log_stream; 36 }; 37 38 #endif 39