mvmf: lockset man page
mvmf: lockset man page
LOCKSET(1) General Commands Manual LOCKSET(1)
NAME
lockset - Establish file locks
SYNOPSIS
lockset [-e] [-v] [-x] filename [locks]
DESCRIPTION
In its normal mode, lockset establishes locks on a file and then sits
and does nothing. The intent is that you can then test some other util-
ity to see that it properly honors the locks that you set.
You may invoke lockset with the -v flag to get a quick summary of how to
use the program and of what lock types are available. Otherwise, a
filename must be given as the first argument. This file is opened in
read/write mode but no changes are made to the file. After the file-
name, give a list of zero or more lock types. All of the locks are at-
tempted, in the order given. Once this is complete, lockset waits for
you to terminate the program. If you do this with the interrupt charac-
ter (or signal), an orderly cleanup is done.
When invoked with the -e flag, lockset exits immediately after acquiring
its lock without cleaning up locks. In this mode, it will exit with a
zero status when the lock was acquired, and non-zero status if there was
a failure. This allows a shell script (say) to continue processing after
acquiring a lock. Note that this really only makes sense with dotlock-
ing (so you might want to be explicit about the lock type when using
this mode) and that as always with dotlocking, the program must have
read access to the named file as well as creation access for the .lock
file.
The -x flag will increase a verbosity level.
The types of locks include dotlock, which gains access to the file via a
filename.lock file (with filename being the name of the file you give);
fcntl, the fcntl() system call; flock, the flock() system call; and
lockf the lockf() library function.
NB: not all locking types may be available. Use the -v flag to find out
what you can use. If you specify a lock type that is either unknown or
unavailable, it is silently ignored.
lockset makes use of mvmf's lockset functions, and so it also uses li-
brary code from the mml library. This means it hauls in a bunch of code
for what should probably be a program of a page or two of source code.
However, one side goal of this utility is to use the mvmf locking code,
so there you have it.
SEE ALSO
http://www.mvmf.org/ -- the mvmf web site.
CREDITS TO
M. Mallett (mem@mvmf.org) 2007,2024-2025
BUGS
You tell me..
LOCKSET(1)