gh-59: fix FreeBSD and other POSIX systems.