Re: Automatic notification to application based on system date and time (Monta-vista linux)
- From: Lajos Parkatti <lparkatt@xxxxxxxxxxx>
- Date: 28 Sep 2006 17:32:35 +0300
Jan Panteltje <pNaonStpealmtje@xxxxxxxxx> writes:
On a sunny day (28 Sep 2006 03:53:15 -0700) it happened "dadu"
<amol.bhopale@xxxxxxxxx> wrote in
<1159440795.332584.175310@xxxxxxxxxxxxxxxxxxxxxxxxxxx>:
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?
Your program could poll getdate() every second, and compare year, month,
monthday, hour, minute and second to your 'setpoint'.
Why? Check the date when the program starts and from time to time
under normal operation. When the configured time is approaching you
can set a timer (or you could have a timer to make the checks
regularly, if there otherwise is no code guaranteed to execute "from
time to time").
You can also use crontab to start a program, but I think crontab does not
care about years.
No big deal: as the program starts or gets a signal it can make more
detailed checks. The thing to look out for is that cron doesn't do
things retroactively: if the time was missed (because of downtime, day
light saving time, setting the system clock, whatever) you will never
know.
Polling getdate() once a second is not a big system load.
But is unnecessary and probably makes the program more complicated.
--
Lajos Parkatti
.
- Follow-Ups:
- References:
- Prev by Date: Re: Automatic notification to application based on system date and time (Monta-vista linux)
- Next by Date: Re: Automatic notification to application based on system date and time (Monta-vista linux)
- Previous by thread: Re: Automatic notification to application based on system date and time (Monta-vista linux)
- Next by thread: Re: Automatic notification to application based on system date and time (Monta-vista linux)
- Index(es):
Relevant Pages
|