fdopen() and winsock

Bob Crispen crispen@hiwaay.net
Tue Aug 31 23:49:00 GMT 1999


Mumit Khan <khan@xraylith.wisc.EDU> sez:

> JRSON@NetZero.Net (John R Hanson) writes:
> > Actually They are regular file handles, just like any other.
> > There is a bug in all 9x/kernel32 libc/msv/crtdll interface
> > implementations GetFileType() returns TYPE_UNKNOWN for handles to
> > sockets. Since this is AFAIK the only unknown type there is, you know you hav
> > e
> > a socket handle;-)
> 
> Thanks for the clarification. My MSDN CD does document this and I guess
> that makes it a "feature" rather than a bug ;-)
> 
> I may consider adding a GetFileType interface in mingw runtime (under
> a "bug fix" library that you have to explicitly link to).
> 
> > there is a fix in the more recent perl distrib's
> > that you can use as a general solution.
> > -loldnames -lperlcrt -lmsvcrt will get you TYPE_CHAR
> > for socket handles. that are put into an fd with _open_osfhandle()
> > also fixes several other nasty bugs in the MS libcXXX.
> 
> I see references to PerlCRT DLL, but can't find the source nor any
> mention of what license it's disributed under. Anyone with more info
> on it?  If it's not free (in either the GNU/gratis or BSD-style free
> software sense), then, as far as I'm concerned, it's irrelevant.

I have a slightly different take on it.  For use at home or
for distribution to folks who are known to have a given system,
the version I compiled that uses the Cygwin DLL is perfectly
fine.  But if I want to distribute the software to the general
public, I don't think I do them any favors by requiring *any*
DLL that they won't automatically find on their systems, be
it MFC, Cygwin, or one from a perl distribution.

Of course, my goal for this particular project has been to
replace the bloated, slow, buggy, and fragile Newsrover with
something lightweight and bulletproof.

I'm making some progress by using winsock the way it's documented
(though only a mother could love the code that I had to write
that does the equivalent of fscanf() and getc()) and I expect
to continue on that way, with occasional curses in the direction
of the Microsoft people who felt they had to "improve" BSD
sockets.

Bob Crispen
crispen at hiwaay dot net

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



More information about the Cygwin mailing list