3 * Copyright (C) Igor Sysoev
7 #ifndef _NGX_CYCLE_H_INCLUDED_
8 #define _NGX_CYCLE_H_INCLUDED_
11 #include <ngx_config.h>
15 #ifndef NGX_CYCLE_POOL_SIZE
16 #define NGX_CYCLE_POOL_SIZE 16384
20 #define NGX_DEBUG_POINTS_STOP 1
21 #define NGX_DEBUG_POINTS_ABORT 2
24 typedef struct ngx_shm_zone_s ngx_shm_zone_t;
26 typedef ngx_int_t (*ngx_shm_zone_init_pt) (ngx_shm_zone_t *zone, void *data);
28 struct ngx_shm_zone_s {
31 ngx_shm_zone_init_pt init;
44 ngx_connection_t **files;
45 ngx_connection_t *free_connections;
46 ngx_uint_t free_connection_n;
48 ngx_array_t listening;
50 ngx_list_t open_files;
51 ngx_list_t shared_memory;
53 ngx_uint_t connection_n;
56 ngx_connection_t *connections;
57 ngx_event_t *read_events;
58 ngx_event_t *write_events;
60 ngx_cycle_t *old_cycle;
74 ngx_msec_t timer_resolution;
76 ngx_int_t worker_processes;
77 ngx_int_t debug_points;
79 ngx_int_t rlimit_nofile;
80 ngx_int_t rlimit_sigpending;
85 ngx_uint_t cpu_affinity_n;
92 ngx_str_t working_directory;
102 ngx_int_t worker_threads;
103 size_t thread_stack_size;
110 ngx_pool_t *pool; /* pcre's malloc() pool */
114 #define ngx_is_init_cycle(cycle) (cycle->conf_ctx == NULL)
117 ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle);
118 ngx_int_t ngx_create_pidfile(ngx_str_t *name, ngx_log_t *log);
119 void ngx_delete_pidfile(ngx_cycle_t *cycle);
120 void ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user);
121 char **ngx_set_environment(ngx_cycle_t *cycle, ngx_uint_t *last);
122 ngx_pid_t ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv);
123 u_long ngx_get_cpu_affinity(ngx_uint_t n);
124 ngx_shm_zone_t *ngx_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name,
125 size_t size, void *tag);
128 extern volatile ngx_cycle_t *ngx_cycle;
129 extern ngx_array_t ngx_old_cycles;
130 extern ngx_module_t ngx_core_module;
131 extern ngx_uint_t ngx_test_config;
133 extern ngx_tls_key_t ngx_core_tls_key;
137 #endif /* _NGX_CYCLE_H_INCLUDED_ */