Only compile on darwin/x86-64
Add errno handling