Description: |
This check, defined in tcl.m4 is incorrect:
# Now check for auxiliary declarations
AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/dirent.h>],[struct dirent64 p;],
tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])
fi
The header file is incorrect, it should be:
#include <dirent.h>
From the readdir() man page:
READDIR(3) Linux Programmer's Manual READDIR(3)
NAME
readdir - read a directory
SYNOPSIS
#include <sys/types.h>
#include <dirent.h>
struct dirent *readdir(DIR *dir);
DESCRIPTION ...
---------
This was discovered using 32-bit linux build, which had a failure with [glob *] used during package discovery in the init phase. Basically, tclsh utterly failed to find any packages because readdir() failed. Readdir() failed because it was using the 32-bit struct and readdir could not store the inode values in the dirent struct.
Ultimately traced back to the build configure not doing the right thing for a large filesystem aware OS.
|