Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Unable to read history on latest Cygwin



On Thu, 17 Dec 2009 12:00:25 -0800
Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, Dec 16, 2009 at 7:54 AM, Wayne Davison <4wayned@xxxxxxxxx> wrote:
> 
> > According to various web docs, symlinks are atomic on NFS, so that might be
> > a good thing to use in general (replacing the use of link()).
> >
> 
> Attached is my patch for adding preferential use of a symlink as the locking
> mechanism.  This should interoperate just fine with a hard-link creating
> locker, but sadly, will have issues if another locker is using open with
> O_EXCL.  I've made the symlink name "/pid-$PID/host-$HOST" in an attempt to
> make a create (open) over an existing symlink fail with an error (unless the
> /pid-$PID dir happens to exist and is writable).  We could try to add
> O_NOFOLLOW (when available) to the O_EXCL-open as well.  However, hopefully
> no system will exist where one zsh locker is trying to use open-locking and
> another is trying to use a link-locking idiom.
> 
> What do you think?  Dangerous?  Useful?

(I moved this to zsh-workers.)

What about the historical behaviour of zsh?  Are there old versions of the
shell that might do something inconsistent with this?  This is not a
typical problem for most users, anyway, but it would be good not to stir
things up unnecessarily.

Other than that I can't think of any aspect that looks particularly
dangerous.  We could limit this to both HAVE_LINK and HAVE_SYMLINK to
ensure it didn't change the behaviour on systems without link()---slightly
illogical but unlikely to be a real limitation on the most common systems.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



Messages sorted by: Reverse Date, Date, Thread, Author