nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] Locking (specifically, sequences)


From: Tethys
Subject: Re: [Nmh-workers] Locking (specifically, sequences)
Date: Fri, 08 Mar 2013 10:12:47 +0000

Lyndon Nerenberg writes:

>The sad but inevitable facts of life say you have to implement fcntl()
>locking for POSIX portability, but should defer to anything else if you
>know the system supports it. This means flock() is the de facto on UNIX.
>Wrap it all up in mh_lock() or something similar and Robert is your
>father's brother.

My system supports flock(), but using it would probably be wrong. My
flock(2) man page says:

: flock()  does not lock files over NFS.  Use fcntl(2) instead: that does
: work over NFS, given a sufficiently  recent  version  of  Linux  and  a
: server which supports locking.

I don't know how applicable that is to other Unices, but assuming the man
page is accurate and not outdated, it fairly strongly implies that flock()
would be the wrong choice here, given that my home directory (and hence my
mh directory) is NFS mounted.

Tet



reply via email to

[Prev in Thread] Current Thread [Next in Thread]