patch to be built on Debian/kFreeBSD