> This is of course rather stupid, but should work. Wasting memory is indeed a rather stupid solution.
> Roland might have a better idea about how to fix it, though ;) The point of the estimation is to make sure the buffer's always big enough. The function would be hairier if it had to check and resize the buffer on the fly. You can make a reasonable overestimation by calculating st_size / sizeof(tmpfs_dirent) * sizeof(dirent), though that is going to be scaled up more than necessary unless all the names are tiny. It woud be simple to calculate the correct total size from st_size if it kept track of the number of entries in the directory (should be easy enough to do). Then it can do st_size - nentries*sizeof(tmpfs_dirent) + nentries*sizeof(dirent). _______________________________________________ Bug-hurd mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-hurd