I'm having a problem with some code I'm writing on linux to list files in a directory using opendir/readdir, where opendir is returning NULL, but it's not setting errno to a useful value. I know for a fact that the directory I'm attempting to open exists, is a directory, I have access to it, there are not too many descriptors in use, there are not too many files open, and there is plenty of memory available. I'm really confused about this.