0
点赞
收藏
分享

微信扫一扫

PostgreSQL数据库源码安装第一步——EXEC_BACKEND用于何处


#ifdef EXEC_BACKEND 用于何处
在PostgreSQL的源代码 postmaster.c 的BackendStartup 函数中,有如下的部分(中间部分省略):

#ifdef EXEC_BACKEND                                
pid = backend_forkexec(port);
#else /* !EXEC_BACKEND */
pid = fork_process();
....
#endif /* EXEC_BACKEND */

对于 EXEC_BACKEND,进行调查发现:
configure脚本中有如下一段(包含 EXEC_BACKEND的只有此处):

# We already have this in Makefile.win32, but configure needs it too
if test "$PORTNAME" = "win32"; then
CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32 -DEXEC_BACKEND"
fi

由此可知,仅当编译/运行平台为windows系列时,才有可能定义 EXEC_BACKEND。
故此处执行的是 fork_process() 函数


举报

相关推荐

0 条评论