--- source/configure.in.orig Sun Jul 9 20:33:35 2006 +++ source/configure.in Mon Jul 10 16:52:46 2006 @@ -2576,6 +2576,16 @@ fi fi +AC_CACHE_CHECK([for st_birthtime in struct stat],samba_cv_HAVE_STAT_ST_BIRTHTIME,[ +AC_TRY_COMPILE([#include +#include +#include ], +[struct stat st; st.st_birthtime = 0;], +samba_cv_HAVE_STAT_ST_BIRTHTIME=yes,samba_cv_HAVE_STAT_ST_BIRTHTIME=no)]) +if test x"$samba_cv_HAVE_STAT_ST_BIRTHTIME" = x"yes"; then + AC_DEFINE(HAVE_STAT_ST_BIRTHTIME,1,[Whether the stat struct has a st_birthtime property]) +fi + AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[ AC_TRY_COMPILE([#include #include --- source/lib/time.c.orig Wed Nov 9 19:28:57 2005 +++ source/lib/time.c Mon Jul 10 17:37:12 2006 @@ -703,6 +703,12 @@ if(S_ISDIR(st->st_mode) && fake_dirs) { return (time_t)315493200L; /* 1/1/1980 */ } + +#ifdef HAVE_STAT_ST_BIRTHTIME + if((int)st->st_birthtime >= 0) { + return st->st_birthtime; + } +#endif ret = MIN(st->st_ctime, st->st_mtime); ret1 = MIN(ret, st->st_atime);