[1.18.0] rewinddir operation

Jeff Johnston jjohnstn@redhat.com
Mon Mar 15 20:30:00 GMT 2010


Hi Xavier,

I have just recently patched this in newlib.  As you have noted, the 
code was in error.  A special case is now added for 0 to mean rewind.

-- Jeff J.

On 03/08/2010 12:32 PM, Xavier Guérin wrote:
> Dear list,
>
> I just encountered a small issue with rewinddir. Although opendir and readdir works properly
> on my operating system, I can't make rewinddir working.
> After reading the code of _seekdir, I don't seem to understand how it could work anyway.
>
> It looks like _seekdir relies on dd_hash to locate the the entry the user is looking for.
> However, dd_hash is only used by telldir and seekdir. I know that seekdir should only be used
> with values returned by telldir, but rewinddir bypasses this restriction and uses 0 as off_t parameter.
>
> Consequently, the first few lines of _seekdir fail, since dd_hash[LOCHASH(0)] does not contain a vaild
> ddloc entry.
>
> Could you please tell me what I am missing ?
>
> Thanks in advance,
> Xavier
>
>
> -----
> Xavier Guérin - Doctoral student
> TIMA Laboratory, SLS Group
> 46, av. Félix Viallet, 38000 GRENOBLE, FR
> Mail : xavier.guerin@imag.fr
> Phone : +33(0)4 76 57 47 59
> Ad Astra Per Aspera
> Triste e' quel discepolo che non avanza il suo maestro
>



More information about the Newlib mailing list