compile on modern FreeBSD. After Robert Watson <rwatson@FreeBSD.org> and Alec Kloss