Fix the format string and types to work on older versions of NetBSD, in addition to FreeBSD and SunOS.