[1179] in linux-net channel archive

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

select: strange behaviour

daemon@ATHENA.MIT.EDU (Norbert Thies)
Mon Oct 9 16:58:13 1995

Date: Mon, 9 Oct 1995 09:47:00 +0100 (MET)
From: Norbert Thies <norbert@taz.de>
To: linux-net@vger.rutgers.edu
In-Reply-To: <459feb$6bq@nz12.rz.uni-karlsruhe.de>

Hi netters,
using kernel 1.2.10 and libc-5.0.9 I observed some strange
behaviour of select(2). 
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?

ciao,
_____
Norbert Thies (norbert@taz.de); die tageszeitung, Berlin/Germany

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