Copy in linuxcompat.h and funopen.c from liblinuxcompat, to reduce external dependencies.