changes for cygwin and correct error message for setpshared