Since we don't set opterr to 0, getopt prints a message when it
encounters an unknown/invalid option. We therefore don't need to
print our own message in the default handler.
Reviewed by: kevans, theraven
Differential Revision: https://reviews.freebsd.org/D23662
realpath(3) is used a lot e.g., by clang and is a major source of getcwd
and fstatat calls. This can be done more efficiently in the kernel.
This works by performing a regular lookup while saving the name and found
parent directory. If the terminal vnode is a directory we can resolve it using
usual means. Otherwise we can use the name saved by lookup and resolve the
parent.
See the review for sample syscall counts.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D23574
This is the kdump counterpart of the truss support added in r358116, and
also a part of D23733. shm_open2 is the successor to shm_open.
Reviewed by: kaktus
shm_open2 is similar to shm_open, except it also takes shmflags and optional
name to label the anonymous region for, e.g., debugging purposes.
The appropriate support for decoding shmflags was added to libsysdecode in
r358115.
This is a part of D23733.
Reviewed by: kaktus
The first argument to shm_open(2) as well as shm_open2(2) may be a path or
SHM_ANON. Decode SHM_ANON, at least- paths will show up as namei results in
kdump output, which may be sufficient; in those cases, we'll have printed an
address.
Future commits will add support for shm_open2() to libsysdecode/truss/kdump.
Reported by: kaktus
MFC after: 3 days
This includes a small battery of /memreserve/ fixes to make sure dtc is
properly writing these regions into the output file and reading them back
out.
As of this update, dtc will now also assume common defaults for -I/-O if
only one is specified; namely, dts for one implies dtb for the other and
vice versa (Requested by: jhibbits, preserves GPL dtc behavior too).
MFC after: 1 week
--tabsize was previously listed as optional_argument, but didn't account for
the optionality of it in the argument handling. This is irrelevant -- the
manpage doesn't indicate that the argument is optional, and indeed there's
no clear interpretation of omitting the argument because there's no other
side effect of --tabsize.
The "malformed" argument part of the header on this message is simply
referring to usage like this:
% diff --tabsize 4 A B
With an optional_argument, the argument must be attached to the parameter
directly (e.g. --tabsize=4), so the argument is effectively NULL with the
above invocation as if no argument had been passed.
PR: 243974
Submitted by: fehmi noyan isi <fnoyanisi yahoo com> (diff.c portion)
MFC after: 3 days
- Long options must be stylized with the Fl macro as well.
Reviewed by: bapt
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D23642
Update libarchive to 3.4.2
Relevant vendor changes:
PR #1289: atomic extraction support (bsdtar -x --safe-writes)
PR #1308: big endian fix for UTF16 support in LHA reader
PR #1326: reject RAR5 files that declare invalid header flags
Issue #987: fix support 7z archive entries with Delta filter
Issue #1317: fix compression output buffer handling in XAR writer
Issue #1319: fix uname or gname longer than 32 characters in pax writer
Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR
Use localtime_r() and gmtime_r() instead of localtime() and gmtime()
X-MFC-With: r356212,r356365,r356416
MFC after: 1 week
The intent is to provide bsd-specific flags relevant to interpreter
and C runtime. I did not want to reuse AT_FLAGS which is common ELF
auxv entry.
Use bsdflags to report kernel support for sigfastblock(2). This
allows rtld and libthr to safely infer the syscall presence without
SIGSYS. The tunable kern.elf{32,64}.sigfastblock blocks reporting.
Tested by: pho
Disscussed with: cem, emaste, jilles
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D12773
Remove the long obsolete elf2aout utility. Should any ports need to
know when this left the tree, use 1300077 as the revision so we
avoid multiple bumps for the sparc64 removal.
Reviewed by: brooks@, emaste@
Differential Revision: https://reviews.freebsd.org/D23527
Only sparc64 used this, so we will be removing it from FreeBSD 13. Add
the usual deprecation notice in a MFC-able way.
Reviewed by: emaste, rgrimes
Differential Revision: https://reviews.freebsd.org/D23526
file could reasonably be NULL here if we we're using stdin. Albeit less
likely in normal usage, one could actually hit either of these warnings on
stdin.
ubmitted by: sigsys@gmail.com
MFC after: 3 days
This allows one to set the environment of the specified user either from
login.conf alone (-L) or both login.conf and ~/.login_conf if present (-U).
This is a supporting feature to allow service(8) to pull in the environment
of the "daemon" class before invoking the rc script.
This is a part of D21481.
Submitted by: Andrew Gierth < andrew_tao173.riddles.org.uk>
This is a sensible default used by, e.g., cron(8), and useful if one wanted
to honor it.
This is a part of D21481.
Submitted by: Andrew Gierth <andrew_tao173.riddles.org.uk>
This allows it to be easily suppressed in, e.g., the "daemon" class where it
will not be properly expanded.
This is a part of D21481.
Submitted by: Andrew Gierth <andrew_tao173.riddles.org.uk>
Changes to units.1:
- Change the description to a more descriptive "conversion calculator".
- Sort options.
- Split the description into sections to make it easier to navigate the
manual page.
- Improve the description of various options.
- Document the default value of the output format.
- Use more mdoc macros for better readability.
- Document the behavior of the PATH environmental variable.
- Improve examples.
- Add sections: EXIT STATUS, DIAGNOSTICS, and HISTORY.
- Document that units(1) cannot convert negative values and it handles long
unit lists poorly.
- Update the documentation of the -V flag to match the implementation.
units(1) prints its version and the units data file instead of its
version and usage information.
Changes to units.c:
- Update usage information.
- Sort longopts elements.
This commit does not attempts to change the current behavior of units(1).
What's left to do is probably defining a better versioning (at the moment
units(1) always reports "FreeBSD units" as its version) and changing the
behavior of the -V flag to only print version.
Reviewed by: allanjude (earlier version), bcr
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D18977
Disable new clang 10.0.0 warnings about misleading indentation in flex.
As this is contributed code with very messy indentation, which will
almost certainly never be upgraded, just disable the warning.
MFC after: 3 days
Fix the following -Werror warning from clang 10.0.0 in tip:
usr.bin/tip/tip/tip.c:428:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
if (gch == EOF)
^
usr.bin/tip/tip/tip.c:426:5: note: previous statement is here
} else if (!cumode && gch == character(value(FORCE)))
^
The intent was to have the EOF check grouped with the getchar() call
just above it. This was accidentally introduced in r354624.
MFC after: 3 days
Fix the following -Werror warning from clang 10.0.0 in procstat:
usr.bin/procstat/procstat_sigs.c:79:3: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation]
xo_close_container(name);
^
usr.bin/procstat/procstat_sigs.c:77:4: note: previous statement is here
} else
^
The intent was to group the xo_close_container() call to the previous
snprintf() call.
MFC after: 3 days
usr.bin/tip/tip/tip.c:428:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
if (gch == EOF)
^
usr.bin/tip/tip/tip.c:426:5: note: previous statement is here
} else if (!cumode && gch == character(value(FORCE)))
^
The intent was to have the EOF check grouped with the getchar() call
just above it. This was accidentally introduced in r354624.
MFC after: 3 days
usr.bin/procstat/procstat_sigs.c:79:3: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation]
xo_close_container(name);
^
usr.bin/procstat/procstat_sigs.c:77:4: note: previous statement is here
} else
^
The intent was to group the xo_close_container() call to the previous
snprintf() call.
MFC after: 3 days
- Two changes to encoder options:
encoder options may use plus or colon, but only one
encoder names can be specified as "@name"
This results in the syntax:
df --libxo @csv:no-header:leafs=name.available-blocks /
- If xo_set_program is called before xo_parse_args, honor the requested value
- add xo_errorn* function; repair newline-adding-on-xo_error bug
- test programs now use fixed name, since linux libtool prefixs "lt-"
- Fix "horse butt" comment in source code
- update test cases
PR: 242686
After r355693, random(6) -f sometimes fail to output all the lines of the
input file. This is because the range from which random indices are chosen
is too big, so occasionally the random selection doesn't correspond to any
line and nothing gets printed.
(Ed. note: Mea culpa. Working on r355693, I was confused by the sometime
use of 1-indexing, sometimes 0-indexing in randomize_fd().)
Submitted by: Ryan Moeller <ryan AT freqlabs.com>
X-MFC-With: r355693
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D23199
On these systems the (u)int64_t typedefs will not be implicitly defined by the
previous includes, so include <stdint.h> in the header that uses uint64_t.
Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D23202
(very sloppy specification) leaves an undefined value in *ret, so it is
wrong to inspect it, the error condition is enough.
Obtained from: OpenBSD
MFC after: 3 days
Once we know whether the files differ, we don't need to do any further
work.
PR: 242828
Submitted by: fehmi noyan isi <fnoyanisi@yahoo.com> (original version)
Reviewed by: bapt, kevans
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23152