This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: getdents64 problem
>>>>> " " == Jakub Jelinek <jakub@redhat.com> writes:
> glibc expects just uniqueness and that you're able to lseek to
> any of the d_off's unless it is -1LL, in which case next
> getdents should read the next dirent entry. But d_off's are
> visible to other programs, so other programs might do further
> assumptions. On the other side, without monotonicity getdents
> would end up with pretty weird behaviour (it would change
> current file position up and down).
The problem here is that I cannot guarantee that the server won't
insert some new entry in between an existing entry and the next. I
have no idea as to the physical layout of the directory.
Uniqueness can easily be guaranteed (just by using a counter and
increasing it for each new cookie that I add to the dictionary).
Monotonicity cannot so easily be done, as I have to be able to deal
with insertion of new cookies without reassigning existing offsets.
Cheers,
Trond