+ len += offsetof (struct dirent, d_name) + 1;
+
+ struct dirent *buf = malloc (len);
+ if (unlikely(buf == NULL))
+ return NULL;
+
+ int val = readdir_r (dir, buf, &ent);
+ if (val != 0)
+ errno = val;
+ else if (ent != NULL)
+ path = vlc_fix_readdir (ent->d_name);
+ free (buf);
+ return path;