Re: mingw32 and sockets

2005-09-28 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: > The way GNU clisp copes with this is a thinner layer: It accepts the facts > that a file descriptor and a socket are different things, and that some > initialization function is needed, and defines things like > > #ifdef _WIN32 > # define sock_errno WSAGe

Re: mingw32 and sockets

2005-09-28 Thread Ingolf Steinbach
On Tuesday 27 September 2005 18:03, Derek Price wrote: > Ingolf Steinbach wrote: > >I have done a select() emulation on Win32 once. It was horrible. > I don't suppose the implementation was GPL'd or LGPL'd or could be? Sorry, it was part of a closed-source software project developed for the German

RE: mingw32 and sockets

2005-09-27 Thread Conrad T. Pino
> From: Derek Price > Sent: Tuesday, September 27, 2005 07:43 > > This is basically what CVS has been using for a long time. We are now > proposing adding, basically: > > #ifdef _WIN32 > # define sock_select select > # define fd_select wnt_select > #else > # define sock_select select > # defin

Re: mingw32 and sockets

2005-09-27 Thread Derek Price
Conrad T. Pino wrote: >I suggest avoiding "wnt_select" in favor of either "wnt_fd_select" or >"woe32_fd_select" instead. > > I prefer woe32_fd_select, but you're writing it and I'm not that picky. :) >Wrapping the Windows Socket API to integrate sockets into the CRT number >space might work b

Re: mingw32 and sockets

2005-09-27 Thread Bruno Haible
Ingolf Steinbach wrote: > I have done a select() emulation on Win32 once. It was horrible. > If you want to avoid multithreading ... Things get simpler if you accept the need to create new threads on Woe32. Another example of this is that if you want to handle Ctrl-C gracefully (i.e. do something

Re: mingw32 and sockets

2005-09-27 Thread Derek Price
Ingolf Steinbach wrote: >I have done a select() emulation on Win32 once. It was horrible. > I don't suppose the implementation was GPL'd or LGPL'd or could be? >And maybe the situation is easier for CVS when the communication >can be reduced to pipes and sockets (e.g. no serial support). > >

Re: mingw32 and sockets

2005-09-27 Thread Ingolf Steinbach
Hi, On Tuesday 27 September 2005 16:42, Derek Price wrote: > Actually, Windows select() works _only_ on sockets. Select on other fds > returns "WSAENOTSOCK". > > bug-cvs@nongnu.org has recently been discussion a select() wrapper that > could tell the difference for CVS. As I understand it, there

Re: mingw32 and sockets

2005-09-27 Thread Derek Price
Bruno Haible wrote: >The Woe32 socket API has three main differences w.r.t. the POSIX socket API: > > - The type of a socket is 'SOCKET', not 'int'. A SOCKET cannot be used in >places where a file descriptor is used. This means in particular that >close(), select(), poll() don't work on s

Re: mingw32 and sockets

2005-09-26 Thread Bruno Haible
Simon Josefsson wrote: > We could provide replacement functions, perhaps inspired by the > re-implementations in plibc, see > http://cvs.sourceforge.net/viewcvs.py/plibc/plibc/. > ... > The answer seem to be no. So ideally, I think the incompatibilities > should be solved by gnulib. The Woe32 soc

Re: mingw32 and sockets

2005-09-23 Thread Simon Josefsson
Bruno Haible <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: >> Would it be possible to create those three POSIX header files if they >> don't exist on the system, and if winsock2.h do exist? The created >> files would simply #include . > > Yes, that's the way I would go. It seems doing tha

Re: mingw32 and sockets

2005-09-22 Thread Simon Josefsson
John Vandenberg <[EMAIL PROTECTED]> writes: > On 9/22/05, Simon Josefsson <[EMAIL PROTECTED]> 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 an

Re: mingw32 and sockets

2005-09-22 Thread Simon Josefsson
Paul Eggert <[EMAIL PROTECTED]> writes: > Simon Josefsson <[EMAIL PROTECTED]> writes: > >> Mingw32 doesn't have sys/types.h, > > Ouch. Lots of gnulib code assumes that sys/types.h exists and works. > (The only exception is the socklen module itself.) Sorry, I meant sys/socket.h. __

Re: mingw32 and sockets

2005-09-21 Thread John Vandenberg
On 9/22/05, Simon Josefsson <[EMAIL PROTECTED]> 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

Re: mingw32 and sockets

2005-09-21 Thread Paul Eggert
Simon Josefsson <[EMAIL PROTECTED]> writes: > Mingw32 doesn't have sys/types.h, Ouch. Lots of gnulib code assumes that sys/types.h exists and works. (The only exception is the socklen module itself.) > Perhaps this should be considered a mingw32 bug instead? I would. Google reports that other