1 /* (c) 2007,2008 Andrei Nigmatulin */ 2 3 #ifndef FPM_H 4 #define FPM_H 1 5 6 #include <unistd.h> 7 8 #ifdef HAVE_SYSEXITS_H 9 #include <sysexits.h> 10 #endif 11 12 #ifdef EX_OK 13 #define FPM_EXIT_OK EX_OK 14 #else 15 #define FPM_EXIT_OK 0 16 #endif 17 18 #ifdef EX_USAGE 19 #define FPM_EXIT_USAGE EX_USAGE 20 #else 21 #define FPM_EXIT_USAGE 64 22 #endif 23 24 #ifdef EX_SOFTWARE 25 #define FPM_EXIT_SOFTWARE EX_SOFTWARE 26 #else 27 #define FPM_EXIT_SOFTWARE 70 28 #endif 29 30 #ifdef EX_CONFIG 31 #define FPM_EXIT_CONFIG EX_CONFIG 32 #else 33 #define FPM_EXIT_CONFIG 78 34 #endif 35 36 37 int fpm_run(int *max_requests); 38 int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root, int force_daemon, int force_stderr); 39 40 struct fpm_globals_s { 41 pid_t parent_pid; 42 int argc; 43 char **argv; 44 char *config; 45 char *prefix; 46 char *pid; 47 int running_children; 48 int error_log_fd; 49 int log_level; 50 int listening_socket; /* for this child */ 51 int max_requests; /* for this child */ 52 int is_child; 53 int test_successful; 54 int heartbeat; 55 int run_as_root; 56 int force_stderr; 57 int send_config_pipe[2]; 58 }; 59 60 extern struct fpm_globals_s fpm_globals; 61 62 #endif 63