Re: Automatic notification to application based on system date and



On a sunny day (Thu, 28 Sep 2006 13:01:41 -0400) it happened Joe Beanfish
<joe@xxxxxxxxxx> wrote in <efgv5l$q5k@xxxxxxxxxxxxxxxxxxxxx>:

Josef Moellers wrote:
dadu wrote:
Hello guys,

I need OS support in my application to receive signal or event from OS
when I configure it for particular date and time. In short, I am
expecting OS notification in my application on particular date and
time. Can anybody please help me on, how to implement this on linux?

You might want to look at alarm(2).


Thank you. I was reading this thread and thought everyone lost their
mind suggesting polling, other programs signalling, cron, etc.

Well, you may be right with 'alarm()', but it requires you to first
find out the seconds in the future from your year, month, day, hour etc.
with time_t timelocal (struct tm *BROKENTIME) anytime you start up
your application.
So you fill in struct tm with your date, and then use timelocal() to
set a time_t value for alarm.
But if your program has any sort of polling loop you can just as well
poll with mktime() and friends, _ESPECIALLY_ if it uses alarm() to display
a clock!!

So, that is how I do it here:
http://panteltje.com/panteltje/satellite/xdipo-0.6.8.1.tgz
note the clock, and in an other couple TV applications, such a xcha.
These have a linked list with timers, ftp://panteltje.com/pub/xdipo2.jpg

So it all depends, this one needs to be running all the time, but so does yours.
I like the solution using 'at' mentioned here.






.



Relevant Pages

  • [2.6.16 PATCH] some tail whitespace clean under subdirectory kernel
    ... These must match for thread signalling to apply */ ... struct sigqueue *sigqueue_alloc ... * setuid() is implemented like SysV with SAVED_IDS ... - * like sendmail, for example, cannot set its uid to be a normal ...
    (Linux-Kernel)
  • Re: [RFC patch 15/15] LTTng timestamp x86
    ... has a concept of "clock signal" other than for the signalling itself, ... POWER6 does to give us a timebase register that increments at 512MHz ... cores is less than the time taken for them to synchronize via a memory ...
    (Linux-Kernel)
  • Re: [RFC patch 15/15] LTTng timestamp x86
    ... They are almost inevitable for another reason too: the interconnect seldom ... has a concept of "clock signal" other than for the signalling itself, ... distribution. ...
    (Linux-Kernel)
  • Re: [RFC patch 15/15] LTTng timestamp x86
    ... has a concept of "clock signal" other than for the signalling itself, and the signal clock is designed for the signal itself and is designed for signal integrity rather than "stable clock". ... Does _any_ common interconnect have integral support for clock distribution? ... I have defitely seen machines with a common backplane clock source. ...
    (Linux-Kernel)
  • Re: ADSL signalling - what happens on the physical layer?
    ... Does any one have any ideas on where I can find information on ADSL ... signalling types? ... exchange to start the clock signal with ... The spec is fully given by ...
    (uk.telecom.broadband)