aboutsummaryrefslogtreecommitdiff
path: root/support/support.h
diff options
context:
space:
mode:
Diffstat (limited to 'support/support.h')
-rw-r--r--support/support.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/support/support.h b/support/support.h
index 874204b7fc..9ec8ecb8d7 100644
--- a/support/support.h
+++ b/support/support.h
@@ -24,6 +24,7 @@
#define SUPPORT_H
#include <stdbool.h>
+#include <stdint.h>
#include <stddef.h>
#include <sys/cdefs.h>
/* For mode_t. */
@@ -153,6 +154,16 @@ extern bool support_select_modifies_timeout (void);
tv_usec larger than 1000000. */
extern bool support_select_normalizes_timeout (void);
+/* Create a timer that trigger after SEC seconds and NSEC nanoseconds. If
+ REPEAT is true the timer will repeat indefinitely. If CALLBACK is not
+ NULL, the function will be called when the timer expires; otherwise a
+ dummy empty function is used instead.
+ This is implemented with POSIX per-process timer with SIGEV_SIGNAL. */
+timer_t support_create_timer (uint64_t sec, long int nsec, bool repeat,
+ void (*callback)(int));
+/* Disable the timer TIMER. */
+void support_delete_timer (timer_t timer);
+
__END_DECLS
#endif /* SUPPORT_H */