Back to home page

Nginx displayed by LXR

Source navigation ]
Diff markup ]
Identifier search ]
general search ]
 
 
Version: nginx-1.13.12 ]​[ nginx-1.12.2 ]​

0001 
0002 /*
0003  * Copyright (C) Igor Sysoev
0004  * Copyright (C) Nginx, Inc.
0005  */
0006 
0007 
0008 #ifndef _NGX_CYCLE_H_INCLUDED_
0009 #define _NGX_CYCLE_H_INCLUDED_
0010 
0011 
0012 #include <ngx_config.h>
0013 #include <ngx_core.h>
0014 
0015 
0016 #ifndef NGX_CYCLE_POOL_SIZE
0017 #define NGX_CYCLE_POOL_SIZE     NGX_DEFAULT_POOL_SIZE
0018 #endif
0019 
0020 
0021 #define NGX_DEBUG_POINTS_STOP   1
0022 #define NGX_DEBUG_POINTS_ABORT  2
0023 
0024 
0025 typedef struct ngx_shm_zone_s  ngx_shm_zone_t;
0026 
0027 typedef ngx_int_t (*ngx_shm_zone_init_pt) (ngx_shm_zone_t *zone, void *data);
0028 
0029 struct ngx_shm_zone_s {
0030     void                     *data;
0031     ngx_shm_t                 shm;
0032     ngx_shm_zone_init_pt      init;
0033     void                     *tag;
0034     ngx_uint_t                noreuse;  /* unsigned  noreuse:1; */
0035 };
0036 
0037 
0038 struct ngx_cycle_s {
0039     void                  ****conf_ctx;
0040     ngx_pool_t               *pool;
0041 
0042     ngx_log_t                *log;
0043     ngx_log_t                 new_log;
0044 
0045     ngx_uint_t                log_use_stderr;  /* unsigned  log_use_stderr:1; */
0046 
0047     ngx_connection_t        **files;
0048     ngx_connection_t         *free_connections;
0049     ngx_uint_t                free_connection_n;
0050 
0051     ngx_module_t            **modules;
0052     ngx_uint_t                modules_n;
0053     ngx_uint_t                modules_used;    /* unsigned  modules_used:1; */
0054 
0055     ngx_queue_t               reusable_connections_queue;
0056     ngx_uint_t                reusable_connections_n;
0057 
0058     ngx_array_t               listening;
0059     ngx_array_t               paths;
0060 
0061     ngx_array_t               config_dump;
0062     ngx_rbtree_t              config_dump_rbtree;
0063     ngx_rbtree_node_t         config_dump_sentinel;
0064 
0065     ngx_list_t                open_files;
0066     ngx_list_t                shared_memory;
0067 
0068     ngx_uint_t                connection_n;
0069     ngx_uint_t                files_n;
0070 
0071     ngx_connection_t         *connections;
0072     ngx_event_t              *read_events;
0073     ngx_event_t              *write_events;
0074 
0075     ngx_cycle_t              *old_cycle;
0076 
0077     ngx_str_t                 conf_file;
0078     ngx_str_t                 conf_param;
0079     ngx_str_t                 conf_prefix;
0080     ngx_str_t                 prefix;
0081     ngx_str_t                 lock_file;
0082     ngx_str_t                 hostname;
0083 };
0084 
0085 
0086 typedef struct {
0087     ngx_flag_t                daemon;
0088     ngx_flag_t                master;
0089 
0090     ngx_msec_t                timer_resolution;
0091     ngx_msec_t                shutdown_timeout;
0092 
0093     ngx_int_t                 worker_processes;
0094     ngx_int_t                 debug_points;
0095 
0096     ngx_int_t                 rlimit_nofile;
0097     off_t                     rlimit_core;
0098 
0099     int                       priority;
0100 
0101     ngx_uint_t                cpu_affinity_auto;
0102     ngx_uint_t                cpu_affinity_n;
0103     ngx_cpuset_t             *cpu_affinity;
0104 
0105     char                     *username;
0106     ngx_uid_t                 user;
0107     ngx_gid_t                 group;
0108 
0109     ngx_str_t                 working_directory;
0110     ngx_str_t                 lock_file;
0111 
0112     ngx_str_t                 pid;
0113     ngx_str_t                 oldpid;
0114 
0115     ngx_array_t               env;
0116     char                    **environment;
0117 } ngx_core_conf_t;
0118 
0119 
0120 #define ngx_is_init_cycle(cycle)  (cycle->conf_ctx == NULL)
0121 
0122 
0123 ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle);
0124 ngx_int_t ngx_create_pidfile(ngx_str_t *name, ngx_log_t *log);
0125 void ngx_delete_pidfile(ngx_cycle_t *cycle);
0126 ngx_int_t ngx_signal_process(ngx_cycle_t *cycle, char *sig);
0127 void ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user);
0128 char **ngx_set_environment(ngx_cycle_t *cycle, ngx_uint_t *last);
0129 ngx_pid_t ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv);
0130 ngx_cpuset_t *ngx_get_cpu_affinity(ngx_uint_t n);
0131 ngx_shm_zone_t *ngx_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name,
0132     size_t size, void *tag);
0133 void ngx_set_shutdown_timer(ngx_cycle_t *cycle);
0134 
0135 
0136 extern volatile ngx_cycle_t  *ngx_cycle;
0137 extern ngx_array_t            ngx_old_cycles;
0138 extern ngx_module_t           ngx_core_module;
0139 extern ngx_uint_t             ngx_test_config;
0140 extern ngx_uint_t             ngx_dump_config;
0141 extern ngx_uint_t             ngx_quiet_mode;
0142 
0143 
0144 #endif /* _NGX_CYCLE_H_INCLUDED_ */