Subject: Re: fdopen() and winsock
From: Bob Crispen <[email-masked]>
To: [email-masked]
Date: Tue, 24 Aug 1999 06:27:02 -0500

Mumit Khan <[email-masked]> sez:

> [email-masked] (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 [email-masked]