]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/lib/watchdog.h
o fix : restore a crypted stream on a fd witch doen't define keys cause
[bacula/bacula] / bacula / src / lib / watchdog.h
1 /*
2  * Watchdog timer routines
3  *
4  *    Kern Sibbald, December MMII
5  *
6 */
7 /*
8    Copyright (C) 2002-2006 Kern Sibbald
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License
12    version 2 as amended with additional clauses defined in the
13    file LICENSE in the main source directory.
14
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
18    the file LICENSE for additional details.
19
20  */
21
22 enum {
23    TYPE_CHILD = 1,
24    TYPE_PTHREAD,
25    TYPE_BSOCK
26 };
27
28 #define TIMEOUT_SIGNAL SIGUSR2
29
30 struct s_watchdog_t {
31         bool one_shot;
32         time_t interval;
33         void (*callback)(struct s_watchdog_t *wd);
34         void (*destructor)(struct s_watchdog_t *wd);
35         void *data;
36         /* Private data below - don't touch outside of watchdog.c */
37         dlink link;
38         time_t next_fire;
39 };
40 typedef struct s_watchdog_t watchdog_t;
41
42 /* Exported globals */
43 extern time_t DLL_IMP_EXP watchdog_time;             /* this has granularity of SLEEP_TIME */
44 extern time_t DLL_IMP_EXP watchdog_sleep_time;      /* examine things every 60 seconds */