<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/lockf, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>lockf.1: Organize and provide error numbers</title>
<updated>2026-04-08T20:09:15+00:00</updated>
<author>
<name>Alexander Ziaee</name>
<email>ziaee@FreeBSD.org</email>
</author>
<published>2026-04-08T20:08:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=dd201e407e48ba59bdfa1f71d41acfdac1a9c562'/>
<id>dd201e407e48ba59bdfa1f71d41acfdac1a9c562</id>
<content type='text'>
Add error numbers to the exit codes so that readers can decode them
without having to use a separate utility. Organize exits by error code.
Mark up the error constants with the error constant macro, even though
this is really not very helpful because people will search for the error
code, the macro is explicitly for the constants and not the codes.

While where, align and alphabetize the options list as well, fix
misaligned padding in an example, and a one-sentance-per-line error.

MFC after:		3 days
Reported by:		Antranig Vartanian &lt;antranigv@freebsd.am&gt;
Differential Revision:	https://reviews.freebsd.org/D48470
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add error numbers to the exit codes so that readers can decode them
without having to use a separate utility. Organize exits by error code.
Mark up the error constants with the error constant macro, even though
this is really not very helpful because people will search for the error
code, the macro is explicitly for the constants and not the codes.

While where, align and alphabetize the options list as well, fix
misaligned padding in an example, and a one-sentance-per-line error.

MFC after:		3 days
Reported by:		Antranig Vartanian &lt;antranigv@freebsd.am&gt;
Differential Revision:	https://reviews.freebsd.org/D48470
</pre>
</div>
</content>
</entry>
<entry>
<title>lockf: minor cosmetic cleanups, no functional change</title>
<updated>2025-07-10T17:54:20+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-06-24T23:08:46+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4c8b54f765c7676b4899b72de928bdb6d056dfb2'/>
<id>4c8b54f765c7676b4899b72de928bdb6d056dfb2</id>
<content type='text'>
Switch various flags from int -&gt; bool.

kill(getpid(), foo) and raise(foo) are equivalent in this context, so
switch to the latter as a minor preference for readability.

Use proper signal fences instead of volatile for our SIGALRM handler.

Reviewed by:	kib (earlier version), des
Differential Revision:	https://reviews.freebsd.org/D51027
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Switch various flags from int -&gt; bool.

kill(getpid(), foo) and raise(foo) are equivalent in this context, so
switch to the latter as a minor preference for readability.

Use proper signal fences instead of volatile for our SIGALRM handler.

Reviewed by:	kib (earlier version), des
Differential Revision:	https://reviews.freebsd.org/D51027
</pre>
</div>
</content>
</entry>
<entry>
<title>lockf: tests: add tests for the -p and -T features</title>
<updated>2025-07-10T17:54:20+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-06-24T23:04:11+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c82203e65d08036d25ed117f2617ef4ad07d6f97'/>
<id>c82203e65d08036d25ed117f2617ef4ad07d6f97</id>
<content type='text'>
Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D51026
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D51026
</pre>
</div>
</content>
</entry>
<entry>
<title>lockf: add a -T option to terminate the child upon early abort</title>
<updated>2025-07-10T17:54:20+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-06-24T23:03:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=679f619495f67eafc9fdb97d11381b14f2b49ccf'/>
<id>679f619495f67eafc9fdb97d11381b14f2b49ccf</id>
<content type='text'>
This is useful to avoid having the command running twice in the face of
the admin terminating the process.  Notably, if the -p option is not in
use (or can't be used, e.g., because we can't open the file for writing)
then this provides a nice alternative where one simply needs to send a
SIGTERM to the lockf(1) process associated with the lock file to clean
it all up.

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D51025
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is useful to avoid having the command running twice in the face of
the admin terminating the process.  Notably, if the -p option is not in
use (or can't be used, e.g., because we can't open the file for writing)
then this provides a nice alternative where one simply needs to send a
SIGTERM to the lockf(1) process associated with the lock file to clean
it all up.

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D51025
</pre>
</div>
</content>
</entry>
<entry>
<title>lockf: switch to a SIGCHLD model for reaping child</title>
<updated>2025-07-10T17:54:19+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-06-24T22:18:27+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7e8afac0cb2d53595c06717fd4a50d6ec97a3f9d'/>
<id>7e8afac0cb2d53595c06717fd4a50d6ec97a3f9d</id>
<content type='text'>
A future change will add a -T flag to forward SIGTERM along to the
child before we cleanup and terminate ourselves.  Using a SIGCHLD
handler to do that with SIGTERM blocked only while the child is actively
being collected will enable us to safely do so without having to worry
that our pid is potentially invalid.

