Closed cmatthew closed 12 years ago
The size of dirent is : 20 + len(filename) + zero padding,
where the total size is of multiple of 8 which is either 24, 32 or 40 bytes etc.
So, the starting size that should be given as 24bytes. Anything less than that EINVAL is raised
I think it respects now, also I am returning size of each dirent.
getdirents has a size parameter which is the size of the buffer it has allocated for directory entires. Currently we do not respect that value.
The reason that it is hard to actually do is that you hace to return the number of entires that creates the number of dirent structs which will be smaller than the buffer size. But at the lind fs level, we don't normally keep much information about C sizes.
I think the dirent size is something like 20bytes + length of C string. Where 20 bytes is all the header stuff in the dirent struct.
To rectify this, we need to integrate some knowledge of the size of dirents into the getdirents_syscall function.