UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » Processes
  • » setting up a signal to be delivered at a specified local time

#1 2008-10-23 11:40 AM

sharique
Member
Registered: 2008-07-29
Posts: 5

Re: setting up a signal to be delivered at a specified local time

Hi all,
      Is it possible to setup a signal handler which will be called at a particular time?
say 12.00 am, I do not want to set up SIGALRM which will be send when the specified number of seconds expires
Thanks

Offline

#2 2008-10-23 01:34 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: setting up a signal to be delivered at a specified local time

Well, I'm not sure why you rule out SIGALRM...  You could simply calculate how long
until your target time arrives, and just use alarm() or setitimer()...  Just calculate the
time_t for the target time (fill in a struct tm and call mktime() on it), then subtract off the
current time(NULL) value to obtain the number of seconds from now your target time is...

Offline

  • Index
  • » Processes
  • » setting up a signal to be delivered at a specified local time

Board footer

Powered by FluxBB