stat() whacks st_atime

Robert Collins
Thu Jul 26 17:18:00 GMT 2001

On 26 Jul 2001 11:16:49 -0400, Jason Tishler wrote:
> Chris,
> On Thu, Jul 26, 2001 at 10:45:39AM -0400, Christopher Faylor wrote:
> > I suspect that a simple test case would help unperplex you.
> I did write many simple test cases before bothering the list.  Attached
> is, wtest2, one that mimics fstat()'s behavior (with regard to the
> Win32 calls).  I also stole the the values passed to CreateFile() from
> an strace run of stest (just in case how the file was opened caused
> the problem).  For some reason, wtest2 does not affect atime.  Hence,
> if CloseHandle() is indeed the culprit, then it isn't one all of the
> time.
My guess would be it's the file header reading logic - looking for

that means that a file access _has occured_. CloseHandle triggering the
actual write might jsut eb a win32 optimisation, to only wr

> If you have any hints for a simple test case that would illuminate me,
> it would be much appreciated.
> > I also suspect that CloseHandle is updating the atime.
> That was my "conclusion" too from stepping via gdb -- but, I found it
> hard to believe.  I searched the MSDN and google for MS atime issues
> but came up empty.
> Nevertheless, isn't the the bigger issue about how Cygwin should deal with
> this problem?  If Cygwin's stat() affects st_atime (even indirectly),
> then this is going to break Unix apps.  I have already found one (i.e.,
> mutt), there are bound to be others.
> Thanks,
> Jason
> -- 
> Jason Tishler
> Director, Software Engineering       Phone: 732.264.8770 x235
> Dot Hill Systems Corp.               Fax:   732.264.8798
> 82 Bethany Road, Suite 7             Email:
> Hazlet, NJ 07730 USA                 WWW:

More information about the Cygwin-developers mailing list