Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 1999 10:02:44 -0600
From:      Wes Peters <wes@softweyr.com>
To:        Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc:        gram@cdsec.com, hackers@FreeBSD.ORG
Subject:   Re: Using select() to implement a delay
Message-ID:  <371CA524.400D66F8@softweyr.com>
References:  <199904201316.PAA23736@labinfo.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?371CA524.400D66F8>