Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109362017
D48470.id149342.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D48470.id149342.diff
View Options
diff --git a/usr.bin/lockf/lockf.1 b/usr.bin/lockf/lockf.1
--- a/usr.bin/lockf/lockf.1
+++ b/usr.bin/lockf/lockf.1
@@ -1,4 +1,6 @@
.\"
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
.\" Copyright (C) 1998 John D. Polstra. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -22,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd November 25, 2023
+.Dd January 15, 2025
.Dt LOCKF 1
.Os
.Sh NAME
@@ -104,15 +106,10 @@
option is not used, then no guarantees around lock ordering can be made.
.Pp
The following options are supported:
-.Bl -tag -width ".Fl t Ar seconds"
+.Bl -tag -width "-t seconds"
.It Fl k
Causes the lock file to be kept (not removed) after the command
completes.
-.It Fl s
-Causes
-.Nm
-to operate silently.
-Failure to acquire the lock is indicated only in the exit status.
.It Fl n
Causes
.Nm
@@ -126,6 +123,11 @@
will create
.Ar file
if necessary.
+.It Fl s
+Causes
+.Nm
+to operate silently.
+Failure to acquire the lock is indicated only in the exit status.
.It Fl t Ar seconds
Specifies a timeout for waiting for the lock.
By default,
@@ -165,32 +167,32 @@
Otherwise, it returns one of the exit codes defined in
.Xr sysexits 3 ,
as follows:
-.Bl -tag -width ".Dv EX_CANTCREAT"
-.It Dv EX_TEMPFAIL
-The specified lock file was already locked by another process.
-.It Dv EX_CANTCREAT
-The
+.Bl -tag -width "EX_UNAVAILABLE (69)"
+.It Dv EX_USAGE Pq 64
+There was an error on the
.Nm
-utility
-was unable to create the lock file, e.g., because of insufficient access
-privileges.
-.It Dv EX_UNAVAILABLE
+command line.
+.It Dv EX_UNAVAILABLE Pq 69
The
.Fl n
option is specified and the specified lock file does not exist.
-.It Dv EX_USAGE
-There was an error on the
-.Nm
-command line.
-.It Dv EX_OSERR
-A system call (e.g.,
-.Xr fork 2 )
-failed unexpectedly.
-.It Dv EX_SOFTWARE
+.It Dv EX_SOFTWARE Pq 70
The
.Ar command
did not exit normally,
but may have been signaled or stopped.
+.It Dv EX_OSERR Pq 71
+A system call (e.g.,
+.Xr fork 2 Ns ).
+.It Dv EX_CANTCREAT Pq 73
+The
+.Nm
+utility
+was unable to create the lock file, e.g., because of insufficient access
+privileges.
+failed unexpectedly.
+.It Dv EX_TEMPFAIL Pq 75
+The specified lock file was already locked by another process.
.El
.Sh EXAMPLES
The first job takes a lock and sleeps for 5 seconds in the background.
@@ -211,9 +213,10 @@
Success
[1]+ Done lockf mylock sleep 1
.Ed
+.Pp
Lock a file and run a script, return immediately if the lock is not
-available. Do not delete the file afterward so lock order is
-guaranteed.
+available.
+Do not delete the file afterward so lock order is guaranteed.
.Pp
.Dl $ lockf -t 0 -k /tmp/my.lock myscript
.Pp
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 5, 1:56 AM (20 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15839755
Default Alt Text
D48470.id149342.diff (2 KB)
Attached To
Mode
D48470: lockf.1: Minor polish
Attached
Detach File
Event Timeline
Log In to Comment