greenplumn link-canary 源码

  • 2022-08-18
  • 浏览 (404)

greenplumn link-canary 代码

文件路径:/src/common/link-canary.c

/*-------------------------------------------------------------------------
 * link-canary.c
 *	  Detect whether src/common functions came from frontend or backend.
 *
 * Copyright (c) 2018-2019, PostgreSQL Global Development Group
 *
 * IDENTIFICATION
 *	  src/common/link-canary.c
 *
 *-------------------------------------------------------------------------
 */
#include "c.h"

#include "common/link-canary.h"

/*
 * This function just reports whether this file was compiled for frontend
 * or backend environment.  We need this because in some systems, mainly
 * ELF-based platforms, it is possible for a shlib (such as libpq) loaded
 * into the backend to call a backend function named XYZ in preference to
 * the shlib's own function XYZ.  That's bad if the two functions don't
 * act identically.  This exact situation comes up for many functions in
 * src/common and src/port, where the same function names exist in both
 * libpq and the backend but they don't act quite identically.  To verify
 * that appropriate measures have been taken to prevent incorrect symbol
 * resolution, libpq should test that this function returns true.
 */
bool
pg_link_canary_is_frontend(void)
{
#ifdef FRONTEND
	return true;
#else
	return false;
#endif
}

相关信息

greenplumn 源码目录

相关文章

greenplumn base64 源码

greenplumn config_info 源码

greenplumn controldata_utils 源码

greenplumn d2s 源码

greenplumn d2s_full_table 源码

greenplumn d2s_intrinsics 源码

greenplumn digit_table 源码

greenplumn exec 源码

greenplumn f2s 源码

greenplumn fe_memutils 源码

0  赞