Re: probable omission in SYS_getdents or in libc-5.2.3

Andrew Walker (andy@keo.kvaerner.no)
Wed, 6 Sep 1995 09:59:08 +0200 (MET DST)


Marc Lehmann wrote:
>
>
> I just compiled Linux 1.3.23 today, switching from 1.2.13 to the
> 1.3 series, as I heard now it stabilizes, and, as Linus said,
> 1.2 is getting boring, so stable is it :)
>
> When I rebooted with 1.3 I entered the linux-source-dir changed
> something and typed make. It didn't work, same binary as under 1.2!
>
> After tracking the whole stuff down, I now think I isolated the problem.
>
> Under 1.3, the libc-5.2.3 uses the new SYS_getdents call,
> instead of SYS_readdir. I have no documentation (:) on that,
> but I think SYS_getdents involves less overhead.
>
> The thing that let make go mad was a definition at the top of dir.c:
>
> #define D_NAMLEN(d) ((d)->d_namlen)

This isn't allowed by POSIX. The only field POSIX guarantees is
d_name, so the only portable way of getting the name length is to
use strlen(d_name).

See H.J. Lu's release notes for the most recent libc's for more
info, and a patch for GNU make. The make problem (affects some
other programs as well) is well known.

Of course, you'll have to boot up 1.2.X again to compile a new
make with the patch. Then you can try 1.3.X again. Ho, hum.

-Andy

-- 
Andy Walker                              Kvaerner Engineering a.s.
Andrew.Walker@keo.kvaerner.no            P.O. Box 222, N-1324 Lysaker, Norway

......if the answer isn't violence, neither is it silence......