1.3.x kernel breaks GNU make 3.74 (fix included)

Adam J. Richter (adam@adam.yggdrasil.com)
22 Jul 1995 06:17:09 GMT


I sent the following to bug-gnu-utils@prep.ai.mit.edu, but I
thought it might be relevant to readers of this channel. The
symptoms of the problem are make failing to find files that exist
after the kernel has been upgrade to 1.3.9 or above (it may also
occur in earlier 1.3.x kernels; I haven't tried them).

---------------------------------------------------------------------

Linux 1.3.9 and possibly ealier linux 1.3.x kernels have
what I think is a performance improvement in readdir() that breaks
GNU make 3.74. Under Linux 1.3.9 and above, it appears that when
readdir() writes a filename into the d_name field of the structure
that it returns, it null terminates the string, but does not fill
in the rest of the available bytes with nulls. It appears that
GNU make 3.74 expects this nonstandard expensive behavior on all
systems that define __GNU_LIBRARY__. Here is a fix. I'm not
sure that it's the best fix, since I have a mind to simply
get rid of the original definition of D_NAMLEN.

Adam J. Richter Yggdrasil Computing, Incorporated
(408) 261-6630 "Free Software For The Rest of Us."

*** /tmp/make-3.74/dir.c Mon Nov 7 19:14:50 1994
--- dir.c Sat Jul 22 02:00:27 1995
***************
*** 22,24 ****
#include <dirent.h>
! #ifndef __GNU_LIBRARY__
#define D_NAMLEN(d) strlen((d)->d_name)
--- 22,24 ----
#include <dirent.h>
! #if defined(linux) || !defined(__GNU_LIBRARY__)
#define D_NAMLEN(d) strlen((d)->d_name)

-- 
Adam J. Richter				  Yggdrasil Computing, Incorporated
(408) 261-6630				  "Free Software For The Rest of Us."