Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Sep 2002 13:22:30 -0300 (ART)
From:      Fernando Gleiser <fgleiser@cactus.fi.uba.ar>
To:        Martin McCormick <martin@dc.cis.okstate.edu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Time related Signal to Use in a Daemon
Message-ID:  <20020912132021.W2575-100000@cactus.fi.uba.ar>
In-Reply-To: <200209121616.g8CGGYw75354@dc.cis.okstate.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 12 Sep 2002, Martin McCormick wrote:

> 	Is there a way, short of poling gettimeofday, to get
> access to a signal that occurs periodically such as once per
> second?

yes. man alarm(2) or setitimer(2)


			Fer

>
> 	I want to capture serial data to a log file and then
> have the daemon close that file and open another one after so
> many seconds have passed.
>
> 	The data being logged are sent in a continuous stream so
> my file switching program mustn't loose
> any data while the switch is happening, but I figure a small
> buffer will take care of that.
>
> 	I mainly want the program to be able to switch files and
> also know if data have stopped coming in to the system after a
> specific amount of time.
>
> 	Both functions need to know at least of the passing of
> seconds.
>
> 	I read the man page on signals but was not sure if that
> is an appropriate use of signals or, for that matter, whether
> there is a time tick signal that one can catch which certainly
> would allow one to do exactly these sorts of things.
>
> Martin McCormick WB5AGZ  Stillwater, OK
> OSU Center for Computing and Information Services Network Operations Group
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020912132021.W2575-100000>