[1200] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Re: select: strange behaviour

daemon@ATHENA.MIT.EDU (Alan Cox)
Wed Oct 11 11:05:33 1995

From: Alan Cox <alan@cymru.net>
To: norbert@taz.de (Norbert Thies)
Date: Tue, 10 Oct 1995 09:45:20 +0100 (BST)
Cc: linux-net@vger.rutgers.edu
In-Reply-To: <Pine.SV4.3.91.951009093146.23127A-100000@mogli> from "Norbert Thies" at Oct 9, 95 09:47:00 am

> The following code fragment may document it:
> 
>   struct timeval tv;
>   tv.tv_sec =  1;
>   tv.tv_usec =  0;
>   select ( 0, 0, 0, 0, &tv );
> 
> After the timeout has expired, tv.tv_sec == 0,
> ie. the value of 'tv' has been changed in 'select'.
> Since all other *IX systems I tried, do preserve
> the original value it breaks code (actually: archie-1.4.1).
> 
> Do you consider this behaviour a feature or is it a bug?

Read the original BSD manual page. It explicitly states that a future
version of select may update the timer value. The BSD people never got
around to finishing the job. Linux did.

Alan


home help back first fref pref prev next nref lref last post