Joint work with Allan Jude <allanjude@freebsd.org> who has proposed an identical diff for the FreeBSD version.