Cygwin support contributed by Stefan Ondrejicka <ondrej@idata.sk>.