LCOV - differential code coverage report
Current view: top level - src/backend/libpq - pqsignal.c (source / functions) Coverage Total Hit GIC
Current: a2387c32f2f8a1643c7d71b951587e6bcb2d4744 vs 371a302eecdc82274b0ae2967d18fd726a0aa6a1 Lines: 100.0 % 24 24 24
Current Date: 2025-10-26 12:31:50 -0700 Functions: 100.0 % 1 1 1
Baseline: lcov-20251027-010456-baseline Line coverage date bins:
Baseline Date: 2025-10-26 11:01:32 +1300 (360..) days: 100.0 % 24 24 24
Legend: Lines:     hit not hit Function coverage date bins:
(360..) days: 100.0 % 1 1 1

 Age         Owner                  TLA  Line data    Source code
                                  1                 : /*-------------------------------------------------------------------------
                                  2                 :  *
                                  3                 :  * pqsignal.c
                                  4                 :  *    Backend signal(2) support (see also src/port/pqsignal.c)
                                  5                 :  *
                                  6                 :  * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
                                  7                 :  * Portions Copyright (c) 1994, Regents of the University of California
                                  8                 :  *
                                  9                 :  *
                                 10                 :  * IDENTIFICATION
                                 11                 :  *    src/backend/libpq/pqsignal.c
                                 12                 :  *
                                 13                 :  * ------------------------------------------------------------------------
                                 14                 :  */
                                 15                 : 
                                 16                 : #include "postgres.h"
                                 17                 : 
                                 18                 : #include "libpq/pqsignal.h"
                                 19                 : 
                                 20                 : 
                                 21                 : /* Global variables */
                                 22                 : sigset_t    UnBlockSig,
                                 23                 :             BlockSig,
                                 24                 :             StartupBlockSig;
                                 25                 : 
                                 26                 : 
                                 27                 : /*
                                 28                 :  * Initialize BlockSig, UnBlockSig, and StartupBlockSig.
                                 29                 :  *
                                 30                 :  * BlockSig is the set of signals to block when we are trying to block
                                 31                 :  * signals.  This includes all signals we normally expect to get, but NOT
                                 32                 :  * signals that should never be turned off.
                                 33                 :  *
                                 34                 :  * StartupBlockSig is the set of signals to block during startup packet
                                 35                 :  * collection; it's essentially BlockSig minus SIGTERM, SIGQUIT, SIGALRM.
                                 36                 :  *
                                 37                 :  * UnBlockSig is the set of signals to block when we don't want to block
                                 38                 :  * signals.
                                 39                 :  */
                                 40                 : void
 9252 tgl@sss.pgh.pa.us          41 GIC        1087 : pqinitmask(void)
                                 42                 : {
                                 43            1087 :     sigemptyset(&UnBlockSig);
                                 44                 : 
                                 45                 :     /* Note: InitializeWaitEventSupport() modifies UnBlockSig. */
                                 46                 : 
                                 47                 :     /* First set all signals, then clear some. */
                                 48            1087 :     sigfillset(&BlockSig);
 5903                            49            1087 :     sigfillset(&StartupBlockSig);
                                 50                 : 
                                 51                 :     /*
                                 52                 :      * Unmark those signals that should never be blocked. Some of these signal
                                 53                 :      * names don't exist on all platforms.  Most do, but might as well ifdef
                                 54                 :      * them all for consistency...
                                 55                 :      */
                                 56                 : #ifdef SIGTRAP
 9251                            57            1087 :     sigdelset(&BlockSig, SIGTRAP);
 5903                            58            1087 :     sigdelset(&StartupBlockSig, SIGTRAP);
                                 59                 : #endif
                                 60                 : #ifdef SIGABRT
 9252                            61            1087 :     sigdelset(&BlockSig, SIGABRT);
 5903                            62            1087 :     sigdelset(&StartupBlockSig, SIGABRT);
                                 63                 : #endif
                                 64                 : #ifdef SIGILL
 9252                            65            1087 :     sigdelset(&BlockSig, SIGILL);
 5903                            66            1087 :     sigdelset(&StartupBlockSig, SIGILL);
                                 67                 : #endif
                                 68                 : #ifdef SIGFPE
 9251                            69            1087 :     sigdelset(&BlockSig, SIGFPE);
 5903                            70            1087 :     sigdelset(&StartupBlockSig, SIGFPE);
                                 71                 : #endif
                                 72                 : #ifdef SIGSEGV
 9252                            73            1087 :     sigdelset(&BlockSig, SIGSEGV);
 5903                            74            1087 :     sigdelset(&StartupBlockSig, SIGSEGV);
                                 75                 : #endif
                                 76                 : #ifdef SIGBUS
 9252                            77            1087 :     sigdelset(&BlockSig, SIGBUS);
 5903                            78            1087 :     sigdelset(&StartupBlockSig, SIGBUS);
                                 79                 : #endif
                                 80                 : #ifdef SIGSYS
 9252                            81            1087 :     sigdelset(&BlockSig, SIGSYS);
 5903                            82            1087 :     sigdelset(&StartupBlockSig, SIGSYS);
                                 83                 : #endif
                                 84                 : #ifdef SIGCONT
 9251                            85            1087 :     sigdelset(&BlockSig, SIGCONT);
 5903                            86            1087 :     sigdelset(&StartupBlockSig, SIGCONT);
                                 87                 : #endif
                                 88                 : 
                                 89                 : /* Signals unique to startup */
                                 90                 : #ifdef SIGQUIT
                                 91            1087 :     sigdelset(&StartupBlockSig, SIGQUIT);
                                 92                 : #endif
                                 93                 : #ifdef SIGTERM
                                 94            1087 :     sigdelset(&StartupBlockSig, SIGTERM);
                                 95                 : #endif
                                 96                 : #ifdef SIGALRM
                                 97            1087 :     sigdelset(&StartupBlockSig, SIGALRM);
                                 98                 : #endif
 9252                            99            1087 : }
        

Generated by: LCOV version 2.4-beta