B20.1: It takes hitting RET key twice to make select() recognize input from stdin

Kazuhisa Ichikawa ki@home.email.ne.jp
Fri May 21 07:38:00 GMT 1999


Hi,

Under cygwin b20.1, select() does not correctly detect input from stdin. That is,
if I type a character and hit RET key once, select() returns 0 as the number of
bits set in the bit masks. If I hit the RET key the second time, select()
correctly returns 1.

To reproduce the problem, just compile the attached test case and run it as:

        gcc -g -o select_test.exe select_test.c
        ./select_test.exe

This same program, when compiled and run on Solaris 2.5.1, behaves correctly. That
is, select() correctly returns 1 when I type a character and hit RET key once. I
don't have to hit RET key twice.

Here is the output from cygcheck -s -v -r under my cygwin environment:

=====
Cygnus Win95/NT Configuration Diagnostics
Current System Time: Fri May 21 18:29:02 1999

WinNT Ver 4.0 build 1381 Service Pack 3

Path:   /cygnus/cygwin-b20/H-I586-cygwin32/bin
        /fsf/mule/bin
        /Oracle/ORANT/bin
        /ACTIVE~1/Perl/bin
        /UTILS
        /WINNT/system32
        /WINNT
        /Sun/Jdk117b/bin
        /Sun/Jsdk20/bin
        /bea/m3/bin
        /IMNnq_NT
        /MICROS~1/MICROS~1/Office
        /Program Files/Microsoft Visual Studio/Common/MSDev98/Bin
        /Program Files/Microsoft Visual Studio/Common/Tools
        /Program Files/Microsoft Visual Studio/VC98/bin

SysDir: C:\WINNT\System32
WinDir: C:\WINNT

MAKE_MODE = `UNIX'
PWD = `/Workshop/cygwin'

!EXITCODE = `00000000'
!C: = `C:\Cygnus\cygwin-b20'
CLASSPATH = `C:\Oracle\JDBC\lib\classes111.zip;.'
COMPUTERNAME = `BEA'
COMSPEC = `C:\WINNT\system32\cmd.exe'
EUID = `500'
HOMEDRIVE = `C:'
HOMEPATH = `\users\default'
HOSTNAME = `bea'
HOSTTYPE = `i586'
IBMVACLASSPATH = `c:\ibm\vjava\eab\runtime20;'
IMNINSTSRV = `c:\IMNnq_NT'
IMQCONFIGCL = `c:\IMNnq_NT\instance\DBCSHELP'
IMQCONFIGSRV = `c:\IMNnq_NT\instance'
INCLUDE = `C:\Program Files\Microsoft Visual Studio\VC98\include;c:\program
files\devstudio\vc\include;c:\program files\devstudio\vc\atl\include;c:\program files\devstudio\vc\mfc\include;%include%'
LIB = `C:\Program Files\Microsoft Visual Studio\VC98\lib;c:\program
files\devstudio\vc\lib;c:\program files\devstudio\vc\mfc\lib;%lib%'
LOGONSERVER = `\\BEA'
MACHTYPE = `i586-pc-cygwin32'
MSDEVDIR = `C:\Program Files\Microsoft Visual Studio\Common\MSDev98;C:\Program Files\DevStudio\SharedIDE'
NETSCAPE = `C:\Netscape\SuiteSpot'
NUMBER_OF_PROCESSORS = `1'
OS2LIBPATH = `C:\WINNT\system32\os2\dll;'
OS = `Windows_NT'
OSTYPE = `cygwin32'
PATHEXT = `.COM;.EXE;.BAT;.CMD'
PROCESSOR_ARCHITECTURE = `x86'
PROCESSOR_IDENTIFIER = `x86 Family 5 Model 4 Stepping 4, GenuineIntel'
PROCESSOR_LEVEL = `5'
PROCESSOR_REVISION = `0404'
PROMPT = `$P$G'
PS1 = `\s_\$ '
SHELL = `/bin/sh'
SHLVL = `1'
SYSTEMDRIVE = `C:'
SYSTEMROOT = `C:\WINNT'
TEMP = `C:\TEMP'
TERM = `cygwin'
TMP = `C:\TEMP'
TRANSLATE = `SJIS'
TUXDIR = `c:\bea\m3'
UID = `500'
USERDOMAIN = `BEA'
USERNAME = `tuxedo'
USERPROFILE = `C:\WINNT\Profiles\tuxedo'
WINDIR = `C:\WINNT'
_ = `/cygnus/cygwin-b20/H-I586-cygwin32/bin/cygcheck'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00
  (default) = `\\.\tape1:'
  unix = `/dev/st1'
  fbinary = 0x00000000
  fsilent = 0x00000001
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01
  (default) = `\\.\tape0:'
  unix = `/dev/st0'
  fbinary = 0x00000000
  fsilent = 0x00000001
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02
  (default) = `\\.\b:'
  unix = `/dev/fd1'
  fbinary = 0x00000000
  fsilent = 0x00000001
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03
  (default) = `\\.\a:'
  unix = `/dev/fd0'
  fbinary = 0x00000000
  fsilent = 0x00000001
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04
  (default) = `C:'
  unix = `/'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin B20
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin B20\B20.1
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\05
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\06
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\07
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\08
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\09
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0A
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0B
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0C
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0D
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0E
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0F
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\10
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\11
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\12
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\13
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\14
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\15
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\16
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\17
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\18
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\19
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1A
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1B
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1C
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1D
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro\i586-cygwin32
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro\i586-cygwin32\i586-cygwin32
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro\i586-cygwin32\i586-cygwin32\cygwin-B20.1
  (default) = `c:\cygnus\cygwin-b20'
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cygnus
Cygwin B20
  (default) = `C:\WINNT\IsUninst.exe -fc:\cygnus\cygwin-b20\Uninst.isu'
  DisplayName = `Cygwin B20'

a:\ fd           N/A    N/A                    
c:\ hd  NTFS    2015Mb  80% CP CS UN PA FC     
d:\ cd           N/A    N/A                    

C:          /         native  text!=binary
\\.\a:      /dev/fd0  native  text!=binary
\\.\b:      /dev/fd1  native  text!=binary
\\.\tape0:  /dev/st0  native  text!=binary
\\.\tape1:  /dev/st1  native  text!=binary

Found: C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\bash.exe
Found: C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\cat.exe
Not Found: cpp (good!)
Found: C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\find.exe
Found: C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\gcc.exe
Found: C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\gdb.exe
Found: C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\ld.exe
Found: C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\ls.exe
Found: C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\make.exe
Found: C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\sh.exe

  371k 1998/12/01 C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\cygtcl80.dll - os=4.0
img=1.0 sys=4.0
                  "cygtcl80.dll" v0.0 ts=1998/12/1 17:25
    5k 1998/12/01 C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\cygtclpip80.dll -
os=4.0 img=1.0 sys=4.0
   10k 1998/12/01 C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\cygtclreg80.dll -
os=4.0 img=1.0 sys=4.0
                  "cygtclreg80.dll" v0.0 ts=1998/12/1 17:25
  600k 1998/12/01 C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\cygtk80.dll - os=4.0
img=1.0 sys=4.0
                  "cygtk80.dll" v0.0 ts=1998/12/1 17:28
  446k 1998/12/03 C:\cygnus\cygwin-b20\H-I586-cygwin32\bin\cygwin1.dll - os=4.0
img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=1998/12/4 13:39
Use -h to see help about each section
=====

-- 
Kazuhisa Ichikawa
Kawasaki Japan
ki@home.email.ne.jp


More information about the Cygwin mailing list