Steffen Nurpmeso wrote, on 01 Sep 2020:
>
> |Do the existing implementations ever return such things? Do they
> |hide them by making the reclen of the previous entry (if there is
> |one in the buffer) bigger, or do they squash them out, moving the
> |next existing entry down to follow immediately after the previous one
> |(where all the reclen's are as small as possible to contain the
> |sctuct header, the name (and its \0) and alignment padding.) This is
> |a case where we don't necessarily need to specify one scheme that
> |must be used - we can leave that for the implementation, as long as
> |applications are informed what might happen.
>
> The proposed text says that filenames are NUL terminated and
> hopping from entry to entry happens by adding the reclen to the
> current entry (casted to char*). So it seems there could be data
> in between.
I have put a proposed rationale addition in the etherpad to make it
clear that this solution is allowed:
Some existing <i>getdents</i>() functions include deleted
directory entries in <i>buf</i>, marked with a special value of
one of the structure members. This behavior is not allowed for
<i>posix_getdents</i>(), although the data from a deleted
directory entry may be present in <i>buf</i> in the form of extra
padding on the end of the previous entry.
--
Geoff Clare <[email protected]>
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England