From b41b9034225ab3e49980d9de55c141011b6383b0 Mon Sep 17 00:00:00 2001 From: Taru Karttunen Date: Wed, 30 Mar 2011 16:49:47 +0300 Subject: Import sources from 2011-03-30 iso image - sys/man --- sys/man/1/lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 sys/man/1/lock (limited to 'sys/man/1/lock') diff --git a/sys/man/1/lock b/sys/man/1/lock new file mode 100755 index 000000000..bc6251e04 --- /dev/null +++ b/sys/man/1/lock @@ -0,0 +1,61 @@ +.TH LOCK 1 +.SH NAME +lock \- run a command under lock +.SH SYNOPSIS +.B lock +[ +.B -w +] +.I lockfile +[ +.I command +[ +.I argument +\&... +] ] +.SH DESCRIPTION +.I Lock +runs +.I command +(default +.LR rc ) +with +.I arguments +while holding +.I lockfile +open and (over)writing at least one byte each minute +to keep the exclusive-access lock alive. +If +.I lockfile +doesn't already have the exclusive-access bit set in +its mode, +the exclusive-access bits are set in its mode and +.BR qid.type . +.PP +Under +.BR -w , +.I lock +waits for exclusive access to +.I lockfile +instead of just trying once. +.PP +.I Lock +sets +.B /env/prompt +to contain the name of the lock file. +.SH EXAMPLES +Build a +.IR replica (1) +database while preventing collisions with other occurrences. +.IP +.EX +cd /sys/lib/dist +lock scan.lock replica/scan $dist/sources.replica +.EE +.SH SOURCE +.B /sys/src/cmd/lock.c +.SH SEE ALSO +.IR intro (5), +.IR stat (5) +.\" .SH DIAGNOSTICS +.\" .SH BUGS -- cgit v1.2.3