delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/03/12/07:58:35

From: afn06760 AT afn DOT org
Subject: Re: Strange select behaviour in b19
12 Mar 1998 07:58:35 -0800 :
Message-ID: <199803110855.IAA135250.cygnus.gnu-win32@out2.ibm.net>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

>   Ian Collins (Ian AT kiwiplan DOT co DOT nz)
>   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
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019