2004-09-28 04:34:51 -04:00
|
|
|
|
|
|
|
/*
|
2004-09-29 12:00:49 -04:00
|
|
|
* Copyright (C) Igor Sysoev
|
2004-09-28 04:34:51 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2004-01-05 17:55:48 -03:00
|
|
|
#ifndef _NGX_CYCLE_H_INCLUDED_
|
|
|
|
#define _NGX_CYCLE_H_INCLUDED_
|
|
|
|
|
|
|
|
|
|
|
|
#include <ngx_config.h>
|
|
|
|
#include <ngx_core.h>
|
|
|
|
|
|
|
|
|
2005-04-08 11:18:55 -04:00
|
|
|
#ifndef NGX_CYCLE_POOL_SIZE
|
|
|
|
#define NGX_CYCLE_POOL_SIZE 16384
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2004-11-11 11:07:14 -03:00
|
|
|
#define NGX_DEBUG_POINTS_STOP 1
|
|
|
|
#define NGX_DEBUG_POINTS_ABORT 2
|
|
|
|
|
|
|
|
|
2004-01-05 17:55:48 -03:00
|
|
|
struct ngx_cycle_s {
|
2004-12-02 15:40:46 -03:00
|
|
|
void ****conf_ctx;
|
|
|
|
ngx_pool_t *pool;
|
2004-04-15 11:34:36 -04:00
|
|
|
|
2004-12-02 15:40:46 -03:00
|
|
|
ngx_log_t *log;
|
|
|
|
ngx_log_t *new_log;
|
2004-04-15 11:34:36 -04:00
|
|
|
|
2005-09-23 07:02:22 -04:00
|
|
|
ngx_connection_t **files;
|
|
|
|
ngx_connection_t *free_connections;
|
|
|
|
ngx_uint_t free_connection_n;
|
|
|
|
|
2004-12-02 15:40:46 -03:00
|
|
|
ngx_array_t listening;
|
|
|
|
ngx_array_t pathes;
|
|
|
|
ngx_list_t open_files;
|
2004-01-05 17:55:48 -03:00
|
|
|
|
2004-12-02 15:40:46 -03:00
|
|
|
ngx_uint_t connection_n;
|
2005-09-23 07:02:22 -04:00
|
|
|
ngx_uint_t files_n;
|
|
|
|
|
2005-10-12 10:50:36 -03:00
|
|
|
ngx_connection_t *connections;
|
|
|
|
ngx_event_t *read_events;
|
|
|
|
ngx_event_t *write_events;
|
2004-01-05 17:55:48 -03:00
|
|
|
|
2004-12-02 15:40:46 -03:00
|
|
|
ngx_cycle_t *old_cycle;
|
2004-01-05 17:55:48 -03:00
|
|
|
|
2004-12-02 15:40:46 -03:00
|
|
|
ngx_str_t conf_file;
|
|
|
|
ngx_str_t root;
|
2004-01-05 17:55:48 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-03-04 04:04:55 -03:00
|
|
|
typedef struct {
|
2004-12-02 15:40:46 -03:00
|
|
|
ngx_flag_t daemon;
|
|
|
|
ngx_flag_t master;
|
2004-03-30 16:31:58 -04:00
|
|
|
|
2005-10-19 09:33:58 -03:00
|
|
|
ngx_msec_t timer_resolution;
|
|
|
|
|
2004-12-02 15:40:46 -03:00
|
|
|
ngx_int_t worker_processes;
|
|
|
|
ngx_int_t debug_points;
|
2004-03-30 16:31:58 -04:00
|
|
|
|
2005-09-23 07:02:22 -04:00
|
|
|
ngx_int_t rlimit_nofile;
|
|
|
|
ngx_int_t rlimit_sigpending;
|
|
|
|
|
2004-12-02 15:40:46 -03:00
|
|
|
int priority;
|
2004-03-30 16:31:58 -04:00
|
|
|
|
2005-11-15 10:30:52 -03:00
|
|
|
ngx_uint_t cpu_affinity_n;
|
|
|
|
u_long *cpu_affinity;
|
|
|
|
|
2004-12-02 15:40:46 -03:00
|
|
|
char *username;
|
|
|
|
ngx_uid_t user;
|
|
|
|
ngx_gid_t group;
|
|
|
|
|
2005-06-07 11:56:31 -04:00
|
|
|
ngx_str_t working_directory;
|
|
|
|
|
2004-12-02 15:40:46 -03:00
|
|
|
ngx_str_t pid;
|
2005-09-23 07:02:22 -04:00
|
|
|
ngx_str_t oldpid;
|
2004-07-05 02:55:54 -04:00
|
|
|
|
|
|
|
#if (NGX_THREADS)
|
2004-12-02 15:40:46 -03:00
|
|
|
ngx_int_t worker_threads;
|
|
|
|
size_t thread_stack_size;
|
2004-07-05 02:55:54 -04:00
|
|
|
#endif
|
|
|
|
|
2004-03-04 04:04:55 -03:00
|
|
|
} ngx_core_conf_t;
|
|
|
|
|
|
|
|
|
2004-07-07 11:01:00 -04:00
|
|
|
typedef struct {
|
2004-12-02 15:40:46 -03:00
|
|
|
ngx_pool_t *pool; /* pcre's malloc() pool */
|
2004-07-07 11:01:00 -04:00
|
|
|
} ngx_core_tls_t;
|
|
|
|
|
|
|
|
|
2004-01-05 17:55:48 -03:00
|
|
|
ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle);
|
2004-04-12 12:38:09 -04:00
|
|
|
ngx_int_t ngx_create_pidfile(ngx_cycle_t *cycle, ngx_cycle_t *old_cycle);
|
|
|
|
void ngx_delete_pidfile(ngx_cycle_t *cycle);
|
2004-03-04 04:04:55 -03:00
|
|
|
void ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user);
|
|
|
|
ngx_pid_t ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv);
|
2005-11-15 10:30:52 -03:00
|
|
|
u_long ngx_get_cpu_affinity(ngx_uint_t n);
|
2004-01-05 17:55:48 -03:00
|
|
|
|
|
|
|
|
|
|
|
extern volatile ngx_cycle_t *ngx_cycle;
|
|
|
|
extern ngx_array_t ngx_old_cycles;
|
2004-03-04 04:04:55 -03:00
|
|
|
extern ngx_module_t ngx_core_module;
|
2004-04-16 01:14:16 -04:00
|
|
|
extern ngx_uint_t ngx_test_config;
|
2004-07-07 11:01:00 -04:00
|
|
|
#if (NGX_THREADS)
|
|
|
|
extern ngx_tls_key_t ngx_core_tls_key;
|
|
|
|
#endif
|
2004-01-05 17:55:48 -03:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* _NGX_CYCLE_H_INCLUDED_ */
|