summaryrefslogtreecommitdiffstats
path: root/sys-utils/flock.1
diff options
context:
space:
mode:
authorBenno Schulenberg2014-07-15 23:07:38 +0200
committerKarel Zak2014-07-16 12:03:26 +0200
commite33ee284f9ca894c584a00d65141dff0746fa0c6 (patch)
tree2e9b77265ea8ffd2c106bc2204cb333925b9be39 /sys-utils/flock.1
parentdocs: bring a few more man pages closer to standard formatting (diff)
downloadkernel-qcow2-util-linux-e33ee284f9ca894c584a00d65141dff0746fa0c6.tar.gz
kernel-qcow2-util-linux-e33ee284f9ca894c584a00d65141dff0746fa0c6.tar.xz
kernel-qcow2-util-linux-e33ee284f9ca894c584a00d65141dff0746fa0c6.zip
docs: bring some more man pages closer to standard formatting
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Diffstat (limited to 'sys-utils/flock.1')
-rw-r--r--sys-utils/flock.144
1 files changed, 24 insertions, 20 deletions
diff --git a/sys-utils/flock.1 b/sys-utils/flock.1
index c245eda5f..6c28a35d7 100644
--- a/sys-utils/flock.1
+++ b/sys-utils/flock.1
@@ -24,37 +24,41 @@
.\" OTHER DEALINGS IN THE SOFTWARE.
.\"
.\" -----------------------------------------------------------------------
-.TH FLOCK 1 "September 2011" "util-linux" "User Commands"
+.TH FLOCK 1 "July 2014" "util-linux" "User Commands"
.SH NAME
flock \- manage locks from shell scripts
.SH SYNOPSIS
.B flock
-[options] <file|directory> <command> [command args]
+[options]
+.IR file | "directory command " [ arguments ]
.br
.B flock
-[options] <file|directory> -c <command>
+[options]
+.IR file | directory
+.BI \-c " command"
.br
.B flock
-[options] <file descriptor number>
+.RI [options] " number"
.SH DESCRIPTION
.PP
This utility manages
.BR flock (2)
-locks from within shell scripts or the command line.
+locks from within shell scripts or from the command line.
.PP
-The first and second forms wrap the lock around the executing a command, in
-a manner similar to
+The first and second of the above forms wrap the lock around the execution of a
+.IR command ,
+in a manner similar to
.BR su (1)
or
.BR newgrp (1).
-It locks a specified file or directory, which is created (assuming
-appropriate permissions), if it does not already exist. By default, if the
+They lock a specified \fIfile\fR or \fIdirectory\fR, which is created (assuming
+appropriate permissions) if it does not already exist. By default, if the
lock cannot be immediately acquired,
.B flock
waits until the lock is available.
.PP
-The third form uses open file by file descriptor number. See examples how
-that can be used.
+The third form uses an open file by its file descriptor \fInumber\fR.
+See the examples below for how that can be used.
.SH OPTIONS
.TP
\fB\-s\fP, \fB\-\-shared\fP
@@ -74,7 +78,7 @@ process which should not be holding the lock.
Fail rather than wait if the lock cannot be
immediately acquired.
See the
-.I \-E
+.B \-E
option for the exit code used.
.TP
\fB\-w\fP, \fB\-\-wait\fP, \fB\-\-timeout\fP \fIseconds\fP
@@ -82,20 +86,20 @@ Fail if the lock cannot be acquired within
.IR seconds .
Decimal fractional values are allowed.
See the
-.I \-E
+.B \-E
option for the exit code used.
.TP
\fB\-o\fP, \fB\-\-close\fP
Close the file descriptor on which the lock is held before executing
-.BR command\ .
+.IR command .
This is useful if
-.B command
+.I command
spawns a child process which should not be holding the lock.
.TP
\fB\-E\fP, \fB\-\-conflict\-exit\-code\fP \fInumber\fP
The exit code used when the \fB\-n\fP option is in use, and the
conflicting lock exists, or the \fB\-w\fP option is in use,
-and the timeout is reached. The default value is 1.
+and the timeout is reached. The default value is 1.
.TP
\fB\-c\fP, \fB\-\-command\fP \fIcommand\fP
Pass a single
@@ -153,14 +157,14 @@ also sets the FLOCKER env var to the right value so it doesn't run again.
The command uses
.B sysexits.h
return values for everything, except when using either of the options
-.I \-n
+.B \-n
or
-.I \-w
+.B \-w
which report a failure to acquire the lock with a return value given by the
-.I \-E
+.B \-E
option, or 1 by default.
.PP
-When using the <command> variant, and executing the child worked, then
+When using the \fIcommand\fR variant, and executing the child worked, then
the exit status is that of the child command.
.SH AUTHOR
.UR hpa@zytor.com