fork from SiliconDust's userspace library