The field for interface names for netstat -i was 5 characters by
default, which is no longer sufficient with names like "vlan1234"
and "vtnet0". netstat -iW computed the necessary field width, but
also enlarged the address field by a lot (especially with IPv6 enabled).
Make netstat -i compute the field width for interface names with or
without -W. Note that the existing default output does not fit in
80 columns in any case. Update the man page accordingly, documenting
the remaining effect of -W with -i. Also add -W to the list of
General Options, as there are numerous pointers to this.
Reported by: Chris Ross
Reviewed by: melifaro, rgrimes, cy
Differential Revision: https://reviews.freebsd.org/D35703
(cherry picked from commit 231092bb6f)
Fix delete-old, since 22375931 MFC, annoy to delete them manually
every make delete-old.
These tests will run only on a sparc64 system, and so never run anymore.
Sponsored by: Netflix
(cherry picked from commit d6dffbae96)
print_cmsg() was assuming that the control message chain is well-formed,
but that isn't necessarily the case for sendmsg(2). In particular, if
cmsg_len is zero, print_cmsg() will loop forever. Check for truncated
headers and try to recover if possible.
Reviewed by: tuexen
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 4b0c6fa0dc)
Teach poll(2) to support Linux-style POLLRDHUP events for sockets, if
requested. Triggered when the remote peer shuts down writing or closes
its end.
Reviewed by: kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D29757
(cherry picked from commit 3aaaa2efde)
This register set contains the values of the fsbase and gsbase
registers. Note that these registers can already be controlled
individually via ptrace(2) via MD operations, so the main reason for
adding this is to include these register values in core dumps. In
particular, this will enable looking up the value of TLS variables
from core dumps in gdb.
The value of NT_X86_SEGBASES was chosen to match the value of
NT_386_TLS on Linux. The notes serve similar purposes, but FreeBSD
will never dump a note equivalent to NT_386_TLS (which dumps a single
segment descriptor rather than a pair of addresses) and picking a
currently-unused value in the NT_X86_* range could result in a future
conflict.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D34650
(cherry picked from commit 931983ee08)
This register set exposes the per-thread TLS register. It matches the
layout used by Linux on arm64. Linux does not implement this note for
32-bit arm.
Reviewed by: andrew, markj
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34595
(cherry picked from commit b2cb74c22c)
This includes adding support for NT_ARM_VFP for 32-bit binaries
running under aarch64 kernels both for ptrace(), and coredumps via the
kernel and gcore.
Reviewed by: andrew, markj
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34448
(cherry picked from commit add00c381e)
Add a elf_putregnote() helper to build the ELF note for a register
set. Once nice result of this approach is that this reuses the
kernel's support for generating 32-bit register sets for 32-bit
processes avoiding the need to duplicate that logic in elf32core.c.
Reviewed by: markj
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34447
(cherry picked from commit 4965ac059d)
When invoked by inetd, ctlstat -P will now produce output suitable for
ingestion into Prometheus.
It's a drop-in replacement for https://github.com/Gandi/ctld_exporter,
except that it doesn't report the number of initiators per target, and
it does report time and dma_time.
Sponsored by: Axcient
Relnotes: yes
Reviewed by: bapt, bcr
Differential Revision: https://reviews.freebsd.org/D29901
(cherry picked from commit 1a7f22d9c2)
This fixes a -Wnested-extern error with GCC 9. There is an existing
extern declaration in top.h.
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D31937
(cherry picked from commit 4c9cb057bd)
PR: 153276
Reported by: David Brennan
(cherry picked from commit 9f3203c003)
uudecode: add missing test files to Makefile
(cherry picked from commit 1b3af110bc)
uudecode: use SRCDIR in the regression test
(cherry picked from commit f5138631fb)
uudecode: move the new uudecode test from uuencode/ to uudecode/
I don't know how that happened.
(cherry picked from commit ae6aa2d43d)
This test cannot run without an unprivileged_user being specified
anyways, so just run as the unprivileged user. Revoking read permisions
works just as well if you're guaranteed non-root.
Reviewed by: pstef
Sponsored by: Klara, Inc.
(cherry picked from commit efba49ee5a)
If an unqualified name is provided, /dev/backlight/ is automatically
prepended instead of /dev/backlight.
MFC after: 3 days
(cherry picked from commit 2f60a7f902)
If fstat(2) fails the close(2) won't be called, which will leak the
file descriptor.
The idea was borrowed from OpenBSD, where similar patch
was applied for futimens(2).
MFC after: 1 week
(cherry picked from commit cb54c500d0)
In commit 6fa5bf0832 the pr(1) related code in diff was moved around,
but some part of the indentation was messed up, and one line was
duplicated. Remove the duplicated line, and fix up the indentation.
Reviewed by: bapt
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34398
(cherry picked from commit f7d6e97e4b)
This was meant to read `basic`, rather than a duplicate of `f_flag`. It
is largely irrelevant, though, as atf_test_case mostly just makes
sure that the proper functions are defined.
(cherry picked from commit 0e73b834f3)
This enables thread-aware timers which in turn fixes benchmark result
reports.
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D34238
(cherry picked from commit 6882d53b7f)
Providing a timestamp with seconds granularity helps make it obvious
that the display is updating.
Reviewed by: mckusick
Differential Revision: https://reviews.freebsd.org/D29181
(cherry picked from commit c9d1fa7003)
There likely should be a macro for the ports that support lto, but I'm
making sure that all the mips things build before decommissioning it and
this is the only thing that's broken...
Sponsored by: Netflix
(cherry picked from commit d677d4be0c)
The current implementation of sysctlbyname() does not support the user
sub-tree. This function exits with a return value of 0, but sets the
passed string buffer to an empty string.
As a result, the whereis program did not use the value of the sysctl
variable "user.cs_path", but only the value of the environment
variable "PATH".
This update makes whereis use the sysctl function with a fixed OID,
which already supports the user sub-tree.
(cherry picked from commit c454c57163)
Use strtoll() to parse the argument of the -S option.
FreeBSD has supported 64 bit file offsets for more than 25 years on
all architectures and off_t is a 64 bit integer type for that reason.
While strtol() returns a 64 bit value on 64 LP64 architectures, it
is limit to 32 bit on e.g. i386. The strtoll() function returns a 64
but result on all supported architectures and therefore supports the
possible file lengths and file offsets on 32 bit archtectures.
(cherry picked from commit 32066c96fa)
The man page states that "-t %+" prints time information in the same
format as date with no format specifier.
This was not the case, the format used was always that of date for the
POSIX locale.
The fix suggested by the reporter leads to output that matches the
documentation.
(cherry picked from commit 20f8331aca)