Subject: weird d_namlen,d_type from readdir
To: None <>
From: Zdenek Salvet <>
List: current-users
Date: 06/21/1994 11:14:39
When trying to discover why my ld always creates static executables 
(with -Bdynamic and without it), I noticed that in shlib.c:findshlib 
readdir(dd) returns dirent struct with d_namlen field always set to 0
and d_type set to what should in d_namlen. I cannot find what I've screwed up 
during ld build.

I've found suspicious bit of code in /sys/kern/vfs_syscalls.c 
in function ogetdirentries :
 #                               if (BYTE_ORDER == LITTLE_ENDIAN)
                                         * The expected low byte of
                                         * dp->d_namlen is our dp->d_type.
                                         * The high MBZ byte of dp->d_namlen
                                         * is our dp->d_namlen.
                                        dp->d_type = dp->d_namlen;
                                        dp->d_namlen = 0;

 My MACHINE_ARCH==i386 ( little endian byteorder ) and I configured COMPAT_43,
 so it is possible readdir calls old getdirentries syscall. I can't 
 believe that , my is 7 days old and  /bin/ls is O.K.
 Any help appreciated,