views:

42

answers:

1
+3  Q: 

libeio on windows

What would it take to port libeio to windows?

+1  A: 

Libeio is using unix APIs and unix concepts which are unknown on the Windows world. The solutions you have are :

  • use a unix abstraction layer on windows : like cygwin or Windows Services for Unix. But even with those layers, you'll have difficulties running libeio code as there are a lot of system-dependent code like this :
# if __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__
#  define _DIRENT_HAVE_D_TYPE /* sigh */
#  define D_INO(de) (de)->d_fileno
#  define D_NAMLEN(de) (de)->d_namlen
# elif __linux || defined d_ino || _XOPEN_SOURCE >= 600
#  define D_INO(de) (de)->d_ino
# endif
  • rewrite libeio with a portable abstraction library like GTK+ (glib in fact), wxWidgets or Qt. Thoses frameworks already implement powerful API for low level routines, communication services, i/o channels and asynchronous queues. Developers of those frameworks had made a lot of effort to allow portability of their code. You don't have to reinvent the wheel.

Definitely, the second solution is the best one, considering the relatively small size of eio.c, the only C file of libeio.

Jérôme Radix