Zsh Mailing List Archive
Messages sorted by:
Re: Unable to read history on latest Cygwin
- X-seq: zsh-users 14655
- From: "Peter A. Castro" <doctor@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Unable to read history on latest Cygwin
- Date: Thu, 17 Dec 2009 00:04:39 -0800 (PST)
- In-reply-to: <733654e30912160754q5e505cabo4a2510b41bf1d892@xxxxxxxxxxxxxx>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <1260800369.32429.1350005931@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <733654e30912160754q5e505cabo4a2510b41bf1d892@xxxxxxxxxxxxxx>
On Wed, 16 Dec 2009, Wayne Davison wrote:
On Mon, Dec 14, 2009 at 6:19 AM, Thorsten Kampe
The result of that is that I'm not able to run zsh "portable" from a
FAT32 USB thumb drive: "zsh: failed to create hard link as lock file
/home/thorsten/.zhistory.LOCK: operation not permitted".
One simple possibility is to change the two #ifdef HAVE_LINK lines in hist.c
#if defined HAVE_LINK && !defined __CYGWIN__
I'll get to testing that possible usage, as well as Peter's proposed code
changes, once I get a few spare cycles...
That should make it use the open with O_EXCL, which is hopefully atomic.
Hmm...atomic in the sense that the open vectors through the symlink to
the real file? Yes, I believe it's "atomic" in that sense.
As for Peter's idea of using a symlink, do you know if the cygwin folks
mention if their emulation of a symlink is an atomic operation? We could
Symlinks in Cygwin are a close analog to true filesystem supported
symlinks. They are just a 'plain' file with a special name (and file
attribute) and contain the redirection to the target file. So....since a
Cygwin app. must access the symlink/file through Cygwin (which is doing
the symlink resolution) you can considder it "mostly" atomic. It's
certainly not atomic from the underlying filesystem perspective (because
it doesn't support it), but the emulation layer is the only access point
for the app. to get to the symlink file. Does that answer your question?
completely get rid of the temp file (used in the hard-link code) and just
create a symlink named for the lock file, pointing at (essentially)
$PID/$HOST (since it doesn't matter if the link is valid, just that it
exists). 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()).
Peter A. Castro <doctor@xxxxxxxxxxxx> or <Peter.Castro@xxxxxxxxxx>
"Cats are just autistic Dogs" -- Dr. Tony Attwood
Messages sorted by: