LCOV - differential code coverage report
Current view: top level - src/common - link-canary.c (source / functions) Coverage Total Hit CBC
Current: Differential Code Coverage 16@8cea358b128 vs 17@8cea358b128 Lines: 100.0 % 3 3 3
Current Date: 2024-04-14 14:21:10 Functions: 100.0 % 1 1 1
Baseline: 16@8cea358b128 Branches: - 0 0
Baseline Date: 2024-04-14 14:21:09 Line coverage date bins:
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed (240..) days: 100.0 % 3 3 3
Function coverage date bins:
(240..) days: 100.0 % 1 1 1

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : /*-------------------------------------------------------------------------
                                  2                 :                :  * link-canary.c
                                  3                 :                :  *    Detect whether src/common functions came from frontend or backend.
                                  4                 :                :  *
                                  5                 :                :  * Copyright (c) 2018-2024, PostgreSQL Global Development Group
                                  6                 :                :  *
                                  7                 :                :  * IDENTIFICATION
                                  8                 :                :  *    src/common/link-canary.c
                                  9                 :                :  *
                                 10                 :                :  *-------------------------------------------------------------------------
                                 11                 :                :  */
                                 12                 :                : #include "c.h"
                                 13                 :                : 
                                 14                 :                : #include "common/link-canary.h"
                                 15                 :                : 
                                 16                 :                : /*
                                 17                 :                :  * This function just reports whether this file was compiled for frontend
                                 18                 :                :  * or backend environment.  We need this because in some systems, mainly
                                 19                 :                :  * ELF-based platforms, it is possible for a shlib (such as libpq) loaded
                                 20                 :                :  * into the backend to call a backend function named XYZ in preference to
                                 21                 :                :  * the shlib's own function XYZ.  That's bad if the two functions don't
                                 22                 :                :  * act identically.  This exact situation comes up for many functions in
                                 23                 :                :  * src/common and src/port, where the same function names exist in both
                                 24                 :                :  * libpq and the backend but they don't act quite identically.  To verify
                                 25                 :                :  * that appropriate measures have been taken to prevent incorrect symbol
                                 26                 :                :  * resolution, libpq should test that this function returns true.
                                 27                 :                :  */
                                 28                 :                : bool
 2044 tgl@sss.pgh.pa.us          29                 :CBC       12120 : pg_link_canary_is_frontend(void)
                                 30                 :                : {
                                 31                 :                : #ifdef FRONTEND
                                 32                 :          12081 :     return true;
                                 33                 :                : #else
                                 34                 :             39 :     return false;
                                 35                 :                : #endif
                                 36                 :                : }
        

Generated by: LCOV version 2.1-beta2-3-g6141622