From 378543e13f93c522b976efddd1610a19a6601b1c Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 9 Feb 2015 23:18:09 +0000 Subject: flock: improve timeout handling Signal ALRM raised by the timer, and the timer only, will be considered as a timeout criteria. Secondly time interval is made to use monotonic clock. Documentation of ITIMER_REAL is unclear whether that time is affected various sources of clock skew, or does it even tick when system is suspended. Reviewed-by: Karel Zak Signed-off-by: Sami Kerola --- include/monotonic.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/monotonic.h') diff --git a/include/monotonic.h b/include/monotonic.h index f3b03d3d0..d5ff7c8e5 100644 --- a/include/monotonic.h +++ b/include/monotonic.h @@ -8,4 +8,8 @@ extern int get_boot_time(struct timeval *boot_time); extern int gettime_monotonic(struct timeval *tv); +extern int setup_timer(timer_t * t_id, struct itimerval *timeout, + void (*timeout_handler)(void)); +extern void cancel_timer(timer_t * t_id); + #endif /* UTIL_LINUX_BOOTTIME_H */ -- cgit v1.2.3-55-g7522