From owner-freebsd-hackers Tue Apr 20 8:56:58 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from citadel.cdsec.com (citadel.cdsec.com [192.96.22.18]) by hub.freebsd.org (Postfix) with ESMTP id 2E8FD151B3 for ; Tue, 20 Apr 1999 08:56:51 -0700 (PDT) (envelope-from gram@cdsec.com) Received: (from nobody@localhost) by citadel.cdsec.com (8.9.3/8.9.3) id RAA12110 for ; Tue, 20 Apr 1999 17:54:21 +0200 (SAST) Received: by citadel via recvmail id 12048; Tue Apr 20 17:53:26 1999 Message-ID: <371CA30F.6F84565B@cdsec.com> Date: Tue, 20 Apr 1999 17:53:52 +0200 From: Graham Wheeler X-Mailer: Mozilla 4.08 [en] (X11; I; FreeBSD 2.2.8-RELEASE i386) MIME-Version: 1.0 To: hackers@freebsd.org Subject: Re: Using select() to implement a delay References: <199904201316.PAA23736@labinfo.iet.unipi.it> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Luigi Rizzo wrote: > > > > I have an interesting problem. I have a routine to implement delays: > ... > > > I am using this both because it gives better resolution than sleep(), > > > and also because it doesn't require the use of SIGALRM, which I am > > > using elsewhere. > > > > Do you have any reasons not to use usleep(3) or nanosleep(2)? > > portability to other unixes... As well as the fact that usleep uses signals. I am trying to avoid using signals, as there is a Timer C++ class in the same library which implements timeouts for system calls using SIGALRM (and a SignalHandler class), and I want to be able to use the Timer class in the same code as the Sleep routine should the need arise. -- Dr Graham Wheeler E-mail: gram@cdsec.com Citadel Data Security Phone: +27(21)423-6065/6/7 Firewalls/Virtual Private Networks Fax: +27(21)24-3656 Internet/Intranet Network Specialists Data Security Products WWW: http://www.cdsec.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message