win32 question

Marc Lehmann schmorp at
Tue Nov 11 04:18:42 CET 2008

On Mon, Nov 10, 2008 at 06:32:41PM -0700, Roger Pack <rogerpack2005 at> wrote:
> trying to compile rev [based on libev] for mingw in windows, I sent it
> fd "3" [an accepting socket]

It is unlikely that 3 was a valid fd then.

> Assertion failed: ("libev only supports socket fds in this
> configuration ", ioctlsocket (anfd->handle, FIONREAD, &arg) == 0),
> file ../libev/ev.c, line 729

Indeed, libev verifies that the app passes in a valid fd, and fails with an
assertion otherwise.

> where apparently anfd->handle was equal to 1956 [calling ioctlsocket
> with 3 works]

If you can call ioctlsocket with 3, then it most likely isn't a valid fd,
as ioctlsocket does NOT accept fd's, it wants socket handles.

> Not sure if this is the right fix, but here's an attempt:

The API requires file descriptors on every platform, including
windows. The fix is to pass in file descriptors, not os-specific handles
(if you want to work on a fix, you should research the list archives,
also, the documentation has some information on windows).

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_    
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at
      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list