delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/10/08/11:20:52

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Eric Blake <ebb9 AT byu DOT net>
Subject: Re: atime on symlinks
Date: Thu, 8 Oct 2009 15:19:55 +0000 (UTC)
Lines: 39
Message-ID: <loom.20091008T171204-920@post.gmane.org>
References: <4ACDD5C2 DOT 9010104 AT byu DOT net> <20091008131103 DOT GF12789 AT calimero DOT vinschen DOT de>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019