Re: Real time clock update notification

From: Colin Walters
Date: Sat Jan 28 2012 - 09:27:43 EST


On Fri, 2012-01-27 at 14:52 -0800, Bob Richmond wrote:
> Is there any kind of facility for a process that is blocking in any one
> of the event notification system calls (select/poll/epoll_wait) to be
> unblocked in the event that the realtime clock has been updated? For
> instance, say I want to fire off an event at the exact moment that the
> realtime clock flips to 2pm. I first query the realtime clock via
> clock_gettime(CLOCK_REALTIME), and know that in 3 hours, it will be 2pm
> and I want to unblock at that moment. So I block in epoll_wait for 3 hours.

You're looking for "timerfd". Our use in GNOME is here:

http://git.gnome.org/browse/gnome-desktop/tree/libgnome-desktop/gnome-datetime-source.c

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/