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