]>
Commit | Line | Data |
---|---|---|
faeb1b64 KZ |
1 | /* |
2 | * No copyright is claimed. This code is in the public domain; do with | |
3 | * it what you wish. | |
4 | */ | |
26e8964b KZ |
5 | #ifndef UTIL_LINUX_TIMER_H |
6 | #define UTIL_LINUX_TIMER_H | |
7 | ||
8 | #include <signal.h> | |
9 | #include <sys/time.h> | |
10 | ||
6df5acf9 KZ |
11 | #ifdef HAVE_TIMER_CREATE |
12 | struct ul_timer { | |
13 | timer_t t_id; | |
14 | }; | |
15 | #else | |
16 | struct ul_timer { | |
17 | struct itimerval old_timer; | |
18 | struct sigaction old_sa; | |
19 | }; | |
20 | #endif | |
21 | ||
22 | extern int setup_timer(struct ul_timer *timer, struct itimerval *timeout, | |
26e8964b | 23 | void (*timeout_handler)(int, siginfo_t *, void *)); |
6df5acf9 | 24 | extern void cancel_timer(struct ul_timer *timer); |
26e8964b KZ |
25 | |
26 | #endif /* UTIL_LINUX_TIMER_H */ |