procmail
[Top] [All Lists]

Re: Looking for details of Proc

1996-07-28 21:49:44

[Please limit your lines to around 72 characters.  Thanks!]

"Craig Munday" <craigm(_at_)access(_dot_)COM(_dot_)AU> writes:
As the subject states, I am looking for all the details I can get on how procma
il implements its file locking mechanisms.

You can find all the absolutely gorey details in the source code,
src/locking.c.  You should see src/autoconf to see how procmail tests
the system's locking mechanisms for correct behavior.


For example does it simply create a file (lock file) for the file it wishes to
 lock.  And checking for the presents of the lockfile is enough to stop other p
rocesses entering a mail file for example.  Or does procmail use fcntl or some 
other system function to acquire a lock on an open file descriptor?

procmail always uses dotlocking, and then as many of fcntl(), lockf(),
and flock() as work together, trying them in that order.  The kernel
lock is applied to the file being locked, not to any dotlock lockfile
being used.


Philip Guenther

----------------------------------------------------------------
Philip Guenther                 UNIX Systems and Network Administrator
Internet: guenther(_at_)gac(_dot_)edu   Voicenet: (507) 933-7596
Gustavus Adolphus College       St. Peter, MN 56082-1498

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