Subject: Re: Strange select behaviour in b19
From: [email-masked]

12 Mar 1998 07:58:35 -0800
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
To: [email-masked]

>   Ian Collins ([email-masked])
>   Wed, 11 Mar 1998 13:32:57 +1300
>       
>The easiest way to describe the wrong behaviour is to run the following
>program.
>After 5 seconds it will time out.
>After another 5 seconds, the screen scrolls with continuous timeout
>messages (select returns zero).
>
>However, if you run the program and immediately input a character (don't
>forget the ENTER as the
>program doesn't set tty to raw), then the select works fine.
>
>Does anyone have an explanation/fix for this.
>
>  struct fd_set readfds;
>  struct timeval timeout;
>  int nfound;
>  int i;
>  char c[1];
>
>  while (1) {
>    FD_SET(0,&readfds);
>    timeout.tv_sec=5; /* time out after 5 seconds */
>    timeout.tv_usec= 0;
>    nfound = select( 1, &readfds, 0, 0, &timeout);

Looks a lot like a similar problem in lynx.  The lynx fix
was to set timeout.tv_usec=5000 (we're talking milliseconds).
If that works for you, than at least cygnus is consistent.

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".