This uses the same return type as tv_diff so we don't need to check for
integer overflow.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Jo-Philipp Wich <jo@mein.io>
Acked-by: John Crispin <john@phrozen.org>
return (int)td;
}
+int64_t uloop_timeout_remaining64(struct uloop_timeout *timeout)
+{
+ struct timeval now;
+
+ if (!timeout->pending)
+ return -1;
+
+ uloop_gettime(&now);
+
+ return tv_diff(&timeout->time, &now);
+}
+
int uloop_process_add(struct uloop_process *p)
{
struct uloop_process *tmp;
int uloop_timeout_set(struct uloop_timeout *timeout, int msecs);
int uloop_timeout_cancel(struct uloop_timeout *timeout);
int uloop_timeout_remaining(struct uloop_timeout *timeout);
+int64_t uloop_timeout_remaining64(struct uloop_timeout *timeout);
int uloop_process_add(struct uloop_process *p);
int uloop_process_delete(struct uloop_process *p);