lkml.org 
[lkml]   [2012]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Real time clock update notification
From
Date
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



\
 
 \ /
  Last update: 2012-01-28 15:29    [W:0.065 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site