Re: Meaning of Size Directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John Reiser <jreiser@xxxxxxxxxxxx> wrote:

> On 3/16/21, David Howells wrote:
> > John Reiser <jreiser@xxxxxxxxxxxx> wrote:
> > 
> >> See the manual page "man 2 getdents".
> > Um, which bit?  I don't see anything obvious to that end.
> 
> On that manual page:
> =====
> The system call getdents() reads several linux_dirent structures from the directory
> referred to by the open file descriptor fd into the buffer pointed to by dirp.
>    [snip]]
> On  success, the number of bytes read is returned.
> =====

It doesn't say anything about the size of the directory there.  "Number of
bytes read is returned" should be taken as how much of the user buffer was
filled - information you need to know to be able to parse it.

Further, there's getdents() and there's getdents64() and their structs are of
different sizes.  By your logic st_size would have to be the number of
linux_dirent structs for use with the former and the number of linux_dirent64
structs for use with the latter...  And then there's readdir() as well with
it's old_linux_dirent struct.

So, no, it cannot work like that.

David
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux