[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-ha-dev
Subject: Re: [Linux-ha-dev] Re: flock [Was: Re: FreeBSD compatability]
From: Alan Robertson <alanr () unix ! sh>
Date: 2001-05-22 13:03:04
[Download RAW message or body]
David Lee wrote:
>
> On Thu, 17 May 2001, Alan Robertson wrote:
>
> > David Lee wrote:
> > > [...]
> > > Shouldn't something at least be automatic? On Solaris (also *BSD?) there
> > > is no "flock()", and the compilation failures are hard:
> >
> > Fcntl() is the "standard" way to do this.
> >
> > You can't use flock() if it isn't there...
> >
> > You can't use fcntl() if it isn't ther
> >
> > It seems a shame to throw away the flock() code, since it's already there.
> >
> > If both are present, *normally* you prefer the flock - but GFS can't yet
> > use it.
> >
> > I probably don't *care* if GFS can't yet use it - but someone else might...
> >
> > So, the following method is probably sufficient:
> >
> > Perform an automatic configure check for the two locking methods,
> > and always use fcntl() if both are present
> >
> > The following method is "perfect":
> >
> > Perform an automatic configure check for the two locking methods,
> > and use fcntl() if both are present unless overridden by
> > a configure option of --disable-fcntl-locking.
> >
> > Does this sound right?
>
> Seems OK. I've opted for your "sufficient" method, but you're welcome
> to enhance it for your "perfect" one.
>
> Warning: It is completely and utterly untested, although the "HAVE_FCNTL"
> side does at least compile on Solaris.
>
> One note of caution though. There is something about the overall build
> that causes the end-user's "config.h" not to be rebuilt. This is needed
> to pick up the new "HAVE_FLOCK" and "HAVE_FCNTL" defines. So it is
> important for us, at this stage of the game, to ensure that this happens
> in our own particular CVS fetch/update:
> 1. A clean CVS fetch should be OK (but excessive!);
> 2. A "./bootstrap" seems not sufficient;
> 3. I had to ensure "config.h" was logically removed (I did a "mv" sideways
> rather than a "rm" (a) just in case (b) so I could "diff" them...)
I just do a "make clean" before I do a bootstrap. That seems to do it.
I incorporated your fix into CVS. While I was there, I cleaned up the C++
comments in the code, and a couple of other minor things.
I also give a #error if neither of the locking methods is available.
-- Alan Robertson
alanr@unix.sh
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.community.tummy.com
http://lists.community.tummy.com/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic