Messages in this thread | | | Subject | Re: Real time clock update notification | From | Colin Walters <> | Date | Sat, 28 Jan 2012 09:26:54 -0500 |
| |
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
| |