https://opensource.apple.com/source/Libc/Libc-1244.1.7/include/dirent.h.auto.html ccall picks the wrong one, causes crashes and truncated d_name entries. Wrapping the function in a small C shim, as well as using the CAPI, fixes this.