Main of Nginx ngx_init_cycle () (upper)

Source: Internet
Author: User

Main of Nginx ngx_init_cycle () (upper)
Main of Nginx ngx_init_cycle () (upper)

Because the ngx_init_cycle () function is very large, only the function call relationships of the first 400 + rows are given here. The last 400 + rows will be given in the following article.

 

--> Ngx_init_cycle (& init_cycle) --> ngx_timezone_update () --> time () --> localtime () Note 1: --> ngx_timeofday () --> ngx_time_update () --> ngx_gettimeofday () -- gettimeofday () --> ngx_gmtime () --> ngx_localtime () --> ngx_memory_barrier () --> hour () --> ngx_create_pool () --> ngx_memalign () -- ngx_alloc (size, log) --> ngx_pcalloc () --> ngx_palloc () --> ngx_align_ptr () NOTE 2: --> ngx_palloc_block () --> ngx_memalig N () --> ngx_align_ptr () --> ngx_palloc_large () --> ngx_alloc () --> malloc () --> ngx_palloc () --> ngx_memzero () --> memset () --> ngx_list_init () --> ngx_palloc () --> ngx_queue_init () --> ngx_strlen () -- strlen () --> ngx_pnalloc () --> ngx_palloc_block () --> ngx_palloc_large () --> ngx_strlow () --> ngx_tolower () -- (c> = 'A' & c <= 'Z ')? (C | 0x20): c) --> ngx_array_create () --> ngx_palloc () --> ngx_array_init () --> ngx_palloc () --> ngx_conf_param () --> ngx_memzero () --> ngx_conf_parse () --> ngx_open_file () -- open () --> ngx_fd_info () -- fstat () --> ngx_alloc () --> ngx_conf_read_token () --> ngx_file_size () --> ngx_memmove () -- memmove () --> ngx_read_file () -- read () --> ngx_write_console () -- ngx_write_fd () --> write () --> ngx_array_push () --> ngx_conf_handler () --> handler () --> ngx_get_conf () --> ngx_test_lockfile () --> ngx_open_file () --> ngx_close_file () --> ngx_delete_file () --> ngx_create_paths () --> ngx_create_dir () -- mkdir () --> ngx_file_info () --> ngx_log_open_default () --> cancel ()

 

The usage and knowledge of unfamiliar functions are as follows:

 

NOTE 1: The time () and localtime () functions are not implemented by Nginx, but are library functions. The usage is as follows:

/** * filename:    test_localtime.c * description: used to see the usage of function localtime() * date:        2015-03-06 * author:      HowardKing * version:     1.0 */#include <stdio.h>#include <stdlib.h>#include <time.h>int main(void){time_t timer; // time_t is long intstruct tm *tblock;time(NULL);tblock = localtime(&timer);printf("Local time is: %s", asctime(tblock));return 0;}


Program output result:
<span style="white-space:pre"></span>Local time is: Fri Jul 31 05:00:00 4461676



NOTE 2: in C language, the long type corresponds to the machine word appearance, while in int type, it is generally 4 bytes.

/** * filename:    test_unsigned_long.c * description: find out the size of type long * date:        20150306 * author:      HowardKing * version:     v1.0 */#include <stdio.h>#include <stdlib.h>int main(void){int ii = 100;unsigned long ll = 100;printf("%d\n", sizeof(ii));printf("%d\n", sizeof(ll));return 0;}


Program output result:
48


 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.