This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: atime on symlinks


Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:

> I'm not aware that Windows supports a file open flag similar to the
> O_NOATIME flag.  That would require to store and restore the atime every
> time a symlink is read, and we must read the symlink content to fetch the
> correct filesize.

OK, then probably not worth worrying about.  symlink atime is pretty 
meaningless anyway, since not all platforms can set it.  Actually, maybe there 
IS a way we can do it.  I noticed that MacOS documents that lutimes works by 
setting an attribute on symlinks, rather than being a syscall on par with 
utimes.  We can borrow that idea:

Rather than relying on normal Windows atime timestamps, we could make all 
cygwin symlinks embed their own "cygwin atime" information as part of the 
symlink contents.  lstat() already has to read the file for st_size, so it can 
also read the symlink timestamp for st_atim (if the symlink was created 
recently enough to support that new format), and fall back to to the Windows 
atime if the symlink is an older format.  readlink() will have to open symlinks 
for writing(!) in order to modify the timestamp.  utimensat()/lutimes() will 
have to modify the "cygwin atime", rather than the windows atime (but still 
modify the windows mtime).  And all other uses of symlinks (file name 
resolution) can ignore the atime field within the file.

But this idea can wait for post-1.7.1.

>  Are you still testing on XP?

Yep.

>  AFAIK, starting with
> Vista, filesystems are by default running in a noatime mount mode anyway.

No Vista here, and no immediate plans to get it.

-- 
Eric Blake




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]