SELKIELogger  1.0.0
LoggerSignals.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Swansea University
3  *
4  * This file is part of the SELKIELogger suite of tools.
5  *
6  * SELKIELogger is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the Free
8  * Software Foundation, either version 3 of the License, or (at your option)
9  * any later version.
10  *
11  * SELKIELogger is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this SELKIELogger product.
18  * If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef SL_LOGGER_SIGS_H
22 #define SL_LOGGER_SIGS_H
23 
24 #include <signal.h>
25 #include <stdatomic.h>
26 #include <stdbool.h>
28 
45 extern atomic_bool shutdownFlag;
46 extern atomic_bool rotateNow;
47 extern atomic_bool pauseLog;
48 
50 void signalShutdown(int signnum);
51 
53 void signalRotate(int signnum);
54 
56 void signalPause(int signnum);
57 
59 void signalUnpause(int signnum);
63 void signalHandlersInstall(void);
64 
66 sigset_t *signalHandlerMask(void);
67 
69 void signalHandlersBlock(void);
70 
72 void signalHandlersUnblock(void);
73 #endif
void signalHandlersUnblock(void)
Unblock signals that we have handlers for.
sigset_t * signalHandlerMask(void)
Return a signal mask with suitable defaults.
void signalHandlersInstall(void)
Install signal handlers.
void signalHandlersBlock(void)
Block signals that we have handlers for.
void signalShutdown(int signnum)
Set safe shutdown flag.
Definition: LoggerSignals.c:59
void signalRotate(int signnum)
Set log rotate flag.
Definition: LoggerSignals.c:73
void signalPause(int signnum)
Set logger pause flag.
Definition: LoggerSignals.c:87
atomic_bool pauseLog
Pause logging.
Definition: LoggerSignals.c:50
atomic_bool rotateNow
Trigger immediate log rotation.
Definition: LoggerSignals.c:42
void signalUnpause(int signnum)
Clear logger pause flag.
atomic_bool shutdownFlag
Trigger clean software shutdown.
Definition: LoggerSignals.c:34