use errnoEnforce

FYI: Tested on linux. I am unable to test on windows.