Add a test that concisely checks that the child's error is properly
bubbled up to the caller.

Reviewed by:	des, kib
Differential Revision:	https://reviews.freebsd.org/D51024
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A future change will add a -T flag to forward SIGTERM along to the
child before we cleanup and terminate ourselves.  Using a SIGCHLD
handler to do that with SIGTERM blocked only while the child is actively
being collected will enable us to safely do so without having to worry
that our pid is potentially invalid.

Add a test that concisely checks that the child's error is properly
bubbled up to the caller.

Reviewed by:	des, kib
Differential Revision:	https://reviews.freebsd.org/D51024
</pre>
</div>
</content>
</entry>
<entry>
<title>lockf: add a -p mode to write the child's pid</title>
<updated>2025-07-10T17:54:19+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-06-24T15:41:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=df268d4b03a16869502d6842d40aeb66329db982'/>
<id>df268d4b03a16869502d6842d40aeb66329db982</id>
<content type='text'>
If we're going to hold the lock, it can be useful to scribble down the
pid that we spawned off to quickly associate the lock back to the
process that's keeping it open.

Reviewed by:	allanjude (previous version), des
Differential Revision:	https://reviews.freebsd.org/D51014
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we're going to hold the lock, it can be useful to scribble down the
pid that we spawned off to quickly associate the lock back to the
process that's keeping it open.

Reviewed by:	allanjude (previous version), des
Differential Revision:	https://reviews.freebsd.org/D51014
</pre>
</div>
</content>
</entry>
<entry>
<title>Update Makefile.depend files</title>
<updated>2024-10-14T17:26:17+00:00</updated>
<author>
<name>Simon J. Gerraty</name>
<email>sjg@FreeBSD.org</email>
</author>
<published>2024-10-14T17:24:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=a64729f5077d77e13b9497cb33ecb3c82e606ee8'/>
<id>a64729f5077d77e13b9497cb33ecb3c82e606ee8</id>
<content type='text'>
After building packages we have a number of new
and updated Makefile.depend files

Reviewed by:	stevek
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After building packages we have a number of new
and updated Makefile.depend files

Reviewed by:	stevek
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove residual blank line at start of Makefile</title>
<updated>2024-07-15T22:43:39+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2024-07-15T04:46:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e9ac41698b2f322d55ccf9da50a3596edb2c1800'/>
<id>e9ac41698b2f322d55ccf9da50a3596edb2c1800</id>
<content type='text'>
This is a residual of the $FreeBSD$ removal.

MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a residual of the $FreeBSD$ removal.

MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
</pre>
</div>
</content>
</entry>
<entry>
<title>lockf tests: Fix a race</title>
<updated>2024-07-14T18:29:14+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2024-07-14T16:13:13+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=498b3b494b8b3e500e555a9653d950b9e25a2f1a'/>
<id>498b3b494b8b3e500e555a9653d950b9e25a2f1a</id>
<content type='text'>
The test launches lockf(1) in the background and races with it, so it
shouldn't be using atf_check to check that lockf won the race.

MFC after:	1 week
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test launches lockf(1) in the background and races with it, so it
shouldn't be using atf_check to check that lockf won the race.

MFC after:	1 week
</pre>
</div>
</content>
</entry>
<entry>
<title>usr.bin: Automated cleanup of cdefs and other formatting</title>
<updated>2023-11-27T05:24:01+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-11-24T20:12:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5e3934b15a2741b2de6b217e77dc9d798d740804'/>
<id>5e3934b15a2741b2de6b217e77dc9d798d740804</id>
<content type='text'>
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+&lt;sys/cdefs.h&gt;.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/types.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/param.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/capsicum.h&gt;/

Sponsored by:		Netflix
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+&lt;sys/cdefs.h&gt;.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/types.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/param.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/capsicum.h&gt;/

Sponsored by:		Netflix
</pre>
</div>
</content>
</entry>
</feed>
