WLOCK(1) System Administration WLOCK(1)NAME
wlock - Tests or sets a file with POSIX-fcntl() write-locks
SYNOPSIS
wlock [ -s [-a seconds ]] [ -t] [ -v] [ -b begin ] [ -l length ] file
or
wlock [ -s ] [ -v] [ -b begin ] [ -l length ] file program [ arguments ]
DESCRIPTION
This program sets or tests advisory locks conforming to POSIX fcntl() call. You may specify optionaly a program to start it within the lock
context.
OPTIONS
These options are accepted. If a program is provided as argument wlock will start it.
-s Sets the lock.
-t Test the lock (default).
-v Verbose output.
-b begin
The lock starts at byte #begin.
-l length
The lock will be length bytes long.
-a seconds
The lock is active for seconds (default=86400).
RETURN VALUES
0 In test mode this means that the file is locked. In set mode it indicates the succesful creation of the lockfile
1 The file is not locked. Only available in testmode.
2 Some error has occurred.
AUTHOR
wlock has been written by Ulli Horlacher (framstag@belwue.de>.
SEE ALSO sendfile(1).
19 March 1998 WLOCK(1)
Check Out this Related Man Page
VOP_ADVLOCK(9) BSD Kernel Developer's Manual VOP_ADVLOCK(9)NAME
VOP_ADVLOCK -- advisory record locking
SYNOPSIS
#include <sys/param.h>
#include <sys/vnode.h>
#include <sys/fcntl.h>
#include <sys/lockf.h>
int
VOP_ADVLOCK(struct vnode *vp, caddr_t id, int op, struct flock *fl, int flags);
DESCRIPTION
The arguments are:
vp The vnode being manipulated.
id The id token which is changing the lock.
op The operation to perform (see fcntl(2)).
fl Description of the lock.
flags One of more of the following:
F_RDLCK Shared or read lock.
F_UNLCK Unlock.
F_WRLCK Exclusive or write lock.
F_WAIT Wait until lock is granted.
F_FLOCK Use flock(2) semantics for lock.
F_POSIX Use POSIX semantics for lock.
This entry point manipulates advisory record locks on the file. Most file systems delegate the work for this call to lf_advlock().
RETURN VALUES
Zero is returned on success, otherwise an error is returned.
SEE ALSO fcntl(2), flock(2), vnode(9)AUTHORS
This manual page was written by Doug Rabson.
BSD June 30, 1999 BSD
I want to be able to lock a file for 60 minutes so that an automated monitoring program will not execute the script more that once an hour. I have never used a lock file but have heard that is what I need to use. Does anyone have any examples of how I would use this?
lock 60 filename.ksh ---?... (6 Replies)
hi there, i need help :( im trying to produce a program that would do the following, but i dont know were to begin, any help/guide lines, please im need help asap,
One program is the main program, which fork/execs one referee process and
three x,y,z processes repectvley. It then waits until... (0 Replies)
Hello,
I need to implement a locking system in C. My problem is how to make the check if the lock file exist and locking it atomic operation.
I want to make something like this:
FILE* lock_fname;
lock_fname = fopen ( "file.lock", "r");
/*check if file exsists*/
if (lock_fname)
{
fclose... (7 Replies)
I have an Essbase installation on Solaris 10 and need to get the backups configured. Unfortunately several key files are locked and Essbase (OLAP application) is not releasing the locks when the Essbase or the applications within stop running. It appears I can use chmod to unlock the files but I... (0 Replies)