61 lines · 925 B · Text
RawDownload
.TH LOCK 1.SH NAMElock \- run a command under lock.SH SYNOPSIS.B lock[.B -w].I lockfile[.I command[.I argument\&...] ].SH DESCRIPTION.I Lockruns.I command(default.LR rc )with.I argumentswhile holding.I lockfileopen and (over)writing at least one byte each minuteto keep the exclusive-access lock alive.If.I lockfiledoesn't already have the exclusive-access bit set inits mode,the exclusive-access bits are set in its mode and.BR qid.type ..PPUnder.BR -w ,.I lockwaits for exclusive access to.I lockfileinstead of just trying once..PP.I Locksets.B /env/promptto contain the name of the lock file..SH EXAMPLESBuild a.IR replica (1)database while preventing collisions with other occurrences..IP.EXcd /sys/lib/distlock 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