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     void                     *sync;
0035     ngx_uint_t                noreuse;  /* unsigned  noreuse:1; */
0036 };
0037 
0038 
0039 struct ngx_cycle_s {
0040     void                  ****conf_ctx;
0041     ngx_pool_t               *pool;
0042 
0043     ngx_log_t                *log;
0044     ngx_log_t                 new_log;
0045 
0046     ngx_uint_t                log_use_stderr;  /* unsigned  log_use_stderr:1; */
0047 
0048     ngx_connection_t        **files;
0049     ngx_connection_t         *free_connections;
0050     ngx_uint_t                free_connection_n;
0051 
0052     ngx_module_t            **modules;
0053     ngx_uint_t                modules_n;
0054     ngx_uint_t                modules_used;    /* unsigned  modules_used:1; */
0055 
0056     ngx_queue_t               reusable_connections_queue;
0057     ngx_uint_t                reusable_connections_n;
0058 
0059     ngx_array_t               listening;
0060     ngx_array_t               paths;
0061 
0062     ngx_array_t               config_dump;
0063     ngx_rbtree_t              config_dump_rbtree;
0064     ngx_rbtree_node_t         config_dump_sentinel;
0065 
0066     ngx_list_t                open_files;
0067     ngx_list_t                shared_memory;
0068 
0069     ngx_uint_t                connection_n;
0070     ngx_uint_t                files_n;
0071 
0072     ngx_connection_t         *connections;
0073     ngx_event_t              *read_events;
0074     ngx_event_t              *write_events;
0075 
0076     ngx_cycle_t              *old_cycle;
0077 
0078     ngx_str_t                 conf_file;
0079     ngx_str_t                 conf_param;
0080     ngx_str_t                 conf_prefix;
0081     ngx_str_t                 prefix;
0082     ngx_str_t                 lock_file;
0083     ngx_str_t                 hostname;
0084 };
0085 
0086 
0087 typedef struct {
0088     ngx_flag_t                daemon;
0089     ngx_flag_t                master;
0090 
0091     ngx_msec_t                timer_resolution;
0092     ngx_msec_t                shutdown_timeout;
0093 
0094     ngx_int_t                 worker_processes;
0095     ngx_int_t                 debug_points;
0096 
0097     ngx_int_t                 rlimit_nofile;
0098     off_t                     rlimit_core;
0099 
0100     int                       priority;
0101 
0102     ngx_uint_t                cpu_affinity_auto;
0103     ngx_uint_t                cpu_affinity_n;
0104     ngx_cpuset_t             *cpu_affinity;
0105 
0106     char                     *username;
0107     ngx_uid_t                 user;
0108     ngx_gid_t                 group;
0109 
0110     ngx_str_t                 working_directory;
0111     ngx_str_t                 lock_file;
0112 
0113     ngx_str_t                 pid;
0114     ngx_str_t                 oldpid;
0115 
0116     ngx_array_t               env;
0117     char                    **environment;
0118 
0119     ngx_uint_t                transparent;  /* unsigned  transparent:1; */
0120 } ngx_core_conf_t;
0121 
0122 
0123 #define ngx_is_init_cycle(cycle)  (cycle->conf_ctx == NULL)
0124 
0125 
0126 ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle);
0127 ngx_int_t ngx_create_pidfile(ngx_str_t *name, ngx_log_t *log);
0128 void ngx_delete_pidfile(ngx_cycle_t *cycle);
0129 ngx_int_t ngx_signal_process(ngx_cycle_t *cycle, char *sig);
0130 void ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user);
0131 char **ngx_set_environment(ngx_cycle_t *cycle, ngx_uint_t *last);
0132 ngx_pid_t ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv);
0133 ngx_cpuset_t *ngx_get_cpu_affinity(ngx_uint_t n);
0134 ngx_shm_zone_t *ngx_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name,
0135     size_t size, void *tag);
0136 void ngx_set_shutdown_timer(ngx_cycle_t *cycle);
0137 
0138 
0139 extern volatile ngx_cycle_t  *ngx_cycle;
0140 extern ngx_array_t            ngx_old_cycles;
0141 extern ngx_module_t           ngx_core_module;
0142 extern ngx_uint_t             ngx_test_config;
0143 extern ngx_uint_t             ngx_dump_config;
0144 extern ngx_uint_t             ngx_quiet_mode;
0145 
0146 
0147 #endif /* _NGX_CYCLE_H_INCLUDED_ */