Ok, what _actually_ happens is this: "dir_fd" is -1, but yet we get a "dir" which is not null. The contents of this "dir" is bogus though, which is why readdir64_r crashes. I assume it is related to this checkin
revision 1.144 date: 2005/10/05 10:04:07; author: grubba; state: Exp; lines: +51 -11 Backported {f,}pathconf() cleanups from Pike 7.7.
as it touched how "dir" is created from "dir_fd".