Ubuntu 下 nginx-1.24.0 源码分析 ngx_debug_init();

目录

ngx_debug_init() 函数:

NGX_LINUX 的定义:


 

ngx_debug_init() 函数:

ngx_debug_init() 函数定义在 src\os\unix 目录下的 ngx_linux_config.h 中

#define ngx_debug_init()

也就是说这个环境下的 main 函数中的 ngx_debug_init() 这行代码其实什么都没有做

 

在 nginx.c 的开头引入了

#include 

而在 ngx_config.h 中:

#if (NGX_FREEBSD)
#include 


#elif (NGX_LINUX)
#include 

NGX_LINUX 这个宏如果已经定义且不为 0 

就会引入 ngx_linux_config.h

从而 nginx.c 间接引入了 ngx_debug_init();


NGX_LINUX 的定义:

ngx_config.h 的开头部分引入了:

#include 

它的位置在 objs 目录下

objs 就是执行 configure  Ubuntu环境 nginx 源码 编译安装-CSDN博客

命令后产生的

打开 ngx_auto_headers.h:

#ifndef NGX_LINUX
#define NGX_LINUX  1
#endif

你可能感兴趣的:(nginx,运维)