From owner-freebsd-questions Thu Sep 12 9:16:37 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 9A9B737B400 for ; Thu, 12 Sep 2002 09:16:35 -0700 (PDT) Received: from dc.cis.okstate.edu (dc.cis.okstate.edu [139.78.100.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D32843E65 for ; Thu, 12 Sep 2002 09:16:35 -0700 (PDT) (envelope-from martin@dc.cis.okstate.edu) Received: from dc.cis.okstate.edu (localhost [127.0.0.1]) by dc.cis.okstate.edu (8.11.6/8.11.6) with ESMTP id g8CGGYw75354 for ; Thu, 12 Sep 2002 11:16:34 -0500 (CDT) (envelope-from martin@dc.cis.okstate.edu) Message-Id: <200209121616.g8CGGYw75354@dc.cis.okstate.edu> Reply-To: martin@dc.cis.okstate.edu To: freebsd-questions@freebsd.org Subject: Time related Signal to Use in a Daemon Date: Thu, 12 Sep 2002 11:16:34 -0500 From: Martin McCormick 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 Is there a way, short of poling gettimeofday, to get access to a signal that occurs periodically such as once per second? 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