FreeBSD support from @napsty