Re: Question on liblockfile (Re: policy Q's WRT imapd)
On 26 Jan 1998, Rob Browning wrote:
> "A. P. Harris" <apharris@onshore.com> writes:
>
> > Yes, but is liblockfile relevant to MTAs and MUAs or also to any program
> > that needs to lock a file? I'm having doubts about whether I can use it
> > locking shared data files in addressbook package, since it seems to
> > geared towards stuff from /var/spool/mail. After all, the only
> > documented function in that library is maillock(3).
> >
> > So does anyone know if it's safe/kosher/policy-compliant to use
> > maillock() for non-mail locking?
>
> Well, maillock() is only for locking mail, but there is an
> alternative, and it's in publib-dev. From the maillock manpage:
[snip]
The liblockfile-dev package contains a header file /usr/include/lockfile.h
which declares
int lockfile_create(const char *lockfile, int retries);
int lockfile_remove(const char *lockfile);
int lockfile_touch(const char *lockfile);
I guess these could be used for non-mail fails too.
Chris
-- _,, Christian Schwarz
/ o \__ schwarz@monet.m.isar.de, schwarz@schwarz-online.com,
! ___; schwarz@debian.org, schwarz@mathematik.tu-muenchen.de
\ /
\\\______/ ! PGP-fp: 8F 61 EB 6D CF 23 CA D7 34 05 14 5C C8 DC 22 BA
\ / http://fatman.mathematik.tu-muenchen.de/~schwarz/
-.-.,---,-,-..---,-,-.,----.-.-
"DIE ENTE BLEIBT DRAUSSEN!"
Reply to: