Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Apr 1999 11:22:12 +0200
From:      Graham Wheeler <gram@cdsec.com>
To:        hackers@freebsd.org
Subject:   Re: Using select() to implement a delay
Message-ID:  <371D98C4.DC0E61D1@cdsec.com>
References:  <199904201316.PAA23736@labinfo.iet.unipi.it> <371CA30F.6F84565B@cdsec.com> <371D234A.E5C2AD8D@softweyr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Wes Peters wrote:
> 
> Graham Wheeler wrote:
> >
> > As well as the fact that usleep uses signals.
> 
> Whatever gave you that idea?  From the 3.1 man page for usleep:
> 
>      This function is implemented using nanosleep(2) by pausing for
>      microseconds microseconds or until a signal occurs.  Consequently, in
>      this implementation, sleeping has no effect on the state of process
>      timers, and there is no special handling for SIGALRM.

I saw that. But I also looked at the source. The thread-safe 
implementation calls microsleep; the non-thread safe implementation
uses itimers and messes with SIGALRM handling (that is in 2.2.7).
My code needs to run on FreeBSD 2.2.2 and later. So I'm playing safe.

-- 
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




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