From owner-freebsd-hackers Tue Apr 20 9: 5:39 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from obie.softweyr.com (unknown [204.68.178.33]) by hub.freebsd.org (Postfix) with ESMTP id E58C514CEA for ; Tue, 20 Apr 1999 09:05:32 -0700 (PDT) (envelope-from wes@softweyr.com) Received: from softweyr.com (homer.softweyr.com [204.68.178.39]) by obie.softweyr.com (8.8.8/8.8.8) with ESMTP id KAA27929; Tue, 20 Apr 1999 10:02:45 -0600 (MDT) (envelope-from wes@softweyr.com) Message-ID: <371CA524.400D66F8@softweyr.com> Date: Tue, 20 Apr 1999 10:02:44 -0600 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.5 [en] (X11; U; FreeBSD 3.1-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Luigi Rizzo Cc: gram@cdsec.com, 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... Non-Posix ones? Do any of those exist anymore? I just checked NetBSD, Solaris, and Linux, it exists on all of those. Apparently it doesn't on SunOS 4.1.4, which is odd, since that was 4.3BSD. I'd still suggest an #ifdef test in the code and use nanosleep where- ever it is available. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC http://www.softweyr.com/~softweyr wes@softweyr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message