#include #include #include #include /* XXX: This testcase is not really self-sufficient because it depends on the availability of an autofs filesystem with a directory. Even then the bug is non-deterministic so may require further specification. */ /* This needs to be changed to point to a directory in an autofs filesystem. */ #define SOME_AUTOFS_DIRECTORY "/mnt/autofs/dir" int main(int argc, char *argv[], char *envp[]) { DIR *dir = opendir(SOME_AUTOFS_DIRECTORY); if (!dir) { printf("Could not open " SOME_AUTOFS_DIRECTORY ".\n"); return 1; } struct dirent *e; while( (e = readdir(dir)) != NULL ) // might never return null printf("ino=%d name=%s\n", e->d_ino, e->d_name); return 0; }