bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mingw32 and sockets


From: Simon Josefsson
Subject: Re: mingw32 and sockets
Date: Thu, 22 Sep 2005 09:59:35 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

John Vandenberg <address@hidden> writes:

> On 9/22/05, Simon Josefsson <address@hidden> wrote:
>> Mingw32 doesn't have sys/types.h, arpa/inet.h or netinet/in.h.  But if
>> you include winsock2.h instead of those three header files, most (?)
>> POSIX socket functions work.
>
> I doubt that any POSIX socket functions in winsock2 will conform to
> the specification, or even reasonably reliably be useful.  There are a
> number of gotchas that need to be considered. e.g. errno is not set.
>
> plibc is a very good POSIX compatibility library for mingw, and as an
> example, here is the select implementation:
>
> http://cvs.sourceforge.net/viewcvs.py/plibc/plibc/src/select.c?view=markup
>
> Existing modules inet_ntop, getaddrinfo and poll, and any module that
> depends on those (canon-host?), appear to use these headers, but only
> a small part of the socket implementation is needed; supporting those
> modules on Window sounds like a good start.

Thanks for the link.  Perhaps something like plibc could be integrated
in gnulib?  Then GnuTLS could continue to assume POSIX, and still
function on Mingw32.  I'm not sure if there are easier ways to make
this happen (such as using plibc somehow), but for me gnulib would be
the simplest solution.

>> Perhaps this should be considered a mingw32 bug instead?  Problem is
>> this mingw32 cross compiler will likely be around for a while, since
>> it is shipped with the latest Debian release..  So it might be useful
>> to support even if it is broken.
>
> MinGW does not consider this a bug because it aims to provide a
> complete and compatible Win32 API, in order that programmers can
> interchange MSVC and MinGW.
>
> http://marc.theaimsgroup.com/?t=112472681900001&r=1&w=2

Ok.  Implementing POSIX on top of Win32 API's could thus be done in
gnulib.

I'm not sure there is a lot of work needed, it may sound more
challenging than it is.  If people are compiling GnuTLS with mingw32,
they presumably use the resulting binaries and they work.  Only minor
header tweaks was reported to be necessary.

I have access to a Windows system, so perhaps I'll cross-compile
GnuTLS and see if it works...

Thanks,
Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]