file locking

Matthias Andree matthias.andree at stud.uni-dortmund.de
Mon Sep 16 20:34:14 CEST 2002


On Mon, 16 Sep 2002, Boris 'pi' Piwinger wrote:

> "Adrian Otto" <aotto at aotto.com> wrote:
> 
> >It might be better for me to make the GNU configure script smarter so that
> >at compile time a --with-nfs-locks argument will cause the HAVE_FLOCK and
> >HAVE_LOCKF to undef'ed and make HAVE_FCNTL defined if the system supports
> >it. I can have the configure script fail if you use this option on a system
> >that does not support fcntl locking for some reason. I'm putting this into
> >the TODO file.
> 
> Can you make it so smart it uses the best available method
> of locking without any additional argument?

That's impossible. Your kernel may offer mandatory locking, which
usually works on top of flock -- which is then the best for local
access. You may want to use NFS (which bogofilter cannot tell) and then
you must use fcntl, which may block and eventually time out and fail
(seen that with mutt). OTOH, I'm not sure if BerkeleyDB or other parts
cope with NFS -- NFS RPCS are not idempotent -- even though they may
appear to have failed (rename(2)) is a candidate, you must then manually
check with two stat(2) calls and comparisons if the operation succeeded.
If the application is not prepared to do this sort of thing, don't ever
dare to think about NFS.

For summay digest subscription: bogofilter-digest-subscribe at aotto.com



More information about the Bogofilter mailing list