public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Cygwin select + sockets from DLL
@ 1999-11-19  5:28 Earnie Boyd
  1999-11-19  5:52 ` Cygnus - Admin
  1999-11-30 23:39 ` Earnie Boyd
  0 siblings, 2 replies; 14+ messages in thread
From: Earnie Boyd @ 1999-11-19  5:28 UTC (permalink / raw)
  To: Peter Hudson +44 1892 541 720, cygwin

--- Peter Hudson +44 1892 541 720 <peter@telnet-research.co.uk> wrote:
> Hello
> 
> I am trying to use a B20.1 select call to wait for a read event
> on a socket, but the select never returns. This socket was created
> by a DLL that is not mine.
> 
> The socket has a file descriptor value of a number greater than 63.
> Hence when a use FD_SET to create the read mask for the select,
> there aren't enough bits in the mask. The mask just remains as 0,0 ,
> which is why the select doesn't return.
> 
> In sys/types.h I can see:
> #       define  FD_SETSIZE      64
> 
> which is why my file descriptor values do not fit in an fd_mask.
> 
> I can also see the comment in this file:
> "We don't define fd_set and friends if we are compiling POSIX
>    source, or if we have included the Windows Sockets.h header (which
>    defines Windows versions of them).  Note that a program which
>    includes the Windows sockets.h header must know what it is doing;
>    it must not call the cygwin32 select function."
> 
> I am not including the Windows sockets.h header, nor does the
> header file for the DLL include it. But presumably the DLL does
> use winsock-allocated sockets. Do I gather that I can't use these
> sockets with Cygwin select?
> 
> I am doing something wrong, or is there a way round this problem?
> 

Well, unless the third party software uses cygwin1.dll (which I doubt), then
based up the quoted comments you can't use the Cygwin select.  You must use the
Windows sockets.h header and function set.

=====
Earnie Boyd < mailto:earnie_boyd@yahoo.com >
Cygwin Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Cygwin select + sockets from DLL
  1999-11-19  5:28 Cygwin select + sockets from DLL Earnie Boyd
@ 1999-11-19  5:52 ` Cygnus - Admin
  1999-11-19  8:21   ` Chris Faylor
  1999-11-30 23:39   ` Cygnus - Admin
  1999-11-30 23:39 ` Earnie Boyd
  1 sibling, 2 replies; 14+ messages in thread
From: Cygnus - Admin @ 1999-11-19  5:52 UTC (permalink / raw)
  To: Earnie Boyd; +Cc: Peter Hudson +44 1892 541 720, cygwin

On Fri, 19 Nov 1999, Earnie Boyd wrote:
> 
> Well, unless the third party software uses cygwin1.dll (which I doubt), then
> based up the quoted comments you can't use the Cygwin select.  You must use the
> Windows sockets.h header and function set.
> 

are you serious? i can't use select() if i'm not gonna use the windows
header files?

I just started using the new cygwin to try and compile (under windows) a
unix-based chat server that I write. So far i've had numerous problems.

First, if i fork() the process twice to disassociate from the controlling
tty, windows gives me an illegal operation on startup. If I only fork()
once it goes by and forks, but as soon as it hits the select() in my
while() loop it stops and doesn't return. The program doesn't take
connections at all (connection refused)
If I DONT fork() the process to the background, the program works pretty
much fine, accept()'s multiple connections, etc..

Any help on this would be appreciated. Also looking for someone interested
in helping port this for windows use too..but that's another subject.

Here's a sample of my while loop..
        FD_ZERO(&readmask);
        FD_ZERO(&writemask);
        for (user = 0; user < MAX_USERS; ++user)
          {
            if (ustr[user].sock != -1) {
             FD_SET(ustr[user].sock,&readmask);
             if (ustr[user].output_size)
             FD_SET(ustr[user].sock,&writemask);
            }
          }
       for (i=0;i<4;++i) {
        /* Add the listening sockets to the read mask set */
        FD_SET(listen_sock[i],&readmask);
        }

