Figured out why enumerate() was failing in OpenVZ - I was using syscall getdents instead of getdents64.
Linux getdents64 no longer need magic type packing.