DragonFly BSD
DragonFly commits List (threaded) for 2005-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/lib/libc/sys select.2


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Wed, 3 Aug 2005 17:33:50 +0200
Mail-followup-to: commits@crater.dragonflybsd.org

On Wed, Aug 03, 2005 at 08:13:41AM -0700, Matthew Dillon wrote:
>:>Note that select behaves like sleep(3) when no descriptors are being checked.
> :
> :Please correct it to point to usleep or nanosleep, that comparision is
> :much more appropiate.
> :
> :Joerg
> 
>     Even nanosleep and usleep are wrong, since nanosleep uses a struct timespec
>     and select uses a struct timeval.
> 
>     Select's timeout is rounded up to the nearest clock tick, while (our) 
>     nanosleep's timeout tries to be a lot more precise.

They are not identical, but nanosleep has been emulated using select in
the past, that's why it is more appriopiate to point to it. sleep just
doesn't have any precision below seconds, so it's clearly no match.

The question of timespec vs. timeval isn't a big deal, we just don't
have pselect. I'm not sure if the rounding of select's timeout is
necessary, but it definitely is convient for the kernel.

Joerg



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]