Bug 14795 (getdents-manpage)

Summary: getdents manpage wrong
Product: Documentation Reporter: blah
Component: man-pagesAssignee: documentation_man-pages (documentation_man-pages)
Status: RESOLVED CODE_FIX    
Severity: low CC: mtk.manpages, xerofoify
Priority: P1    
Hardware: All   
OS: Linux   
URL: n/a
Kernel Version: 2.6.31 Subsystem:
Regression: No Bisected commit-id:

Description blah 2009-12-13 09:17:23 UTC
It shows source creating a struct instead of including, which doesn't work when the dents can be 64 or 32 bit, it also shows the d_type byte being after the offset, but it is before it in bits/dirent.h
Comment 1 blah 2009-12-13 09:19:21 UTC
the d_type byte moving possibly means the length calculation for d_name in there is wrong too.
Comment 2 xerofoify 2014-06-25 15:37:25 UTC
This bug is obsolete. Please test against a newer kernel to
see if it still is valid.
Cheers Nick
Comment 3 Michael Kerrisk 2015-04-12 05:42:17 UTC
(In reply to blah from comment #0)
> It shows source creating a struct instead of including, which doesn't work
> when the dents can be 64 or 32 bit,

The problem here is that there is no libc support, so, nothing to incude.

> it also shows the d_type byte being
> after the offset, but it is before it in bits/dirent.h

This is only true for the 64-bit structure/getdents64(). For getdents(), the description is accurate, ad the example code demonstartes.

The real problem is that the page does not document getdents64() and the structure that it uses. I've now added a description to the page, which will go out with the next release.

Cheers,

Michael