nmh-workers
[Top] [All Lists]

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

2013-03-08 04:13:03

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

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>