Re: read() and write() for MinGW

2010-03-29 Thread Neil Jerram
Paolo Bonzini writes: >>> Conceptually this is extremely simple, and I've found that gnulib >>> already contains useful bits like SOCKET_TO_FD, FD_TO_SOCKET, and the >>> code for determining if an arbitrary fd is a socket - which is all >>> great. >> >> Yes, and the read() and write() functions d

Re: read() and write() for MinGW

2010-03-29 Thread Paolo Bonzini
Conceptually this is extremely simple, and I've found that gnulib already contains useful bits like SOCKET_TO_FD, FD_TO_SOCKET, and the code for determining if an arbitrary fd is a socket - which is all great. Yes, and the read() and write() functions don't need to make this distinction, becau

Re: read() and write() for MinGW

2010-03-28 Thread Bruno Haible
Hi Neil, > I'd like to contribute a gnulib module to handle the fact that, on > MinGW, you have to use recv() to read data from a socket, instead of > read(). > > Similarly, for writing, send() is needed instead of write(). Gnulib already solves this problem, by wrapping the Win32 SOCKET in a fi