| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
|
|
|
|
|
|
|
|
|
|
| |
Convert waitsec to a long long to be able to hold the full domain of
alarm(3) timeout on all platforms, and let strtonum(3) handle the input
validation. strtonum(3) also happens to provide a neater interface for
error handling, and it already includes our pre-existing empty input
check.
Sponsored by: Klara, Inc.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is most useful inside a shell script, allowing one to lock just
portions of a script rather than having to wrap the entire script in a
lock.
PR: 262738
Reviewed by: 0mp, allanjude (both previous versions)
Co-authored-by: Daniel O'Connor <darius@dons.net.au>
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D42718
|
|
|
|
|
|
|
|
|
|
| |
Provide basic coverage for the existing options, nothing deeper (e.g.,
pipe closing behavior) is tested in this set.
Reviewed by: allanjude
Feedback from: des
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D42714
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
None of these are essential in the lockf monitor (parent post-fork), so
close them to maintain the illusion that lockf hasn't been inserted into
the pipeline. This ensures that the correct effects happen on other
programs in the pipeline if the locked command closes or redirects these
elsewhere.
The original patch used -s to close stdout/stderr rather than closing
them unconditionally, but it's not clear that we really care that much.
kevans dropped that part when taking the patch, patch is otherwise by
listed author.
PR: 112379
Reviewed by: 0mp, allanjude (both earlier version), kevans
Feedback from: des
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D42713
|
|
|
|
|
|
|
|
|
|
|
| |
The -w flag was added without being noted in the usage statement; fix
that now.
While we're here, re-sort the getopt() string.
Reviewed by: 0mp, allanjude, des
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D42712
|
|
|
|
|
|
|
|
|
|
|
| |
The error message is expected, allow -s to suppress just that one since
it would loosely fall under the definition of "failure to acquire the
lock" described in the manpage for the -s option.
Reviewed by: 0mp, allanjude
Feedback from: des
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D42711
|
|
|
|
| |
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
|
|
|
|
| |
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
|
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
|
|
|
|
|
|
|
| |
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735
|
|
|
|
|
|
|
|
|
| |
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix
|
| |
|
|
|
|
| |
Notes:
svn path=/head/; revision=364832
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By default, lockf(1) opens its lock file O_RDONLY|O_EXLOCK. On NFS, if the
file already exists, this is split into opening the file read-only and then
requesting an exclusive lock -- and the second step fails because NFS does
not permit exclusive locking on files which are opened read-only.
The new -w option changes the open flags to O_WRONLY|O_EXLOCK, allowing it
to work on NFS -- at the cost of not working if the file cannot be opened
for writing.
(Whether the traditional BSD behaviour of allowing exclusive locks to be
obtained on a file which cannot be opened for writing is a good idea is
perhaps questionable since it may allow less-privileged users to perform
a local denial of service; however this behaviour has been present for a
long time and changing it now seems like it would cause problems.)
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D26005
Notes:
svn path=/head/; revision=364831
|
|
|
|
|
|
|
|
|
|
|
| |
* Add pretty small EXAMPLES section
* While here, fix a warning in line 98 (new sentence in new line)
Approved by: bcr@
Differential Revision: https://reviews.freebsd.org/D25205
Notes:
svn path=/head/; revision=362299
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
exist
Apply EX_UNAVAILABLE patch part from PR 170775 to match the documentation.
Checked with a command from PR 210770:
lockf -n /tmp/doesnotexist echo; echo $?
PR: 210770
MFC after: 1 week
Notes:
svn path=/head/; revision=345318
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.
The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
No functional change intended.
Notes:
svn path=/head/; revision=326276
|
|
|
|
|
|
|
| |
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=325188
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.
Still need to add real targets under targets/ to build packages.
Differential Revision: D2796
Reviewed by: brooks imp
Notes:
svn path=/head/; revision=284345
|
| |
| |
| |
| | |
Notes:
svn path=/projects/bmake/; revision=284172
|
| |\
| |/
|/|
| | |
Notes:
svn path=/projects/bmake/; revision=283595
|
| |\
| | |
| | |
| | | |
Notes:
svn path=/projects/bmake/; revision=270164
|
| | |
| | |
| | |
| | | |
Notes:
svn path=/projects/bmake/; revision=266219
|
| | |
| | |
| | |
| | | |
Notes:
svn path=/projects/bmake/; revision=265802
|
| |\ \
| | | |
| | | |
| | | | |
Notes:
svn path=/projects/bmake/; revision=255263
|
| | | |
| | | |
| | | |
| | | | |
Notes:
svn path=/projects/bmake/; revision=248169
|
| | | |
| | | |
| | | |
| | | | |
Notes:
svn path=/projects/bmake/; revision=246868
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Requested by: Simon Gerraty <sjg@juniper.net>
Notes:
svn path=/projects/bmake/; revision=239572
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
MFC after: 1 week
Notes:
svn path=/head/; revision=281582
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | | |
Submitted by: Conrad Meyer
MFC after: 1 week
Notes:
svn path=/head/; revision=281175
|
| |/
|/|
| |
| |
| |
| |
| |
| | |
PR: 191174
Submitted by: Franco Fichtner <franco at lastsummer.de>
Notes:
svn path=/head/; revision=267773
|
|/
|
|
|
|
|
|
|
|
| |
PR: bin/170775
Submitted by: Matthew Story <matthewstory@gmail.com>
Reviewed by: scottl
MFC after: 1 week
Notes:
svn path=/head/; revision=250462
|
|
|
|
|
|
|
|
|
|
| |
Disussed with: gavin
No objection from: doc
Approved by: joel
MFC after: 3 days
Notes:
svn path=/head/; revision=233648
|
|
|
|
|
|
|
|
|
|
|
| |
Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.
Reviewed by: ru
Approved by: philip, ed (mentors)
Notes:
svn path=/head/; revision=206622
|
|
|
|
|
|
|
|
|
|
| |
This is easy to confuse with the actual exit status of the program.
Instead exit with EX_SOFTWARE if the command doesn't exit normally.
MFC after: 1 month
Notes:
svn path=/head/; revision=181960
|
|
|
|
|
|
|
| |
Submitted by: John Hein
Notes:
svn path=/head/; revision=173241
|
|
|
|
| |
Notes:
svn path=/head/; revision=173202
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
lock experienced contention a number of processes would race to acquire
lock when it was released. This problem resulted in a lot of CPU
load as well as locks being picked up out of order.
Unfortunately, a regression snuck in which allowed multiple threads
to pickup the same lock when -k was not used. This could occur when
multiple processes open a file descriptor to inode X (one process
will be blocked) and the file is unlinked on unlock (thereby removing
the directory entry allow another process to create a new directory
entry for the same file name and lock it).
This changes restores the old algorithm of: wait for the lock, then
acquire lock when we want to unlink the file on exit (specifically
when -k is not used) and keeps the new algorithm for when -k is used,
which yields fairness and improved performance.
Also, update the man page to inform users that if lockf(1) is being
used to facilitate concurrency between a number of processes, it
is recommended that -k be used to reduce CPU load and yeld
fairness with regard to lock ordering.
Collaborated with: jdp
PR: bin/114341
PR: bin/116543
PR: bin/111101
MFC after: 1 week
Notes:
svn path=/head/; revision=172580
|
|
|
|
| |
Notes:
svn path=/head/; revision=165392
|
|
|
|
|
|
|
|
| |
changes the indentation style from 4 spaces to 8 spaces which we expect to
see in other FreeBSD source files.
Notes:
svn path=/head/; revision=151158
|
|
|
|
|
|
|
| |
Pointed out by: Amir Shalem
Notes:
svn path=/head/; revision=151056
|
|
|
|
|
|
|
|
|
|
|
| |
Add a flags argument to wait_for_lock so that O_NONBLOCK can be
passed to open if a user doesn't want the open to sleep until the
lock becomes available.
Submitted by: Amir Shalem (partially modified)
Notes:
svn path=/head/; revision=150984
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
for mutual exclusion:
A brief description of the problem:
1) Proc A picks up non-blocking lock on file X
2) Proc B attempts to pickup lock, fails then waits
3) Proc C attempts to pickup lock, fails then waits
4) Proc A releases lock
5) Proc B acquires lock, release it to pickup a non-blocking version
6) Proc C acquires lock, release it to pickup a non-blocking version
7) Both process B and C race each other to pickup lock again
This occurs mainly because the processes do not keep the lock after they have
been waiting on it. They drop it, attempt to re-acquire it. (They use the wait
to notify when the lock has become available then race to pick it up). This
results in additional CPU utilization during the race, and can also result
in processes picking locks up out of order.
This change attempts to correct this problem by eliminating the test/acquire
race and having the operating system handle it.
Reported by: kris
Tested by: kris
MFC after: 1 week
Notes:
svn path=/head/; revision=150977
|
|
|
|
|
|
|
|
|
|
|
| |
that have at least 3 characters.
MFC after: 1 week
Thanks to: Music band ``Chingon''
for keeping me company while searching for these.
Notes:
svn path=/head/; revision=148580
|
|
|
|
|
|
|
| |
Approved by: re (blanket)
Notes:
svn path=/head/; revision=147370
|
|
|
|
| |
Notes:
svn path=/head/; revision=146657
|
|
|
|
| |
Notes:
svn path=/head/; revision=140368
|
|
|
|
| |
Notes:
svn path=/head/; revision=132180
|
|
|
|
| |
Notes:
svn path=/head/; revision=131491
|