#if defined(WIN32) && !defined(__CYGWIN32__)
        if (select(FD_SETSIZE, &readmask, &writemask, 0, 0) == SOCKET_ERROR) {
#else
        if (select(FD_SETSIZE, (void *) &readmask, (void *) &writemask,
(void *) 0, 0) == -1) {
#endif
         if (errno != EINTR) {
                sprintf(mess,"Select failed with error 
		(%d:%s)\n",errno,strerror(errno));
                print_to_syslog(mess);
                shutdown_error(log_error(9));
           }
         else continue;
        }


-Cygnus
.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-.
Anthony J. Biacco                       Network Administrator/Engineer
cygnus@ncohafmuta.com                    Intergrafix Internet Services

    "Dream as if you'll live forever, live as if you'll die today"
http://cygnus.ncohafmuta.com                http://www.intergrafix.net
.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-.



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Cygwin select + sockets from DLL
  1999-11-19  5:52 ` Cygnus - Admin
@ 1999-11-19  8:21   ` Chris Faylor
  1999-11-19  8:24     ` DJ Delorie
  1999-11-30 23:39     ` Chris Faylor
  1999-11-30 23:39   ` Cygnus - Admin
  1 sibling, 2 replies; 14+ messages in thread
From: Chris Faylor @ 1999-11-19  8:21 UTC (permalink / raw)
  To: Cygnus - Admin; +Cc: Earnie Boyd, Peter Hudson +44 1892 541 720, cygwin

On Fri, Nov 19, 1999 at 08:50:33AM -0500, Cygnus - Admin wrote:
>On Fri, 19 Nov 1999, Earnie Boyd wrote:
>>Well, unless the third party software uses cygwin1.dll (which I doubt),
>>then based up the quoted comments you can't use the Cygwin select.  You
>>must use the Windows sockets.h header and function set.
>
>are you serious?  i can't use select() if i'm not gonna use the windows
>header files?

He's serious and he's correct.  cygwin fd's != "fd"'s returned by a winsock
socket operation.  You can't use raw winsock file handles in cygwin select.
Cygwin maintains its own table of file descriptors so you can't mix cygwin
functions with non-cygwin file descriptors.

-Chris Faylor
-Cygwin Engineering Manager
-Cygnus Solutions

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Cygwin select + sockets from DLL
  1999-11-19  8:21   ` Chris Faylor
@ 1999-11-19  8:24     ` DJ Delorie
  1999-11-19 10:49       ` Chris Faylor
  1999-11-30 23:39       ` DJ Delorie
  1999-11-30 23:39     ` Chris Faylor
  1 sibling, 2 replies; 14+ messages in thread
From: DJ Delorie @ 1999-11-19  8:24 UTC (permalink / raw)
  To: cgf; +Cc: cygwin

> He's serious and he's correct.  cygwin fd's != "fd"'s returned by a
> winsock socket operation.  You can't use raw winsock file handles in
> cygwin select.  Cygwin maintains its own table of file descriptors
> so you can't mix cygwin functions with non-cygwin file descriptors.

Will the cygwin_attach_handle_to_fd() function help?

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Cygwin select + sockets from DLL
  1999-11-19  8:24     ` DJ Delorie
@ 1999-11-19 10:49       ` Chris Faylor
  1999-11-19 21:00         ` Unable to Type Lower Case e in the Bash Window Gus Baldauf
  1999-11-30 23:39         ` Cygwin select + sockets from DLL Chris Faylor
  1999-11-30 23:39       ` DJ Delorie
  1 sibling, 2 replies; 14+ messages in thread
From: Chris Faylor @ 1999-11-19 10:49 UTC (permalink / raw)
  To: DJ Delorie; +Cc: cygwin

On Fri, Nov 19, 1999 at 11:24:03AM -0500, DJ Delorie wrote:
>>He's serious and he's correct.  cygwin fd's != "fd"'s returned by a
>>winsock socket operation.  You can't use raw winsock file handles in
>>cygwin select.  Cygwin maintains its own table of file descriptors so
>>you can't mix cygwin functions with non-cygwin file descriptors.
>
>Will the cygwin_attach_handle_to_fd() function help?

Probably.  Then we'd be on to the next problem...

It's a valid suggestion, though.

-- 
cgf@cygnus.com
http://www.cygnus.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Unable to Type Lower Case e in the Bash Window
  1999-11-19 10:49       ` Chris Faylor
@ 1999-11-19 21:00         ` Gus Baldauf
  1999-11-30 23:39           ` Gus Baldauf
  1999-11-30 23:39         ` Cygwin select + sockets from DLL Chris Faylor
  1 sibling, 1 reply; 14+ messages in thread
From: Gus Baldauf @ 1999-11-19 21:00 UTC (permalink / raw)
  To: cygwin

Hello All,

I just installed Cygwin 1.0.  When I open a bash window and I try to type or
paste the lower case letter e, nothing appears in the window and the computer
beeps at me.  For example, I can not enter the commands cygcheck, exit, echo or
set.  All other upper and lower case letters work fine.

I have the same problem with Win95 OSR2 or WinNT 4 SP5.

I had been successfully using B20.1.

I have attached the output of cygcheck -s -v -r executed from cmd.exe.

TIA, Gus

Cygnus Win95/NT Configuration Diagnostics
Current System Time: Fri Nov 19 20:56:18 1999

WinNT Ver 4.0 build 1381 Service Pack 5

Path:	/bin
	/contrib/bin
	/cygdrive/e/mksnt
	/cygdrive/e/fndtn/bin/nt
	/cygdrive/e/WINNT4/system32
	/cygdrive/e/WINNT4
	/cygdrive/e/PROGRA~1/Tcl/bin
	/cygdrive/e/Program Files/InstallShield/InstallShield 5.5 Professional Edition/Program
	.
	/cygdrive/e/program files/NTReskit
	/cygdrive/e/Fndtn/bin/nt
	/cygdrive/e/vim/vim55
	/cygdrive/e/utils
	/cygdrive/c/ncftp
	/cygdrive/e/program files/devstudio/sharedide/bin/ide
	/cygdrive/e/program files/devstudio/sharedide/bin
	/cygdrive/e/program files/devstudio/vc/bin
	/cygdrive/d/orcadexe
	/cygdrive/d/xact
	/cygdrive/e/usr/bin
	/cygdrive/e/usr/local/bin

SysDir: E:\WINNT4\System32
WinDir: E:\WINNT4

HOME = `/cygdrive/e/home'
MAKE_MODE = `UNIX'

!E: = `E:\TEMP'
!EXITCODE = `00000000'
COMPUTERNAME = `CHARM'
COMSPEC = `E:\WINNT4\system32\cmd.exe'
GRMODE = `VGA16'
HOMEDRIVE = `E:'
HOMEPATH = `\users\default'
INCLUDE = `e:\program files\devstudio\vc\include;e:\program files\devstudio\vc\atl\include;e:\program files\devstudio\vc\mfc\include;%include%'
LIB = `e:\program files\devstudio\vc\lib;e:\program files\devstudio\vc\mfc\lib;%lib%'
LOGONSERVER = `\\CHARM'
MANPATH = `e:/etc'
MSDEVDIR = `E:\Program Files\DevStudio\SharedIDE'
MSINPUT = `E:\Program Files\Microsoft Hardware'
NTRESKIT = `E:\program files\NTReskit'
NUMBER_OF_PROCESSORS = `2'
ORCADESP = `C:\ORCADESP\'
ORCADEXE = `D:\ORCADEXE\'
ORCADPROJ = `D:\ORCAD\'
ORCADUSER = `C:\ORCADESP\'
OS = `Windows_NT'
OS2LIBPATH = `E:\WINNT4\system32\os2\dll;'
PAGER = `/bin/less'
PATHEXT = `.COM;.EXE;.BAT;.CMD'
PGPPATH = `e:\pgp262'
PROCESSOR_ARCHITECTURE = `x86'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 5 Stepping 3, GenuineIntel'
PROCESSOR_LEVEL = `6'
PROCESSOR_REVISION = `0503'
PROMPT = `$P$G'
ROOTDIR = `e:'
SHELL = `e:\cygwin\bin\bash.exe'
SYSTEMDRIVE = `E:'
SYSTEMROOT = `E:\WINNT4'
TEMP = `E:\TEMP'
TMP = `E:\TEMP'
TMPDIR = `f:/tmp'
TZ = `PST8PDT'
USERDOMAIN = `CHARM'
USERNAME = `gus'
USERPROFILE = `E:\WINNT4\Profiles\gus'
VIM = `e:/vim/vim55'
WINDIR = `E:\WINNT4'
XACT = `d:\xact;d:\xact.v4'
XACTUSER = `d:\xactuser'
XILINX = `E:\Fndtn'
TERM = `cygwin'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x00000020
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) = `w:'
  unix = `/w'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01
  (default) = `r:'
  unix = `/r'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02
  (default) = `f:'
  unix = `/f'
  fbinary = 0x00000001
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03
  (default) = `d:'
  unix = `/d'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04
  (default) = `c:'
  unix = `/c'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\05
  (default) = `b:'
  unix = `/b'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\06
  (default) = `a:'
  unix = `/a'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\07
  (default) = `e:'
  unix = `/'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\1.00.000
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = 0x0000000a
  native = `E:\Cygwin'
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

a:  fd           N/A    N/A                    
b:  fd           N/A    N/A                    
c:  hd  FAT      509Mb  14% CP    UN           DOS
d:  hd  FAT32   1189Mb  62% CP    UN           WIN98
e:  hd  NTFS    3506Mb  68% CP CS UN PA FC     text
f:  hd  NTFS    3506Mb  68% CP CS UN PA FC     data
r:  cd           N/A    N/A                    
w:  cd  CDUDFRW   529Mb  63% CP    UN           CD-RW_TEST

E:\Cygwin  /        system  binmode

Found: E:\Cygwin\bin\bash.exe
Found: e:\usr\bin\bash.exe
Warning: E:\Cygwin\bin\bash.exe hides e:\usr\bin\bash.exe
Found: E:\Cygwin\bin\cat.exe
Found: e:\mksnt\cat.exe
Warning: E:\Cygwin\bin\cat.exe hides e:\mksnt\cat.exe
Found: e:\program files\NTReskit\cat.exe
Warning: E:\Cygwin\bin\cat.exe hides e:\program files\NTReskit\cat.exe
Not Found: cpp (good!)
Found: E:\Cygwin\bin\find.exe
Found: e:\mksnt\find.exe
Warning: E:\Cygwin\bin\find.exe hides e:\mksnt\find.exe
Found: E:\Cygwin\bin\gcc.exe
Found: E:\Cygwin\bin\gdb.exe
Found: E:\Cygwin\bin\ld.exe
Found: E:\Cygwin\bin\ls.exe
Found: e:\mksnt\ls.exe
Warning: E:\Cygwin\bin\ls.exe hides e:\mksnt\ls.exe
Found: e:\program files\NTReskit\ls.exe
Warning: E:\Cygwin\bin\ls.exe hides e:\program files\NTReskit\ls.exe
Found: E:\Cygwin\bin\make.exe
Found: e:\mksnt\make.exe
Warning: E:\Cygwin\bin\make.exe hides e:\mksnt\make.exe
Found: E:\Cygwin\bin\sh.exe
Found: e:\mksnt\sh.exe
Warning: E:\Cygwin\bin\sh.exe hides e:\mksnt\sh.exe
Found: \bin\sh.exe
Warning: E:\Cygwin\bin\sh.exe hides \bin\sh.exe

  115k 1999/09/14 E:\Cygwin\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitcl30.dll" v0.0 ts=1999/9/13 19:46
   63k 1999/09/14 E:\Cygwin\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitk30.dll" v0.0 ts=1999/9/13 19:47
  474k 1999/09/14 E:\Cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtcl80.dll" v0.0 ts=1999/9/13 19:31
   19k 1999/09/14 E:\Cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0
   24k 1999/09/14 E:\Cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtclreg80.dll" v0.0 ts=1999/9/13 19:31
  768k 1999/09/14 E:\Cygwin\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtk80.dll" v0.0 ts=1999/9/13 19:36
  786k 1999/09/14 E:\Cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=1999/9/13 20:44
Use -h to see help about each section

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Cygwin select + sockets from DLL
  1999-11-19  5:28 Cygwin select + sockets from DLL Earnie Boyd
  1999-11-19  5:52 ` Cygnus - Admin
@ 1999-11-30 23:39 ` Earnie Boyd
  1 sibling, 0 replies; 14+ messages in thread
From: Earnie Boyd @ 1999-11-30 23:39 UTC (permalink / raw)
  To: Peter Hudson +44 1892 541 720, cygwin

--- Peter Hudson +44 1892 541 720 <peter@telnet-research.co.uk> wrote:
> Hello
> 
> I am trying to use a B20.1 select call to wait for a read event
> on a socket, but the select never returns. This socket was created
> by a DLL that is not mine.
> 
> The socket has a file descriptor value of a number greater than 63.
> Hence when a use FD_SET to create the read mask for the select,
> there aren't enough bits in the mask. The mask just remains as 0,0 ,
> which is why the select doesn't return.
> 
> In sys/types.h I can see:
> #       define  FD_SETSIZE      64
> 
> which is why my file descriptor values do not fit in an fd_mask.
> 
> I can also see the comment in this file:
> "We don't define fd_set and friends if we are compiling POSIX
>    source, or if we have included the Windows Sockets.h header (which
>    defines Windows versions of them).  Note that a program which
>    includes the Windows sockets.h header must know what it is doing;
>    it must not call the cygwin32 select function."
> 
> I am not including the Windows sockets.h header, nor does the
> header file for the DLL include it. But presumably the DLL does
> use winsock-allocated sockets. Do I gather that I can't use these
> sockets with Cygwin select?
> 
> I am doing something wrong, or is there a way round this problem?
> 

Well, unless the third party software uses cygwin1.dll (which I doubt), then
based up the quoted comments you can't use the Cygwin select.  You must use the
Windows sockets.h header and function set.

=====
Earnie Boyd < mailto:earnie_boyd@yahoo.com >
Cygwin Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Cygwin select + sockets from DLL
  1999-11-19  5:52 ` Cygnus - Admin
  1999-11-19  8:21   ` Chris Faylor
@ 1999-11-30 23:39   ` Cygnus - Admin
  1 sibling, 0 replies; 14+ messages in thread
From: Cygnus - Admin @ 1999-11-30 23:39 UTC (permalink / raw)
  To: Earnie Boyd; +Cc: Peter Hudson +44 1892 541 720, cygwin

On Fri, 19 Nov 1999, Earnie Boyd wrote:
> 
> Well, unless the third party software uses cygwin1.dll (which I doubt), then
> based up the quoted comments you can't use the Cygwin select.  You must use the
> Windows sockets.h header and function set.
> 

are you serious? i can't use select() if i'm not gonna use the windows
header files?

I just started using the new cygwin to try and compile (under windows) a
unix-based chat server that I write. So far i've had numerous problems.

First, if i fork() the process twice to disassociate from the controlling
tty, windows gives me an illegal operation on startup. If I only fork()
once it goes by and forks, but as soon as it hits the select() in my
while() loop it stops and doesn't return. The program doesn't take
connections at all (connection refused)
If I DONT fork() the process to the background, the program works pretty
much fine, accept()'s multiple connections, etc..

Any help on this would be appreciated. Also looking for someone interested
in helping port this for windows use too..but that's another subject.

Here's a sample of my while loop..
        FD_ZERO(&readmask);
        FD_ZERO(&writemask);
        for (user = 0; user < MAX_USERS; ++user)
          {
            if (ustr[user].sock != -1) {
             FD_SET(ustr[user].sock,&readmask);
             if (ustr[user].output_size)
             FD_SET(ustr[user].sock,&writemask);
            }
          }
       for (i=0;i<4;++i) {
        /* Add the listening sockets to the read mask set */
        FD_SET(listen_sock[i],&readmask);
        }

#if defined(WIN32) && !defined(__CYGWIN32__)
        if (select(FD_SETSIZE, &readmask, &writemask, 0, 0) == SOCKET_ERROR) {
#else
        if (select(FD_SETSIZE, (void *) &readmask, (void *) &writemask,
(void *) 0, 0) == -1) {
#endif
         if (errno != EINTR) {
                sprintf(mess,"Select failed with error 
		(%d:%s)\n",errno,strerror(errno));
                print_to_syslog(mess);
                shutdown_error(log_error(9));
           }
         else continue;
        }


-Cygnus
.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-.
Anthony J. Biacco                       Network Administrator/Engineer
cygnus@ncohafmuta.com                    Intergrafix Internet Services

    "Dream as if you'll live forever, live as if you'll die today"
http://cygnus.ncohafmuta.com                http://www.intergrafix.net
.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-.



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Cygwin select + sockets from DLL
  1999-11-19  8:24     ` DJ Delorie
  1999-11-19 10:49       ` Chris Faylor
@ 1999-11-30 23:39       ` DJ Delorie
  1 sibling, 0 replies; 14+ messages in thread
From: DJ Delorie @ 1999-11-30 23:39 UTC (permalink / raw)
  To: cgf; +Cc: cygwin

> He's serious and he's correct.  cygwin fd's != "fd"'s returned by a
> winsock socket operation.  You can't use raw winsock file handles in
> cygwin select.  Cygwin maintains its own table of file descriptors
> so you can't mix cygwin functions with non-cygwin file descriptors.

Will the cygwin_attach_handle_to_fd() function help?

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Cygwin select + sockets from DLL
  1999-11-19 10:49       ` Chris Faylor
  1999-11-19 21:00         ` Unable to Type Lower Case e in the Bash Window Gus Baldauf
@ 1999-11-30 23:39         ` Chris Faylor
  1 sibling, 0 replies; 14+ messages in thread
From: Chris Faylor @ 1999-11-30 23:39 UTC (permalink / raw)
  To: DJ Delorie; +Cc: cygwin

On Fri, Nov 19, 1999 at 11:24:03AM -0500, DJ Delorie wrote:
>>He's serious and he's correct.  cygwin fd's != "fd"'s returned by a
>>winsock socket operation.  You can't use raw winsock file handles in
>>cygwin select.  Cygwin maintains its own table of file descriptors so
>>you can't mix cygwin functions with non-cygwin file descriptors.
>
>Will the cygwin_attach_handle_to_fd() function help?

Probably.  Then we'd be on to the next problem...

It's a valid suggestion, though.

-- 
cgf@cygnus.com
http://www.cygnus.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Unable to Type Lower Case e in the Bash Window
  1999-11-19 21:00         ` Unable to Type Lower Case e in the Bash Window Gus Baldauf
@ 1999-11-30 23:39           ` Gus Baldauf
  0 siblings, 0 replies; 14+ messages in thread
From: Gus Baldauf @ 1999-11-30 23:39 UTC (permalink / raw)
  To: cygwin

Hello All,

I just installed Cygwin 1.0.  When I open a bash window and I try to type or
paste the lower case letter e, nothing appears in the window and the computer
beeps at me.  For example, I can not enter the commands cygcheck, exit, echo or
set.  All other upper and lower case letters work fine.

I have the same problem with Win95 OSR2 or WinNT 4 SP5.

I had been successfully using B20.1.

I have attached the output of cygcheck -s -v -r executed from cmd.exe.

TIA, Gus

Cygnus Win95/NT Configuration Diagnostics
Current System Time: Fri Nov 19 20:56:18 1999

WinNT Ver 4.0 build 1381 Service Pack 5

Path:	/bin
	/contrib/bin
	/cygdrive/e/mksnt
	/cygdrive/e/fndtn/bin/nt
	/cygdrive/e/WINNT4/system32
	/cygdrive/e/WINNT4
	/cygdrive/e/PROGRA~1/Tcl/bin
	/cygdrive/e/Program Files/InstallShield/InstallShield 5.5 Professional Edition/Program
	.
	/cygdrive/e/program files/NTReskit
	/cygdrive/e/Fndtn/bin/nt
	/cygdrive/e/vim/vim55
	/cygdrive/e/utils
	/cygdrive/c/ncftp
	/cygdrive/e/program files/devstudio/sharedide/bin/ide
	/cygdrive/e/program files/devstudio/sharedide/bin
	/cygdrive/e/program files/devstudio/vc/bin
	/cygdrive/d/orcadexe
	/cygdrive/d/xact
	/cygdrive/e/usr/bin
	/cygdrive/e/usr/local/bin

SysDir: E:\WINNT4\System32
WinDir: E:\WINNT4

HOME = `/cygdrive/e/home'
MAKE_MODE = `UNIX'

!E: = `E:\TEMP'
!EXITCODE = `00000000'
COMPUTERNAME = `CHARM'
COMSPEC = `E:\WINNT4\system32\cmd.exe'
GRMODE = `VGA16'
HOMEDRIVE = `E:'
HOMEPATH = `\users\default'
INCLUDE = `e:\program files\devstudio\vc\include;e:\program files\devstudio\vc\atl\include;e:\program files\devstudio\vc\mfc\include;%include%'
LIB = `e:\program files\devstudio\vc\lib;e:\program files\devstudio\vc\mfc\lib;%lib%'
LOGONSERVER = `\\CHARM'
MANPATH = `e:/etc'
MSDEVDIR = `E:\Program Files\DevStudio\SharedIDE'
MSINPUT = `E:\Program Files\Microsoft Hardware'
NTRESKIT = `E:\program files\NTReskit'
NUMBER_OF_PROCESSORS = `2'
ORCADESP = `C:\ORCADESP\'
ORCADEXE = `D:\ORCADEXE\'
ORCADPROJ = `D:\ORCAD\'
ORCADUSER = `C:\ORCADESP\'
OS = `Windows_NT'
OS2LIBPATH = `E:\WINNT4\system32\os2\dll;'
PAGER = `/bin/less'
PATHEXT = `.COM;.EXE;.BAT;.CMD'
PGPPATH = `e:\pgp262'
PROCESSOR_ARCHITECTURE = `x86'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 5 Stepping 3, GenuineIntel'
PROCESSOR_LEVEL = `6'
PROCESSOR_REVISION = `0503'
PROMPT = `$P$G'
ROOTDIR = `e:'
SHELL = `e:\cygwin\bin\bash.exe'
SYSTEMDRIVE = `E:'
SYSTEMROOT = `E:\WINNT4'
TEMP = `E:\TEMP'
TMP = `E:\TEMP'
TMPDIR = `f:/tmp'
TZ = `PST8PDT'
USERDOMAIN = `CHARM'
USERNAME = `gus'
USERPROFILE = `E:\WINNT4\Profiles\gus'
VIM = `e:/vim/vim55'
WINDIR = `E:\WINNT4'
XACT = `d:\xact;d:\xact.v4'
XACTUSER = `d:\xactuser'
XILINX = `E:\Fndtn'
TERM = `cygwin'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x00000020
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) = `w:'
  unix = `/w'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01
  (default) = `r:'
  unix = `/r'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02
  (default) = `f:'
  unix = `/f'
  fbinary = 0x00000001
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03
  (default) = `d:'
  unix = `/d'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04
  (default) = `c:'
  unix = `/c'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\05
  (default) = `b:'
  unix = `/b'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\06
  (default) = `a:'
  unix = `/a'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\07
  (default) = `e:'
  unix = `/'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\1.00.000
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = 0x0000000a
  native = `E:\Cygwin'
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

a:  fd           N/A    N/A                    
b:  fd           N/A    N/A                    
c:  hd  FAT      509Mb  14% CP    UN           DOS
d:  hd  FAT32   1189Mb  62% CP    UN           WIN98
e:  hd  NTFS    3506Mb  68% CP CS UN PA FC     text
f:  hd  NTFS    3506Mb  68% CP CS UN PA FC     data
r:  cd           N/A    N/A                    
w:  cd  CDUDFRW   529Mb  63% CP    UN           CD-RW_TEST

E:\Cygwin  /        system  binmode

Found: E:\Cygwin\bin\bash.exe
Found: e:\usr\bin\bash.exe
Warning: E:\Cygwin\bin\bash.exe hides e:\usr\bin\bash.exe
Found: E:\Cygwin\bin\cat.exe
Found: e:\mksnt\cat.exe
Warning: E:\Cygwin\bin\cat.exe hides e:\mksnt\cat.exe
Found: e:\program files\NTReskit\cat.exe
Warning: E:\Cygwin\bin\cat.exe hides e:\program files\NTReskit\cat.exe
Not Found: cpp (good!)
Found: E:\Cygwin\bin\find.exe
Found: e:\mksnt\find.exe
Warning: E:\Cygwin\bin\find.exe hides e:\mksnt\find.exe
Found: E:\Cygwin\bin\gcc.exe
Found: E:\Cygwin\bin\gdb.exe
Found: E:\Cygwin\bin\ld.exe
Found: E:\Cygwin\bin\ls.exe
Found: e:\mksnt\ls.exe
Warning: E:\Cygwin\bin\ls.exe hides e:\mksnt\ls.exe
Found: e:\program files\NTReskit\ls.exe
Warning: E:\Cygwin\bin\ls.exe hides e:\program files\NTReskit\ls.exe
Found: E:\Cygwin\bin\make.exe
Found: e:\mksnt\make.exe
Warning: E:\Cygwin\bin\make.exe hides e:\mksnt\make.exe
Found: E:\Cygwin\bin\sh.exe
Found: e:\mksnt\sh.exe
Warning: E:\Cygwin\bin\sh.exe hides e:\mksnt\sh.exe
Found: \bin\sh.exe
Warning: E:\Cygwin\bin\sh.exe hides \bin\sh.exe

  115k 1999/09/14 E:\Cygwin\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitcl30.dll" v0.0 ts=1999/9/13 19:46
   63k 1999/09/14 E:\Cygwin\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitk30.dll" v0.0 ts=1999/9/13 19:47
  474k 1999/09/14 E:\Cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtcl80.dll" v0.0 ts=1999/9/13 19:31
   19k 1999/09/14 E:\Cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0
   24k 1999/09/14 E:\Cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtclreg80.dll" v0.0 ts=1999/9/13 19:31
  768k 1999/09/14 E:\Cygwin\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtk80.dll" v0.0 ts=1999/9/13 19:36
  786k 1999/09/14 E:\Cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=1999/9/13 20:44
Use -h to see help about each section

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Cygwin select + sockets from DLL
  1999-11-19  8:21   ` Chris Faylor
  1999-11-19  8:24     ` DJ Delorie
@ 1999-11-30 23:39     ` Chris Faylor
  1 sibling, 0 replies; 14+ messages in thread
From: Chris Faylor @ 1999-11-30 23:39 UTC (permalink / raw)
  To: Cygnus - Admin; +Cc: Earnie Boyd, Peter Hudson +44 1892 541 720, cygwin

On Fri, Nov 19, 1999 at 08:50:33AM -0500, Cygnus - Admin wrote:
>On Fri, 19 Nov 1999, Earnie Boyd wrote:
>>Well, unless the third party software uses cygwin1.dll (which I doubt),
>>then based up the quoted comments you can't use the Cygwin select.  You
>>must use the Windows sockets.h header and function set.
>
>are you serious?  i can't use select() if i'm not gonna use the windows
>header files?

He's serious and he's correct.  cygwin fd's != "fd"'s returned by a winsock
socket operation.  You can't use raw winsock file handles in cygwin select.
Cygwin maintains its own table of file descriptors so you can't mix cygwin
functions with non-cygwin file descriptors.

-Chris Faylor
-Cygwin Engineering Manager
-Cygnus Solutions

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Cygwin select + sockets from DLL
  1999-11-19  4:23 Peter Hudson +44 1892 541 720
@ 1999-11-30 23:39 ` Peter Hudson +44 1892 541 720
  0 siblings, 0 replies; 14+ messages in thread
From: Peter Hudson +44 1892 541 720 @ 1999-11-30 23:39 UTC (permalink / raw)
  To: cygwin

Hello

I am trying to use a B20.1 select call to wait for a read event
on a socket, but the select never returns. This socket was created
by a DLL that is not mine.

The socket has a file descriptor value of a number greater than 63.
Hence when a use FD_SET to create the read mask for the select,
there aren't enough bits in the mask. The mask just remains as 0,0 ,
which is why the select doesn't return.

In sys/types.h I can see:
#       define  FD_SETSIZE      64

which is why my file descriptor values do not fit in an fd_mask.

I can also see the comment in this file:
"We don't define fd_set and friends if we are compiling POSIX
   source, or if we have included the Windows Sockets.h header (which
   defines Windows versions of them).  Note that a program which
   includes the Windows sockets.h header must know what it is doing;
   it must not call the cygwin32 select function."

I am not including the Windows sockets.h header, nor does the
header file for the DLL include it. But presumably the DLL does
use winsock-allocated sockets. Do I gather that I can't use these
sockets with Cygwin select?

I am doing something wrong, or is there a way round this problem?

Many thanks
Peter Hudson

Telnet Research Ltd

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Cygwin select + sockets from DLL
@ 1999-11-19  4:23 Peter Hudson +44 1892 541 720
  1999-11-30 23:39 ` Peter Hudson +44 1892 541 720
  0 siblings, 1 reply; 14+ messages in thread
From: Peter Hudson +44 1892 541 720 @ 1999-11-19  4:23 UTC (permalink / raw)
  To: cygwin

Hello

I am trying to use a B20.1 select call to wait for a read event
on a socket, but the select never returns. This socket was created
by a DLL that is not mine.

The socket has a file descriptor value of a number greater than 63.
Hence when a use FD_SET to create the read mask for the select,
there aren't enough bits in the mask. The mask just remains as 0,0 ,
which is why the select doesn't return.

In sys/types.h I can see:
#       define  FD_SETSIZE      64

which is why my file descriptor values do not fit in an fd_mask.

I can also see the comment in this file:
"We don't define fd_set and friends if we are compiling POSIX
   source, or if we have included the Windows Sockets.h header (which
   defines Windows versions of them).  Note that a program which
   includes the Windows sockets.h header must know what it is doing;
   it must not call the cygwin32 select function."

I am not including the Windows sockets.h header, nor does the
header file for the DLL include it. But presumably the DLL does
use winsock-allocated sockets. Do I gather that I can't use these
sockets with Cygwin select?

I am doing something wrong, or is there a way round this problem?

Many thanks
Peter Hudson

Telnet Research Ltd

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~1999-11-30 23:39 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-19  5:28 Cygwin select + sockets from DLL Earnie Boyd
1999-11-19  5:52 ` Cygnus - Admin
1999-11-19  8:21   ` Chris Faylor
1999-11-19  8:24     ` DJ Delorie
1999-11-19 10:49       ` Chris Faylor
1999-11-19 21:00         ` Unable to Type Lower Case e in the Bash Window Gus Baldauf
1999-11-30 23:39           ` Gus Baldauf
1999-11-30 23:39         ` Cygwin select + sockets from DLL Chris Faylor
1999-11-30 23:39       ` DJ Delorie
1999-11-30 23:39     ` Chris Faylor
1999-11-30 23:39   ` Cygnus - Admin
1999-11-30 23:39 ` Earnie Boyd
  -- strict thread matches above, loose matches on Subject: below --
1999-11-19  4:23 Peter Hudson +44 1892 541 720
1999-11-30 23:39 ` Peter Hudson +44 1892 541 720

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).