cygwin compatible event handling