Make the -w / test work when the user is root
Revert "Permit setting hostnames that are MAX_HOSTNAMELEN long and are NUL"

This reverts commit 1b8333ca810b682d8ef049887a3b6cc9abd80807.
Disable f_memopen for now
faccessat in FreeBSD does not support AT_SYMLINK_NOFOLLOW like Linux/NetBSD
Handle invalid modes properly

Sponsored-by: EMC Isilon
Simplify the idioms in use

Sponsored-by: EMC Isilon