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