From owner-freebsd-questions Thu Sep 12 9:25:13 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB9E237B400 for ; Thu, 12 Sep 2002 09:25:10 -0700 (PDT) Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0112E43E4A for ; Thu, 12 Sep 2002 09:25:10 -0700 (PDT) (envelope-from fgleiser@cactus.fi.uba.ar) Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by cactus.fi.uba.ar (8.12.3/8.11.6) with ESMTP id g8CGMV97091878; Thu, 12 Sep 2002 13:22:31 -0300 (ART) (envelope-from fgleiser@cactus.fi.uba.ar) Date: Thu, 12 Sep 2002 13:22:30 -0300 (ART) From: Fernando Gleiser To: Martin McCormick Cc: freebsd-questions@freebsd.org Subject: Re: Time related Signal to Use in a Daemon In-Reply-To: <200209121616.g8CGGYw75354@dc.cis.okstate.edu> Message-ID: <20020912132021.W2575-100000@cactus.fi.uba.ar> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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