summaryrefslogtreecommitdiffstats
path: root/sys-utils/flock.1
diff options
context:
space:
mode:
authorAlexey Gladkov2008-11-24 16:15:36 +0100
committerKarel Zak2008-12-03 10:33:53 +0100
commitff5717391c3cebb4799c8e5d6dd9876fc5005fd0 (patch)
tree85a4f5c1c2cc88def62403810de87fa2643ae673 /sys-utils/flock.1
parentdocs: add feature-requests from RH bugzilla to TODO list (diff)
downloadkernel-qcow2-util-linux-ff5717391c3cebb4799c8e5d6dd9876fc5005fd0.tar.gz
kernel-qcow2-util-linux-ff5717391c3cebb4799c8e5d6dd9876fc5005fd0.tar.xz
kernel-qcow2-util-linux-ff5717391c3cebb4799c8e5d6dd9876fc5005fd0.zip
flock: Allow lock directory
With this patch, you can lock directory. Additionally, lockfile opens with O_NOCTTY. Try to open file with O_CREAT flag first, and without it if open fails with EISDIR. Suggested by H. Peter Anvin. Signed-off-by: Alexey Gladkov <legion@altlinux.org>
Diffstat (limited to 'sys-utils/flock.1')
-rw-r--r--sys-utils/flock.18
1 files changed, 5 insertions, 3 deletions
diff --git a/sys-utils/flock.1 b/sys-utils/flock.1
index 6965ba72e..6d60ff71f 100644
--- a/sys-utils/flock.1
+++ b/sys-utils/flock.1
@@ -30,6 +30,8 @@ flock \- Manage locks from shell scripts
.SH SYNOPSIS
\fBflock\fP [\fB\-sxon\fP] [\fB\-w\fP \fItimeout\fP] \fIlockfile\fP [\fB\-c\fP] \fIcommand...\fP
.PP
+\fBflock\fP [\fB\-sxon\fP] [\fB\-w\fP \fItimeout\fP] \fIlockdir\fP [\fB\-c\fP] \fIcommand...\fP
+.PP
\fBflock\fP [\fB\-sxun\fP] [\fB\-w\fP \fItimeout\fP] \fIfd\fP
.SH DESCRIPTION
.PP
@@ -37,14 +39,14 @@ This utility manages
.BR flock (2)
locks from within shell scripts or the command line.
.PP
-The first form wraps the lock around the executing a command, in a manner similar to
+The first and second forms wraps the lock around the executing a command, in a manner similar to
.BR su (1)
or
.BR newgrp (1).
-It locks a specified file, which is created (assuming appropriate
+It locks a specified file or directory, which is created (assuming appropriate
permissions), if it does not already exist.
.PP
-The second form is convenient inside shell scripts, and is usually
+The third form is convenient inside shell scripts, and is usually
used the following manner:
.PP
\fC(