Path: utzoo!attcan!uunet!mailrus!ncar!mephisto!udel!mmdf From: inf2007@vax.rz.uni-wuerzburg.dbp.de (inf2007) Newsgroups: comp.os.minix Subject: Re: 1.5.0 upgrade: REPORT + BUGS + PATCHES Message-ID: <11030@nigel.udel.EDU> Date: 13 Feb 90 15:46:03 GMT Sender: mmdf@udel.EDU Lines: 43 In .... Bill Mitchell writes: > "ls file" worked, but "ls", "ls .", and "ls /" didnt. > Knowing nothing about POSIX stuff, I didn't feel qualified pursue it. > I did notice that /usr/include/dirent.h had struct dirent.d_name > declared as "char d_name[1]", which looked suspicious. See my posting of 31. Jan: Subject: Bug in 1.5.0 directory functions/headerfiles Date: Wed, 31 Jan 90 00:05:35 GMT Has anybody recompiled the 1.5 directory functions ? After hours of working i realized that in the new sys/dir.h two defines are missing: DIRENTSIZ and DIRENTBASESIZ The bug is very good hidden because in getdents.c these values, are defined to wrong values if they are undefined !! The missing code (earlier in sys/dirent.h ) is: ---------------------------------------- #ifdef BSD_SYSV /* (e.g., when compiling getdents.c) */ extern struct dirent __dirent; /* (not actually used) */ /* The following is portable, although rather silly. */ #define DIRENTBASESIZ (__dirent.d_name - (char *)&__dirent.d_ino) #else /* The following nonportable ugliness could have been avoided by defining DIRENTSIZ and DIRENTBASESIZ to also have (struct dirent *) arguments. There shouldn't be any problem if you avoid using the DIRENTSIZ() macro. */ #define DIRENTBASESIZ (((struct dirent *)0)->d_name \ - (char *)&((struct dirent *)0)->d_ino) #endif #define DIRENTSIZ( namlen ) ((DIRENTBASESIZ + sizeof(long) + (namlen)) \ / sizeof(long) * sizeof(long)) ---------------------------------------- Robert Regn University of Wuerzburg, Germany regn@uniwue.uucp uunet!mcvax!unido!uniwue!regn