errno needs to be initialized I guess, because it was failing every time
on OSX 10.9.4