Commit Graph

15533 Commits

Author SHA1 Message Date
Eugene Grosbein
d6054ee652 find.1: small language fix after previous change
collate -> collation
2022-07-22 18:46:38 +07:00
Eugene Grosbein
26a329f49f find.1: explain why "find -s" may differ from "find | sort"
In short, that's because a directory name may end
with a character that goes before slash (/).

MFC after:	1 week
2022-07-22 18:39:47 +07:00
Ed Maste
119db52f42 vtfontcvt: improve hex font format validation
Previously an EOF would result in sscanf returning -1 leading to a
crash.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-07-19 11:48:09 -04:00
Mateusz Piotrowski
f4b00609ec backlight(8): Update usage() to match the manual page
MFC after:	1 week
2022-07-19 16:56:27 +02:00
Mateusz Piotrowski
64a231b90b backlight.8: Show all possible modes in synopsis
MFC after:	1 week
2022-07-19 16:55:25 +02:00
Mateusz Piotrowski
5c3e424958 backlight.8: Standardize synopsis and improve examples
MFC after:	1 week
2022-07-19 16:49:50 +02:00
Mateusz Piotrowski
ef2d0816dd vtfontcvt(8): Update usage() to match vtfontcvt.8
MFC after:	2 weeks
2022-07-19 16:35:50 +02:00
Mateusz Piotrowski
cad64622ca vtfontcvt.8: Use D1 instead of Ql for readability
MFC after:	2 weeks
2022-07-19 16:35:49 +02:00
Mateusz Piotrowski
e0bd2ab2eb vtfontcvt.8: Sort synopsis
MFC after:	2 weeks
2022-07-19 16:35:49 +02:00
Mateusz Piotrowski
b38e3722f5 vtfontcvt.8: Improve synopsis and -f documentation
MFC after:	2 weeks
2022-07-19 16:35:48 +02:00
Ed Maste
df777aeb98 vtfontcvt: correct usage
Commit e7fd9688ea changed vtfontcvt's command line parsing, but did
not correctly update the usage (it omitted the new -o flag).

Fixes:		e7fd9688ea ("Move font related data structured to...")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-07-18 13:24:29 -04:00
Xin LI
1fbfa7a8dc usr.bin/cksum: localize _total variables. 2022-07-17 17:24:31 -07:00
Dmitry Chagin
ae37e4a0d1 kdump(1): Sort options in alphabetical order.
Reviewed by:		imp (early rev)
Differential Revision:	https://reviews.freebsd.org/D35775
MFC after:		2 weeks
2022-07-16 12:47:54 +03:00
Dmitry Chagin
fc90f3a281 ktrace: Increase precision of timestamps.
Replace struct timeval in header with struct timespec.
To differentiate header formats, add a new KTR_VERSIONED flag
set in the header type field similar to the existing KTRDROP flag.

To make it easier to extend ktrace headers in the future,
extend the existing header with a version field (version 0 is
reserved for older records without KTR_VERSIONED) as well as
new fields holding the thread ID and CPU ID.

Reviewed by:		jhb, pauamma
Differential Revision:	https://reviews.freebsd.org/D35774
MFC after:		2 weeks
2022-07-16 12:46:12 +03:00
John Baldwin
a6c3e5fa39 gcore: Trim stale bits from elf32core.c.
These should have been removed in
d95657a1a7.

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35748
2022-07-14 13:03:34 -07:00
Xin LI
643ac419fa Improve usability of head(1) and tail(1):
- Consistently support -q (quiet) and -v (verbose)
 - Allow specifying numbers with SI prefixes supported by expand_number(3)
 - Remove 2^31 limit on lines for head(1)

MFC after:		2 weeks
Reviewed by:		lwhsu, pauamma, gbe
Relnotes:		yes
Differential Revision: https://reviews.freebsd.org/D35720
2022-07-12 21:14:25 -07:00
Mateusz Piotrowski
6452fb1e87 protect.1: Document that protect(1) does not work in jails
The reason is that in order to protect a process procctl(2) needs
the PRIV_VM_MADV_PROTECT privilege, which is currently denied in jails
(see kern_jail.c).

MFC after:	1 week
2022-07-12 00:47:58 +02:00
Mateusz Piotrowski
cb56f86025 protect.1: Improve synopsis
While here, make the list's -width argument a bit shorter for
readability.

MFC after:	3 days
2022-07-07 20:09:16 +02:00
Gleb Smirnoff
d961ccd350 sockstat(1): print PID adjusted to the right
This allows for easy copy-and-paste of a unix(4) peer name for lookup.
With current implementation it is guaranteed that a peer listed could be
found in the output.

Differential revision:	https://reviews.freebsd.org/D35727
2022-07-06 22:19:08 -07:00
Gleb Smirnoff
2c436d4890 sockstat(1): print out full connection graph for unix(4) sockets
Kernel provides us with enough information to display all possible
connections between UNIX sockets.

o Store unp_conn, xu_firstref and xu_nextref in the faddr of a UNIX sock.
o Build tree of file descriptors, indexed by the socket pointer.
o In displaysock() print out all possible information:
  1) if socket is bound, print name of this socket
  2) if socket has connected to a peer with a name, print peers name
  3) if socket has connected to a peer without a name, print [pid fd]
  4) if a bound socket has received connections, print list of them
     as [pid fd]
  Previously, only 1) either 2) were printed.

Reviewed by:		tuexen
Differential revision:	https://reviews.freebsd.org/D35726
2022-07-06 22:19:08 -07:00
Gleb Smirnoff
c5bdcd1f10 sockstat(1): widen the FD printing format
Three digit file descriptors are very common these days.  So let the
columns not break with them.

Reviewed by:		tuexen
Differential revision:	https://reviews.freebsd.org/D35725
2022-07-06 22:19:08 -07:00
Gleb Smirnoff
a83d596f43 sockstat(1): use tree(3) rbtree instead of hash
o Use tree to lookup by socket kvaddr. The size of hash is too big for a
  small virtual machine and at the same time too little for a large
  production server.  A tree would better fit here.
o For those pcbs, that don't have a socket associated, use a list.
o Provide a second tree to lookup by pcb kvaddr.  These removes full hash
  traversal when printing every unix(4) socket.

Reviewed by:		tuexen
Differential revision:	https://reviews.freebsd.org/D35724
2022-07-06 22:19:08 -07:00
Gleb Smirnoff
7d016011f4 sockstat(1): we don't need kernel struct unpcb
Fixes:	0e229f343f
2022-07-06 22:19:08 -07:00
Mike Karels
231092bb6f netstat -i: do not truncate interface names
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
MFC after:	1 week
2022-07-06 07:12:16 -05:00
Tom Jones
1e692b938e xargs: fix description of strnsubst return value
Reported by:	oshogbo
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D35574
2022-07-05 16:27:15 +01:00
Tom Jones
f058359ba5 xargs: terminate if line replacement cannot be constructed
If the line with replacement cannot be constructed xargs should
terminate as documented in the man page

We encounter this error, but gnu/xargs doesn't because they have a much
larger limit for created outputs (~10000 lines).

Reviewed by:	oshogbo
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D35574
2022-07-05 16:18:05 +01:00
Tom Jones
d458eb8de1 diff3: make the eflag logic easier to follow
Discussed with:	dim
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D35324
2022-07-05 12:36:11 +01:00
John Baldwin
d95657a1a7 gcore: Use PT_GETREGSET for NT_THRMISC and NT_PTLWPINFO.
This avoids the need for dealing with converting lwpinfo for alternate
ABIs in gcore itself.

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35667
2022-06-30 10:05:02 -07:00
John Baldwin
d2a3c30a51 gcore: Remove unused typedefs.
These are no longer needed after commit 4965ac059d which used
PT_GETREGSET to fetch NT_PRSTATUS and NT_FPREGSET.

Reviewed by:	markj, emaste
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35665
2022-06-30 10:04:49 -07:00
Fernando Apesteguía
4a3c598f35 Bump .Dd for recently modified manual pages
During the removal of named(8) references, some pages were modified but their
.Dd where not updated accordingly.

Reported by:	lwhsu@
Fixes:	942e234d86
2022-06-27 18:20:03 +02:00
Fernando Apesteguía
942e234d86 Remove references to named(8)
named(8) hasn't been in base for some time. Remove all references to it in
manual pages.

Approved by:	manpages (Pau Amma)
Differential Revision:	https://reviews.freebsd.org/D35586
2022-06-26 18:53:08 +02:00
Tom Jones
26b5deef22 diff3: Add man page description for version and help
Reviewed by:	Pau Amma
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D35325
2022-06-23 13:37:28 +01:00
Alexander V. Chernikov
c8f34118ac netstat: print path weight when showing routes in structured output.
Differential Revision: https://reviews.freebsd.org/D35530
MFC after:	2 weeks
2022-06-22 12:47:06 +00:00
Dmitry Chagin
4d496ab44a kdump: Decode Linux *at() syscalls
MFC after:		2 weeks
2022-06-22 14:29:38 +03:00
Dmitry Chagin
ed2f123a21 kdump: For future use made decode_filemode() public
MFC after:		2 weeks
2022-06-22 14:26:50 +03:00
Dmitry Chagin
39de84b619 kdump: Decode Linux clock_nanosleep syscall
MFC after:		2 weeks
2022-06-22 14:21:42 +03:00
Dmitry Chagin
f587a2a765 kdump: Decode Linux sigprocmask how argument
MFC after:		2 weeks
2022-06-22 14:20:39 +03:00
Dmitry Chagin
b9b86b6742 kdump: Decode getitimer, setitimer which argument
Reviewed by:		jhb (previous version, without truss)
Differential revision:	https://reviews.freebsd.org/D35231
MFC after:		2 weeks
2022-06-22 14:19:31 +03:00
Dmitry Chagin
3606a213bf kdump: Decode Linux l_sigset_t.
Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35153
MFC after:		2 weeks
2022-06-22 14:15:20 +03:00
Dmitry Chagin
8a0f6d8cfd kdump: Add preliminary support for decoding Linux syscalls
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D35216
MFC after:		2 weeks
2022-06-22 14:03:56 +03:00
Dmitry Chagin
8b8e2e8f41 kdump: For future use extract common code to a separate files
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D35356
MFC after:		2 weeks
2022-06-22 14:01:36 +03:00
Kyle Evans
4014365e42 mixer: remove volume backwards compat, add % interpretation
The current situation is fairly confusing, where an integer is interpreted
as a percent until you slap a decimal on it and magically it becomes an
absolute value.

Let's have a flag day in 14.0 and remove this shim entirely.  Setting with
percent can still be useful, so allow a trailing '%' to indicate as such.
As a side effect, we tighten down the format allowed in the volume a little
bit by ensuring there's no trailing garbage after the value once it's
separated into left and right components.

Reviewed by:	christos, hselasky, pauamma_gundo.com (manpages)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D35101
2022-06-17 22:50:58 -05:00
Mark Johnston
4b0c6fa0dc truss: Make control message header parsing more robust
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
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35476
2022-06-14 12:00:59 -04:00
Stefan Eßer
78bc019d22 usr.bin/bc: update to version 5.3.1
This version adds support for command line editing and history using
the libedit or readline libraries in addition to the line editing
features available in previous versions.

The version in the base system is configured to use libedit.

This allows to choose between emacs and vi line editing commands and
to use command overrides via a ~/.editrc file.

Merge commit 'bd54318046bfee055b140705a5cfd4148e78da07'

PR:		264010

MFC after:	2 weeks
2022-06-11 13:14:37 +02:00
John Baldwin
1c44d2bf86 usr.bin/dtc: Include <limits> for std::numeric_limits<>.
This is needed when building natively as a cross-tool on hosts such as
Linux using more recent versions of libstdc++.

Co-authored-by:	Alexander Richardson <arichardson@FreeBSD.org>
Obtained from:	CheriBSD
2022-06-09 10:20:03 -07:00
John Baldwin
81c857dd7e gcore: Don't hardcode VM write permissions.
This ensures read-only PT_LOAD segments are not marked as writable in
the phdr flags.

Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35398
2022-06-06 16:43:02 -07:00
John Baldwin
ad52a7bb03 gcore: Remove unused elf_note_arm_vfp function.
Fixes:		add00c381e Use a regset for NT_ARM_VFP.
2022-06-06 11:06:49 -07:00
Gordon Bergling
bb0e21032b sed(1): Fix a typo in a source code comment
- s/Initialy/Initially/

Obtained from:	NetBSD
MFC after:	3 days
2022-06-04 20:27:45 +02:00
Arseny Smalyuk
d18b4bec98 netinet6: Fix mbuf leak in NDP
Mbufs leak when manually removing incomplete NDP records with pending packet via ndp -d.
It happens because lltable_drop_entry_queue() rely on `la_numheld`
counter when dropping NDP entries (lles). It turned out NDP code never
increased `la_numheld`, so the actual free never happened.

Fix the issue by introducing unified lltable_append_entry_queue(),
common for both ARP and NDP code, properly addressing packet queue
maintenance.

Reviewed By: melifaro
Differential Revision: https://reviews.freebsd.org/D35365
MFC after:	2 weeks
2022-05-31 21:06:14 +00:00
Kyle Evans
5b7adeb184 zdiff: avoid non-conformant features
`setvar` is a non-conformant feature that looks slightly neater but is
not portable to other /bin/sh implementations.  Making the script
portable is straightforward, so let's do it.

Tests are added to make sure that I didn't break anything major in the
process.

Reviewed by:	bapt (previous version), jilles
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D35275
2022-05-30 19:25:16 -05:00
Alexander V. Chernikov
08e77283b7 sockstat: be more verbose when reporting kernel/userland size mismatch.
MFC after:	2 weeks
2022-05-30 10:54:53 +00:00
Rick Macklem
d92dc803f6 nfsstat: Add an entry to output NFSPROC_APPENDWRITE count
Commit 5218d82c81 added a new NFSv4.1/4.2 procedure called
AppendWrite that uses a Verify to avoid a separate Getattr RPC
for the common case where the client knows the correct file
size for O_APPEND writes.

This patch modifies nfsstat so that it displays a count of
these new RPCs for the "-E -c" option.
2022-05-28 16:27:02 -07:00
Gleb Smirnoff
d59bc188d6 sockbuf: remove unused mbuf counter and cluster counter
With M_EXTPG mbufs these two counters already do not represent the
reality.  As we are moving towards protocol independent socket buffers,
which may not even use mbufs at all, the counters become less and less
relevant.  The only userland seeing them was 'netstat -x'.

PR:			264181 (exp-run)
Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35334
2022-05-27 08:20:17 -07:00
Tom Jones
3ddd6eb688 diff3: Add help and version options
Add help and version flags. Exit values in these paths are set to match
the behaviour of gnu diff3.
2022-05-25 14:53:06 +01:00
Tom Jones
59f6408d8d diff3: Copy line into debug information
Sponsored by:	Klara Inc.
2022-05-25 14:45:51 +01:00
Tom Jones
7d975c7f93 diff3: Don't perform a bitwise OR when comparing diffs
This fixes the build now that it uses -Wbitwise-instead-of-logical

Sponsored by:	Klara Inc.
2022-05-25 14:43:14 +01:00
Bartosz Sobczak
cdcd52d41e
irdma: Add RDMA driver for Intel(R) Ethernet Controller E810
This is an initial commit for RDMA FreeBSD driver for Intel(R) Ethernet
Controller E810, called irdma.  Supporting both RoCEv2 and iWARP
protocols in per-PF manner, RoCEv2 being the default.

Testing has been done using krping tool, perftest, ucmatose, rping,
ud_pingpong, rc_pingpong and others.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	#manpages (pauamma_gundo.com) [documentation]
MFC after:	1 week
Relnotes:	yes
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D34690
2022-05-23 16:52:49 -07:00
Andrew Turner
f9ca52bab5 Use getpagesize in gcore to find the page size
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35194
2022-05-19 11:32:26 +01:00
Christian Weisgerber
9bf4983f54 truss: add ppoll(2) argument decoding
PR:		264029
Approved by:	emaste
MFC after:	3 days
2022-05-17 20:23:25 +02:00
Dimitry Andric
04eeddc0aa Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:44:34 +02:00
Dimitry Andric
5e801ac66d Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:43:32 +02:00
Dmitry Chagin
586ed32106 kdump: Decode cpuset_t.
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D34982
MFC after:		2 weeks
2022-05-11 10:40:39 +03:00
Tom Jones
c1c381eb7f diff3: Remove test case that references non existent test files
Sponsored by:	Klara, Inc.
2022-05-02 16:00:44 +01:00
Piotr Pawel Stefaniak
ed016aa435 base64: ignore -i as promised 2022-04-24 08:23:27 +02:00
Piotr Pawel Stefaniak
aad4fd5495 Add a quoted-printable encoder/decoder
As an example:
printf 'We don=27t know what to do with other=20worlds.=0D=0A' \
| bintrans qp -u

Differential Revision:	https://reviews.freebsd.org/D34933

Reviewed by:	debdrup (manpage)
2022-04-24 08:20:27 +02:00
Piotr Pawel Stefaniak
ff2b1ffbb0 bintrans: adjust mmencode.c to style(9) 2022-04-24 08:19:49 +02:00
Piotr Pawel Stefaniak
9d68da4ee8 bintrans: make mmencode.c compilable
Also remove MSDOS code, base64 code and commented out code.
2022-04-24 08:19:48 +02:00
Piotr Pawel Stefaniak
8a65b02dac bintrans: import mmencode.c for quoted-printable en/de-coding
This is a preliminary commit in preparation for exposing
a quoted-printable encoder and decoder through the new command bintrans.
2022-04-24 08:19:48 +02:00
Simon J. Gerraty
2f2a5ecdf8 Merge bmake-20220418
o ignore '.POSIX:' if not in first non-comment line
        of Makefile as specified by POSIX.
        add unit-tests for above.

Merge commit '92bfae0e6bd53a7a0d6fe55e70a916d86cf26e8b'
2022-04-22 13:42:11 -07:00
Alan Somers
1a7f22d9c2 ctlstat: add prometheus output
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.

MFC after:	2 weeks
Sponsored by:	Axcient
Relnotes:	yes
Reviewed by: 	bapt, bcr
Differential Revision: https://reviews.freebsd.org/D29901
2022-04-20 15:18:41 -06:00
Gordon Bergling
583bb9c530 sed(1): Fix a typo in the manual page
- s/occurances/occurrences/

MFC after:	3 days
2022-04-20 13:00:42 +02:00
Tom Jones
034dd2d54f diff3: Add support for -m
diff3 in -m mode generates a complete file with changes bracketed with
conflict markers. This adds support for diff3 to generate version
control style three way merge output.

The output format was inferred from looking at the gnu diff3 output on a
selection of test files as a specification of what diff3 -m should
output is not available. It is likely there are cases where the -m
output differs from other tools and I am happy to update diff3 to
address these.

Discussed with:	pstef, kevans
Sponsored by:	Klara, Inc.
2022-04-19 16:20:24 +01:00
Tom Jones
9ab079c5e8 diff3: Add support for -A
Diff3 in -A mode generates an ed script to show how the 3 files and
brackets changes that conflict. The ed script generated should when
applied leave familiar merge conflict markers in a patched file.

Diff3 output is not documented, this feature has been arrived at by
comparing bsd diff3 output to gnu diff3 output until they were made to
agree. There are likely to still be differences between these formats.

The gnu diff3 guide is actually quite good at explaining how diff3
output should appear, but it doesn't cover every form of output from
diff3.

https://www.gnu.org/software/diffutils/manual/diffutils.html#Comparing-Three-Files

Discussed with:	pstef, kevans
Sponsored by:	Klara, Inc.
2022-04-19 15:54:32 +01:00
Tom Jones
df092859b4 diff3: seperate old and new markers from file markers
With -A and -m output the conflict markers are not tied to the file
name. Seperate out these markers.

Sponsored by:	Klara, Inc.
2022-04-19 15:40:07 +01:00
Tom Jones
2184ca3f19 diff3: Clean up printing of ranges for edscript output
Replace the edscript code that tracked and printed lines using byte
offsets with code that can work from line offsets.

This tidies up the reduces duplication in the edscript output code. It
also fixes the usage of the de struct so that it only tracks diffs as
line offsets rather than the usage changing from line offsets to byte
offsets during the lifetime of diff3.

Large files with large numbers of ranges will probably suffer in
performance here, but as we don't use diff3 yet this isn't a regression.
Include a warning for future hackers so they have a place to start
hacking from.

Reviewed by:	pstef
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34941
2022-04-19 14:51:18 +01:00
Kyle Evans
efba49ee5a diff: tests: loosen up requirements for report_identical
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.
Differential Revision:	https://reviews.freebsd.org/D34950
2022-04-18 23:04:13 -05:00
Piotr Pawel Stefaniak
540a99289b Add the base64 command using b64encode and b64decode
Various scripts expect the base64 command to be present. We've had the
code and it's been exposed as b64encode/b64decode, but it wasn't widely
known under these names and the syntax is much different.

Reviewed by:	delphij
Differential Revision:	https://reviews.freebsd.org/D32945
2022-04-18 13:53:59 +02:00
Piotr Pawel Stefaniak
2ad786c63a b64encode: implement -w to wrap lines
This functionality is present in GNU base64 and I find it useful when
I want to generate random, ASCII-clean data of specific width.

Reviewed by:	delphij
Differential Revision:	https://reviews.freebsd.org/D32944
2022-04-18 13:53:58 +02:00
Piotr Pawel Stefaniak
f331cf9b04 bintrans: reinstate a test case that I lost
Reported by:	https://ci.freebsd.org/job/FreeBSD-main-amd64-test/21166
2022-04-18 13:53:58 +02:00
Piotr Pawel Stefaniak
47bcbde91d bintrans: move files to a new directory
And reflect the change in various places.
2022-04-18 10:53:11 +02:00
Piotr Pawel Stefaniak
4cd4841a27 Modularize uuencode and uudecode by wrapping them in bintrans.c
The program will be installed as bintrans, uuencode, uudecode,
b64encode, and b64decode and will be responsible for running the coders
according to their historical behavior.

Additionally, bintrans will be able to take a parameter designating
the coder and accept all its options in this form:
bintrans <coder> [options]
and the behavior should be the same as if
<coder> [options]
was invoked.
This has the advantage that adding coders won't require installing them
as binaries.

Move uudecode files to uuencode since the latter is the one that
provides the manual page.

Reviewed by:	delphij (previous version)
Differential Revision:	https://reviews.freebsd.org/D32943
2022-04-18 10:46:44 +02:00
Tom Jones
7c03df6855 diff3: allow diff3 ed scripts to generate deletions
diff3 with the -e (ed script flag) can generate line deletions, add
support for deletions and add a test case to exercise this behaviour.
This functionality was unearthed through comparison of bsd diff3 and gnu
diff3 output.

Reviewed by:	pstef
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34912
2022-04-15 15:00:59 +01:00
Daniel Ebdrup Jensen
bd1eafcdd0 protect(1): Correct typo and add newline
Fix a typo, and move a sentence onto a new line in accordance with
mdoc(7) syntax.

While here, also remember to bump .Dd accordingly, as it was missed in
the prior commit.

Reported by:	maxim@
2022-04-12 12:38:50 +02:00
Adam Wolk
c8b6be0f7d protect.1: document existence of _oomprotect
Improve discoverability of the functionality by mentioning in the
userland tool manual. Add a SEE ALSO entry to rc.conf(5) where more
details are provided.

Sponsored by:   Fudo Security (a.wolk)
Differential Revision:	https://reviews.freebsd.org/D30334
2022-04-12 00:23:43 +02:00
Konstantin Belousov
bd8701dede Document procstat(1) advlock command
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34834
2022-04-10 00:47:50 +03:00
Konstantin Belousov
a5229a255e Implement procstat(1) advlocks command
to display list of the advisory file locks in the system.

Example output
$ procstat advlock
RW  TYPE   PID SYSID          FSID               RDEV   INO START LEN PATH
RO FCNTL  5836     0  0x878700ff02 0xffffffffffffffff    57     0   0 /tmp/2
RW FLOCK    -1     0  0x878700ff02 0xffffffffffffffff    13     0   0 /tmp/1

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34834
2022-04-10 00:47:50 +03:00
Konstantin Belousov
e79866ddf1 procstat(1): add ability to specify subcommands not requiring pid lists
Add PS_MODE_NO_KINFO_PROC cmd modifier that indicates that neither
process list should be queried from the kernel, nor list of pids or `-a`
switch provided on the command line to filter the output.

This is intended for use by commands that query information not
neccessary attributed to specific process.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34834
2022-04-10 00:47:50 +03:00
Lewis Cook
fcaf016796 Correct calendar date entry for myself
Approved by:		hselasky (src)
Differential Revision:	https://reviews.freebsd.org/D34839
2022-04-08 14:02:30 +01:00
Mateusz Piotrowski
2f60a7f902 backlight.8: Fix description of -f
If an unqualified name is provided, /dev/backlight/ is automatically
prepended instead of /dev/backlight.

MFC after:	3 days
2022-04-08 12:27:13 +02:00
Simon J. Gerraty
1d3f2ddc32 Merge bmake-20220330
Merge commit 'a052cb432096794be5070dc68a2b302eaf5a4783'
2022-04-03 12:58:43 -07:00
Gordon Bergling
2fc0894023 top(1): Fix a typo in a source code comment
- s/accomodate/accommodate/

MFC after:	3 days
2022-04-02 14:53:20 +02:00
Mateusz Piotrowski
e6013eb071 systat.1: Fix lists
Some of the lists were not displaying correctly. Fix that.

Also, address linters errors.

Fixes:	22054f8891 Report I/O stats from the CAM_IOSCHED_DYNAMIC extension
MFC after:	1 week
2022-04-02 00:49:53 +02:00
Jose Luis Duran
2d5df84081 dtc.1: Fix the display of directives ending with semicolons
While here, fix a typo and bump the date.

Obtained from:	https://github.com/davidchisnall/dtc/pull/71
Fixes:	6979e8cb6e
2022-03-30 17:45:50 +02:00
Piotr Pawel Stefaniak
ae6aa2d43d uudecode: move the new uudecode test from uuencode/ to uudecode/
I don't know how that happened.

Fixes:		9f3203c003 "uudecode: correct error message"
2022-03-29 07:29:39 +02:00
Piotr Pawel Stefaniak
f5138631fb uudecode: use SRCDIR in the regression test
Fixes:		9f3203c003 "uudecode: correct error message"
2022-03-28 21:01:28 +02:00
Brooks Davis
b1ad6a9000 syscallarg_t: Add a type for system call arguments
This more clearly differentiates system call arguments from integer
registers and return values. On current architectures it has no effect,
but on architectures where pointers are not integers (CHERI) and may
not even share registers (CHERI-MIPS) it is necessiary to differentiate
between system call arguments (syscallarg_t) and integer register values
(register_t).

Obtained from:	CheriBSD

Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D33780
2022-03-28 19:43:03 +01:00
Piotr Pawel Stefaniak
1b3af110bc uudecode: add missing test files to Makefile
Fixes:		9f3203c003 "uudecode: correct error message"
2022-03-28 11:51:39 +02:00
Piotr Pawel Stefaniak
9f3203c003 uudecode: correct error message
PR:		153276
Reported by:	David Brennan
2022-03-28 09:01:35 +02:00
Piotr Pawel Stefaniak
d5d3f5dab2 uu{encode,decode}: improve style 2022-03-28 09:01:35 +02:00
John Baldwin
931983ee08 x86: Add a NT_X86_SEGBASES register set.
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
2022-03-24 11:36:19 -07:00
John Baldwin
b2cb74c22c arm,arm64: Add a NT_ARM_TLS read-only register set.
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
2022-03-23 13:33:06 -07:00
John Baldwin
add00c381e Use a regset for NT_ARM_VFP.
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
2022-03-23 13:33:06 -07:00
Piotr Pawel Stefaniak
8b1f5965d9 procstat: remove set but not used variable
In an earlier version of D26310, strcmp was strncmp.
2022-03-18 10:03:56 +01:00
Piotr Pawel Stefaniak
fde687c239 backlight: Remove set but not used variable 2022-03-18 10:03:55 +01:00
Fernando Apesteguía
4bbc8ee29e logger.1: Clarify -i flag
The PID of the logger process is always recorded along with the move from RFC
3164 to RFC 5424.

Indicate the -i flag is a no-op now in logger(1).

Related to a similary change in syslog.3

Reported by:	danfe@
Approved by:	manpages (0mp)
Fixes:	94eb6c42ab
Differential Revision:	https://reviews.freebsd.org/D34578
2022-03-16 11:41:55 +01:00
Hans Petter Selasky
d5ad1713cc Chase mixer(8) command-line interface changes
Some more nits regarding mute feature.

Differential revision:	https://reviews.freebsd.org/D34545
Sponsored by:		NVIDIA Networking
2022-03-14 09:38:04 +01:00
Mateusz Piotrowski
e83a53abeb Chase mixer(8) command-line interface changes
FreeBSD 14.0 is going to ship with a new implementation of the mixer(8)
command. Unfortunately, in order to support new features like mute, the
command-line interface of the new implementation is not backwards
compatible.

Update all the remaining documentation and scripts in the src tree
to use the new syntax.

While here, document in usbhidaction.1 that the mute functionality is
now supported.

Reviewed by:	christos, debdrup, hselasky
Approved by:	hselasky (src)
Fixes:	903873ce15 Implement and use new mixer(3) library for FreeBSD.
Differential Revision:	https://reviews.freebsd.org/D34545
2022-03-13 17:43:49 +01:00
Steve Wills
db11c57a6c usr.bin/who.c: Fix boot time checking
The boot time entry doesn't have a tty specified, so don't check it.
While here, make ttystat handle that case.

Approved by:	kevans (src)
Differential Revision:	https://reviews.freebsd.org/D34524
2022-03-12 11:49:49 -05:00
Mariusz Zaborski
cb54c500d0 touch: don't leak descriptor if fstat(2) fails
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
2022-03-12 11:38:12 +01:00
John Baldwin
4965ac059d gcore: Use PT_GETREGSET to fetch NT_PRSTATUS and NT_FPREGSET.
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
2022-03-10 15:40:44 -08:00
Simon J. Gerraty
31fde97357 script: use %n at the end of default tstamp_fmt
Since we are only outputting time-stamps when they differ
ending it with a newline, interferes with the output less.
2022-03-10 09:42:55 -08:00
Tom Jones
93b7af1d85 diff: Re-add void argument to usage
Previous commit (8cf449db88)
unintentionally dropped the 'void' argument to usage, reinstate it.

Sponsored by:	Klara Inc.
2022-03-10 16:24:02 +00:00
Tom Jones
8cf449db88 diff: add support for --help and --version
Add support for --help and --version to be compatible with gnu diff.

gnu diff --help writes to stdout, do the same to be compatible

Reviewed by:	bapt, pstef, debrup, Pau Amma
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D34508
2022-03-10 16:17:37 +00:00
Simon J. Gerraty
7b45ad3f89 script -T skip timstamps for same second
The result is much more readable if we only output the time-stamp
when it is at least 1s since last one.
2022-03-09 22:19:53 -08:00
Simon J. Gerraty
6c4afed566 script add -T fmt to print time-stamps
script -r is useful for recording time-stamps of when output
happened.  With -T, rather than playback the script in real-time
we simply print the time-stamps to show when the output happened.

This is very useful for example, for analyzing boot time activity.

If the fmt provided contains no % characters the default
%n@ %s [%Y-%m-%d %T]
is used, which lends itself to analysis by tools as well as humans.

Sponsored by:	Juniper Networks, Inc.

Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D34511
2022-03-09 13:33:03 -08:00
Tom Jones
7e64519a47 diff: set cflag when passed to diff
In b5541f456d when flags were converted to
be boolean, the setting of cflag as an integer was removed, but no
boolean set was added.

This effects the output format of dates, but the context type was set to
D_CONTEXT so other functionality worked.

Reviewed by:	bapt
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D34481
2022-03-09 09:32:14 +00:00
Alfonso S. Siciliano
e031614d59
bsddialog: new utility for TUI dialogs and widgets
Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34101
2022-03-06 22:50:20 +01:00
Dimitry Andric
f7d6e97e4b Fix indentation in usr.bin/diff/pr.c
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
2022-03-04 20:46:56 +01:00
Kyle Evans
0e73b834f3 tests: readlink: fix atf_test_case call [NFC]
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.

Sponsored by:	Klara, Inc.
2022-03-03 21:51:40 -06:00
Mateusz Piotrowski
8b73b57c1b manpages: Fix use of At macro
The versions for the At macro from 1 to 7 must be prefixed with "v".

MFC after:	3 days
2022-03-04 00:03:44 +01:00
Mateusz Guzik
f3f3e3c44d fd: add close_range(..., CLOSE_RANGE_CLOEXEC)
For compatibility with Linux.

MFC after:	3 days
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D34424
2022-03-03 17:21:58 +00:00
Li-Wen Hsu
adce4585ca
Revert "Temporarily skip usr.bin.diff.diff_test.functionname in CI"
This reverts commit 85eeb6ea62.

The issue has been fixed by 4be7d087c2.

PR:		262086
2022-03-02 05:37:25 +08:00
Mateusz Guzik
6882d53b7f zstd: build with C11
This enables thread-aware timers which in turn fixes benchmark result
reports.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D34238
2022-03-01 20:07:44 +00:00
Tom Jones
4be7d087c2 diff: Use start of change when searching for function
Use the start of change when searching for a function rather than the
start of the context. In short functions if this could result in search
for the function name starting from before the function definition.

PR:		262086
Reviewed by:	bapt, mckusick, mhorne
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D34328
2022-03-01 13:27:21 +00:00
Jessica Clarke
89f5bc467c dtc: Sync with upstream version e9a77451cdd8
1c231509cf88 ("Validate integers fit in cells") is the only change
missing from our copy.

Reviewed by:	manu, imp
Differential Revision:	https://reviews.freebsd.org/D34368
2022-02-28 22:37:47 +00:00
Jessica Clarke
b58ea3e1f7 Fix hand-rolled METALOG entries for installconfig during distributeworld
During distributeworld we call distribute on subdirectories, which in
turn calls installconfig. However, this recursive installconfig call
appends the distribution name (in these cases, "base") to DESTDIR. For
install(1) this works fine as its -D argument comes from the top-level
Makefile.inc1, which passes the original DESTDIR, thereby resulting in
the METALOG entry having the distribution name as a prefix representing
its true installed path relative to the root, but for the hand-rolled
entries they do not use install(1) and thus do not have access to what
the original DESTDIR was, resulting in the METALOG missing this prefix.

Thus, pass down the name of the distribution via a new variable DISTBASE
(chosen as Makefile.inc1 already uses that to convey this exact same
information to etc's distrib-dirs during distributeworld) and prepend
this to the handful of manually-generated METALOG entries. For the
installworld case this variable will be empty and so this behaves as
before.

Note that we need to be careful to avoid double slashes in the METALOG;
distributeworld uses find | awk to split the single METALOG up into
multiple dist.meta files, and this relies on the paths in the METALOG
having the exact prefix ./dist (or ./dist/usr/lib/debug).

Reviewed by:	brooks, emaste
Differential Revision:	https://reviews.freebsd.org/D33997
2022-02-28 22:36:39 +00:00
Warner Losh
22054f8891 Report I/O stats from the CAM_IOSCHED_DYNAMIC extension
Report, on a periodic basis, the I/O latencies the CAM I/O scheduler
computes. These times are only for the hardware portion of the I/O as
measured from the time the operation is scheduled with the SIM using
xpt_action() until the SIM reports it has completed with xpt_dine(). Any
time the I/O operation spends in a software queue is no included.

The P50 (median), P90, P99 and P99.9 statistics about the latency of
each of the read, write and trim operations that completed during the
polling interval are reported. If there are fewer than 2, 10, 100 or
1000 operations during the polling interval, no statistic is reported
and a single dash '-' is displayed.

The read, write and trim commands (either on the command line or at run
time) toggle display of these operations. The color command toggles
color (it defaults to on, like gstat). When color is enabled, unknown
statistics are reported in blue, high latency for a statistics is
reported in red, medium in magenta and low in green (as with gstat). The
med= and hi= commands can set these latency thresholds.

Limitations: The entire sysctl space for all the devices is walked for
each polling period. This should be optimized to remember the OIDs and
only do such polling with the xpt generation changes. There is also no
way to filter devices displayed. This command only works on physical
devies that are connected to SCSI, ATA or NVME sims as those are the
only ones that are instrumented in the CAM I/O scheduler (the
CAM_IOSCHED_DYNAMIC option must be in the kernel, and the dynamic
scheduler can't be disabled).

MFC After:		1 month
Relnotes:		yes
Sponsored by:		Netflix
Reviewed by:		pauamma_gundo.com, chs
Differential Revision:	https://reviews.freebsd.org/D34259
2022-02-28 10:44:47 -07:00
Jamie Gritton
be7cf3f4b8 posixshm: Add a -j option to posixshmcontrol ls, to specify a jail
PR:		257556
Reported by:	grembo@
2022-02-26 17:45:28 -08:00
Eric van Gyzen
58135fbd8b gzip: fix error handling in unxz
The result of fstat() was not checked.  Furthermore, there was a
redundant check of st.st_size.  Fix both.

Reported by:    Coverity
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2022-02-25 09:30:29 -06:00
Richard Scheffenegger
bd6bb49397 iscsi: per-session timeouts and rapid teardown of session on reconnect
Add per-Session configurable ping (SCSI NOP) and login timeouts.

Remove the torn down, old iSCSI session quickly, when performing a reconnect.

Reviewed By: trasz
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34198
2022-02-25 10:35:47 +01:00
Warner Losh
6979e8cb6e dtc: more mandoc -T lint fixes
Obtained from:		dtc repo 04c805a8b08e4a1d4ff1f1e62ef475fbfe1a5fbe
Sponsored by:		Netflix
2022-02-24 13:54:13 -07:00
Jose Luis Duran
62d16ad37d dtc.1: Mention the existence of -i flag
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/570
2022-02-23 09:25:30 -07:00
Jose Luis Duran
7ae5d1f00f dtc.1: Appease mandoc -T lint
Prefer .Fx to bare FreeBSD

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/579
2022-02-23 09:25:19 -07:00
Li-Wen Hsu
85eeb6ea62
Temporarily skip usr.bin.diff.diff_test.functionname in CI
PR:		262086
Sponsored by:	The FreeBSD Foundation
2022-02-21 16:31:43 +08:00
Stefan Eßer
32066c96fa fetch: make -S argument accept values > 2GB
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.

Reported by:	antoine
MFC after:	3 days
2022-02-20 15:24:43 +01:00
наб
7e05fa3b44 uname: -v: strip final whitespace compatibly with uname(3)
This restores POSIX.1 conformance

PR: 260938
2022-02-18 16:30:10 +00:00
Tom Jones
3931c072c6 diff: fix failed compare when ignoring file case
With --ignore-file-name-case we need to compare files regardless of
case. We need to propigate both names down to diffit so we can look up
the correct file when the names differ based on case, otherwise we try
to look up the file using the case from the a tree which might not be
discoverable if its case is different in the b tree.

Reviewed by:	bapt
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D34201
2022-02-18 15:51:38 +00:00
Tom Jones
cffebd1e8f Remove surplus check for which diff is being tested
Must have left this when I was testing the test invocation for
8f79bd9b85

Pointy hat:	thj
Sponsored by:	Klara Inc.
2022-02-18 15:47:46 +00:00
Tom Jones
f4be3645a1 diff: add --no-dereference flag
When diffing files and directories, don't follow symbolic links, instead
compare where the links point to.

Reviewed by:	bapt
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D34203
2022-02-18 15:17:13 +00:00
Tom Jones
8f79bd9b85 diff: Detect Objective-C methods
When searching back for function definitions, consider lines starting
with '+' and '-', this allows us to pick up Objective-C methods as well
as C style function definitions.

Reviewed by:	bapt
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D34202
2022-02-18 15:09:57 +00:00
Ed Maste
4e1e3ff571 vtfontcvt: update FreeBSD Foundation copyrights
Remove "All Rights Reserved"
2022-02-17 20:05:14 -05:00
Eric van Gyzen
86e5e10daf elfdump: handle small files more gracefully
elfdump -E on an empty file would complain "Invalid argument" because
it tried to mmap zero bytes.  With the -E flag, elfdump should
simply exit non-zero.  For tiny files, the code would reference off
the end of the mapped region.

Ensure the file is large enough to contain an ELF header before mapping it.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2022-02-17 10:09:53 -06:00
Eric van Gyzen
1581ec9a45 Integrate contrib/file/tests with kyua/atf
This could be done better by making each test a separate ATF test case.
This exercise is left for the reader.

Reviewed by:	delphij (earlier version)
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34303
2022-02-16 13:02:45 -06:00
Ed Maste
828e50092a elfctl: whitespace cleanup
Reported by:	jrm (in review D34283)
2022-02-15 08:46:14 -05:00
Ed Maste
82b611ed18 elfctl: fix operations with multiple features on multiple files
Previously an invocation like

  elfctl -e +feature1,feature2 file1 file2

would set both feature flags in file 1 but only feature1 in file2 (due
to the string being modified by strsep()).

Reported by:	jrm
Tested by:	jrm
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34283
2022-02-15 08:42:17 -05:00
Ed Maste
b8185579f4 elfctl: fix -e invalid operation error handling
Validate the operation prior to parsing the feature string, so that e.g.
-e 0x1 reports invalid operation '0' rather than invalid feature 'x11'.
Also make it an error rather than a warning, so that it is not repeated
if multiple files are specified.

(Previously an invalid operation resulted in a segfault.)

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-02-14 22:35:03 -05:00
Ed Maste
f0cf9b602d elfctl: error if -e is specified multiple times
Reported by:	jrm
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-02-14 22:08:47 -05:00
Wolfram Schneider
047eec4966 improve c style
- BSD KNF: return is a native statement and we use
  a space before the parenthesis
- remove superfluous empty lines

Reported by:    jrtc27
2022-02-14 19:30:09 +00:00
Wolfram Schneider
a9a43945d3 grammar
Reported by:	jrtc27
2022-02-14 18:16:43 +00:00
Wolfram Schneider
93885bb041 Better help message if locate database does not exists
PR:		211501
Reported by:	Oliver Peter
Reviewed by:	Pau Amma
Differential Revision:	https://reviews.freebsd.org/D34243
2022-02-13 17:00:22 +00:00
Wolfram Schneider
98839c40c7 better unique file names
Our mktemp(1) implementation uses 8-X for a temp file by default.
That's ok, but we should increase the value from 8 to 10 as
many other OS already did.

PR:		261438
2022-02-12 11:35:51 +00:00
Kyle Evans
4bcc7a5f6b lsvfs: one last style nit missed in 946585179d
Space after `for`.

Sponsored by:	Klara, Inc.
2022-02-10 16:14:17 -06:00
Kyle Evans
946585179d lsvfs: restyle, no functional change
Namely:
- main was using two-space indentation
- re-sort local variables
- explicit braces for loop scope
- make flag bit comparison explicit

The first line of this commit message is unfortunately a lie, as it
introduces a minor functional change on non-FreeBSD systems.  Namely,
the first branch is now explicitly compared against `0` and the choice
was made to compare it as greater than 0 to avoid issues on other
systems where `argc != 0` on entry isn't guaranteed (negative when
checked there).

Sponsored by:	Klara, Inc.
2022-02-10 11:34:52 -06:00
Richard Scheffenegger
3f169c54ab tcp: Add/update AccECN related statistics and numbers
Reserve couters in the tcps struct in preparation
for AccECN, extend the debugging output for TF2
flags, optimize the syncache flags from individual
bits to a codepoint for the specifc ECN handshake.

This is in preparation of AccECN.

No functional chance except for extended debug
output capabilities.

Reviewed By: #transport, rrs
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34161
2022-02-10 00:21:31 +01:00
Martin Matuska
833a452e9f libarchive: import changes from upstream
Libarchive 3.6.0

New features:
PR #1614: tar: new option "--no-read-sparse"
PR #1503: RAR reader: filter support
PR #1585: RAR5 reader: self-extracting archive support

New features (not used in FreeBSD base):
PR #1567: tar: threads support for zstd (#1567)
PR #1518: ZIP reader: zstd decompression support

Security Fixes:
PR #1491, #1492, #1493, CVE-2021-36976:
   fix invalid memory access and out of bounds read in RAR5 reader
PR #1566, #1618, CVE-2021-31566:
   extended fix for following symlinks when processing the fixup list

Other notable bugfixes and improvements:
PR #1620: tar: respect "--ignore-zeros" in c, r and u modes
PR #1625: reduced size of application binaries

MFC after:	2 weeks
Relnotes:	yes
2022-02-10 00:35:42 +01:00
Simon J. Gerraty
a6f0e10b24 Merge bmake-20220208
* unit-tests/Makefile: disable opt-debug-x-trace on Linux if there
        is any chance we have dash as .SHELL

        * meta.c: use a variable to hold command line to be filtered
        to avoid any side effects from content of command line.

Merge commit '535c59a6a9214436f5d6643775d29808e4b3408d'
2022-02-09 09:31:30 -08:00
Warner Losh
5e8e302087 systat: Eliminate write-only unit variable
Sponsored by:		Netflix
2022-02-07 14:51:45 -07:00
Warner Losh
d167318506 systat/iostat: Use bools for numbers and kbpt
These are really bools, declare them as such.

Sponsored by:		Netflix
2022-02-07 14:51:45 -07:00
Gordon Bergling
ecc467ebad ipsec(4): Fix a few typos in error messages
- s/receieve/receive/

MFC after:	1 week
2022-02-06 13:43:42 +01:00
Simon J. Gerraty
6598559fdf Update to bmake-20220204 2022-02-05 12:29:10 -08:00
Wolfram Schneider
610b97ebaa update external URL 2022-02-05 09:13:07 +00:00
Wolfram Schneider
153dd4ba03 fix URL typo 2022-02-05 09:08:45 +00:00
Wolfram Schneider
1c7a40d268 update external URL 2022-02-05 09:00:35 +00:00
Wolfram Schneider
c126924c8c update external URL 2022-02-05 08:58:30 +00:00
Wolfram Schneider
a6c20ddd4a switch from short to int for lookup table
This simplifies the code, less casting is needed.
2022-02-05 08:44:35 +00:00
Ed Maste
dbc7364b18 elfctl: update man page example for 'no' prefix
Reported by:	Mark Millard on freebsd-current@
Fixes:		c763f99d11 ("elfctl: prefix disable flags with "no"")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-02-04 21:05:10 -05:00
Stefan Eßer
c454c57163 whereis: fix fetching of user.cs_path sysctl variable
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.

MFC after:	3 days
2022-02-04 23:44:34 +01:00
Wolfram Schneider
d43255b50c remove dead code
A lookup array is faster than a function with linear search.
The old function was not used for years - spring cleaning.
2022-02-03 17:02:37 +00:00
Wolfram Schneider
39a30a8097 better printf(3) format usage
Reported by: jhb
2022-02-03 16:57:25 +00:00
Michael Tuexen
6ad26abca5 sockstat: fix usage string
MFC after:	1 week
Sponsored by:	Netflix, Inc.
2022-02-01 15:44:57 +01:00
Michael Tuexen
5f64777a4f sockstat: add -i to display inp_gencnt
The inp_gencnt will be used to identify a TCP endpoint by an upcoming
command line tool to set TCP socket options.

Reviewed by:		rscheff
MFC after: 		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D34137
2022-02-01 15:37:03 +01:00
Wolfram Schneider
792df7ced2 improve casting for pointer diffs 2022-02-01 17:26:20 +00:00
Wolfram Schneider
1536d37b20 fix casting issue in error message for 32bit CPUs (e.g. armv7) 2022-01-31 18:30:07 +00:00
Wolfram Schneider
d7e8005bfa cleanup documentation 2022-01-31 18:11:14 +00:00
Wolfram Schneider
00ad40d70a throw an error if reading from stdin failed 2022-01-31 18:04:45 +00:00
Wolfram Schneider
834a8fa169 enable to configure the locate path length at compile time
The length has not changed and is 1024 chars (equals PATH_MAX).

PR: 201243
Submitted by: Willem Jan Withagen <wjw@digiware.nl>
2022-01-31 17:32:46 +00:00
Wolfram Schneider
8d35ca86c5 Fix statistics for empty databases
An empty database is a database which does not contain any filenames.
It should not occur in practice but maybe in the case of an error.

echo | /usr/libexec/locate.mklocatedb > empty.db; locate -d empty.db -S
2022-01-31 17:03:08 +00:00
Wolfram Schneider
69ae5b9667 remove register
There are no measurable performance differences if registers are used or not.
2022-01-31 10:59:07 +00:00
Wolfram Schneider
33ee87fa0a improve error handling for corrupt database 2022-01-30 18:04:52 +00:00
Wolfram Schneider
5260fbcebd fix check for integer
For historical reasons, the integer is stored with an offset of plus 14.
That means, for a given max path length of 1024 the valid values
are -1009 .. 1037 and not -1023 .. 1023

PR: 201243
2022-01-30 16:27:27 +00:00
Wolfram Schneider
e7d6783f4a enable to set locate command 2022-01-30 16:24:49 +00:00
Wolfram Schneider
8e7c0a6d32 fix fgets error handling (from last commit) 2022-01-30 13:08:42 +00:00
Wolfram Schneider
72a0982cd5 improve error handling 2022-01-30 09:27:21 +00:00
Mateusz Piotrowski
1578c22e92 apply.1: Use Ar for arguments 2022-01-29 13:12:31 +01:00
Peter Jeremy
c9d1fa7003
systat: Display seconds in vmstat mode
Providing a timestamp with seconds granularity helps make it obvious
that the display is updating.

Reviewed by:    mckusick
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D29181
2022-01-29 20:41:19 +11:00
Wolfram Schneider
9146546eae locate statistics: show number of longest path in database 2022-01-29 07:13:28 +00:00
Wolfram Schneider
21cc4bee69 sync improvements from concatdb.sh
- stop on first error
- improve awk script: print the last two characters for bigram -  not the second word
- remove unnecessary checks
- use mktemp
- refactor
2022-01-29 07:12:09 +00:00
Mark Johnston
8d8b9b560a sort: Fix message catalogue usage
- Check that catopen() succeeded before calling catclose().  musl will
  crash in the latter if the catalogue descriptor is -1.
- Keep the message catalogue open for most of sort(1)'s actual
  operation.
- Don't use catgets(3) to print error messages if catopen(3) had failed.

Reviewed by:	arichardson, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34081
2022-01-28 16:52:29 -05:00
Mark Johnston
41e6398f9b ar: Avoid overwriting the stdout file stream pointer
This doesn't work with musl, which defines stdout as FILE * const.
Instead, explicitly pass the desired output stream to ar_read_archive().

No functional change intended.

Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34064
2022-01-27 17:10:17 -05:00
Tom Jones
4669f23ef7 Remove SMALL conditionals from gzip
gzip has SMALL conditionals which enable building a reduced size version
of the binary. These exist as part of the introduction of BSD licensed
gzip in 2004 in NetBSD and appear to have been required to reach a size
for inclusion in their install media. For more information see commits
to gzip in the NetBSD tree on the 28th of March 2004.

SMALL doesn't appear to be hooked up to our build system and
complicates gzip quite a bit.

Reviewed by:	kevans,	imp
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D34047
2022-01-27 17:27:21 +00:00
Tom Jones
21c966a6b9 Fix test output when gzip is run with -tlv
When run with test, verbose and list we need to parse the file otherwise
the test output is "NOT OK" even for the file is valid.

Reviewed by:	kevans, allanjude, imp
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D34046
2022-01-27 17:20:23 +00:00
Wolfram Schneider
5cf0049653 limit sort(1) memory usage to 20% of available main memory
By default BSD sort(1) uses 90% (or at least 50%?) of the available
main memory. That is good for performance for a single job, but not
for a shared OS. For a long running script the performance is less
important than the stability of the server.  Also, if a server
with 64GB RAM starts swapping, the performance goes south and
hurts other running applications.

Note: this change does not affect the weekly cron job to
rebuild the locate database. The FreeBSD locate.updatedb
use the -presort option (find -s)
2022-01-26 19:30:11 +00:00
Wolfram Schneider
0c178a2a64 support more than 2 billion file names for counting (-c) or limits (-l limit)
- this fix (harmless) integer overflows for very large partitions (>1PB)
- code cleanup
2022-01-26 16:15:23 +00:00
Wolfram Schneider
e48156828f switch to 64 bit integers for counting bigrams
This fixes an integer overflow for very large partitions around 35 billion
filenames (>2PB). However, in an artificially worst case it may occurs
by only 17 mio filenames on a partition.
2022-01-26 16:11:51 +00:00
Fernando Apesteguía
1594084f3f man(1): Add full search (-K) flag
This flag allows a full text search on man pages. Although this is a last resort
option, it can be useful to pin point a certain man page.

It can be used with -S to narrow the search.

Unlike the Linux version, the search takes place in the rendered text so it
avoids false-positives when the text is found in comments in the source files.

It relies on `grep(1)` and `mandoc(1)` to do its job.

Add flag documentation and EXAMPLES to the manual page (bump .Dd).

Usage example:

man -w -K '\<arm\>' -S 1:8

Reviewed By: ceri, emaste, pauamma_gundo.com
Approved by: manpages (bcr@), debdrup@
Differential Revision: https://reviews.freebsd.org/D30984
2022-01-26 12:24:20 +01:00
Wolfram Schneider
ccf50c1df9 locate statistics: non zero exit on corrupt database 2022-01-25 16:55:58 +00:00
Wolfram Schneider
b7a74bbc41 stop on error and display the statstics anyway
PR:		32686
2022-01-25 15:59:41 +00:00
Baptiste Daroussin
389844c058 locate: change from BSD-4-clause to BSD-3-clause
We have the authorization from the University of California to remove
the advertising clause for a while, wosch@ who also hold a copyright
on this code also approved the relicensing

Approved by:	wosch@
MFC after:	3 days
2022-01-25 09:20:17 +01:00
Eugene Grosbein
85f15576b4 fetch(1): more fixes for soft failure handling
Fix logic error introduced in my commit
bf599c03f0

Also, authorization errors should not be considered as soft failures.
2022-01-25 12:48:28 +07:00
Wolfram Schneider
829afcb5d3 refactor script
- simpler usage of mktemp(1)
- remove unnecessary checks
- documentation
2022-01-24 18:28:30 +00:00
Wolfram Schneider
0a88bd81b7 awk: print the last two characters for bigram - not the second word
A bigram may contain a space character, and we always need two characters.
2022-01-24 18:27:43 +00:00
Wolfram Schneider
41c539bdd1 stop on first error 2022-01-24 18:27:34 +00:00
Eugene Grosbein
08a2504a20 fetch(1): fix error in previous commit
strncmp() compares terminating zero and sizeof() includes it.
Un-obsfuscate the code and show what it is indended to do.
2022-01-24 15:07:18 +07:00
Eugene Grosbein
bf599c03f0 fetch(1): do not consider HTTP 5XX errors as soft failures
This change fixes "fetch -a" looping forever on "502 Bad gateway"
error and similar.

MFC after:	1 month
2022-01-24 14:38:26 +07:00
Eugene Grosbein
a4efbe0d6d fetch(1): correct progress accounting after previous commit
MFC after:	1 month
2022-01-24 11:17:24 +07:00
Eugene Grosbein
e3bad5f7aa fetch(1): process truncated transfer as soft failure
Let "fetch -a" resume truncated transfer automatically
perform another attempt if it obtained some new data in previous one
making progress.

This makes it more robust against frequent but transient network failures.
For example:

=> sqlite-src-3370200.zip doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch https://www.sqlite.org/2022/sqlite-src-3370200.zip
sqlite-src-3370200.zip                          3% of   12 MB   45 kBps 04m24s
fetch: sqlite-src-3370200.zip appears to be truncated: 524288/13145234 bytes
sqlite-src-3370200.zip                         10% of   12 MB   67 kBps 02m56s
fetch: sqlite-src-3370200.zip appears to be truncated: 1327104/13145234 bytes
sqlite-src-3370200.zip                         28% of   12 MB  123 kBps 01m14s
fetch: sqlite-src-3370200.zip appears to be truncated: 3735552/13145234 bytes
sqlite-src-3370200.zip                         54% of   12 MB  253 kBps    24s
fetch: sqlite-src-3370200.zip appears to be truncated: 7176192/13145234 bytes
sqlite-src-3370200.zip                         62% of   12 MB   90 kBps    55s
fetch: sqlite-src-3370200.zip appears to be truncated: 8241152/13145234 bytes
sqlite-src-3370200.zip                         82% of   12 MB  113 kBps    20s
fetch: sqlite-src-3370200.zip appears to be truncated: 10862592/13145234 bytes
sqlite-src-3370200.zip                                  12 MB  185 kBps    12s
===> Fetching all distfiles required by sqlite3-3.37.2,1 for building

MFC after:	1 month
2022-01-24 11:09:37 +07:00
Ed Maste
6f6fbfa3a8 Remove quotes around Makefile .error/.warn/.info strings
The text after .error et al is emitted verbatim.

Reviewed by:	sjg
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33904
2022-01-22 14:03:07 -05:00
Wolfram Schneider
e0282802a6 remove debug code for cpu usage
I guess nobody used this in the last decade, and you can get
similar results with the time(1) command.
2022-01-20 06:43:54 +00:00
Wolfram Schneider
cfa3856452 Use 64-bit integers for database statistics
This fix (harmless) integer overflows for larger partitions (>2TB)

PR: 223023
2022-01-20 06:27:08 +00:00
Wolfram Schneider
a97ce14abc correct type of mmap len parameter
Using locate -m on a database > 2GB should work now.

PR: 261277
2022-01-19 19:32:16 +00:00
Cy Schubert
64e33c5cb1 Revert "wpa: Import wpa 2.10."
This reverts commit 5eb81a4b40, reversing
changes made to c6806434e7 and
this reverts commit 679ff61123.

What happend is git rebase --rebase-merges doesn't do what is expected.
2022-01-18 08:10:33 -08:00
Cy Schubert
5eb81a4b40 wpa: Import wpa 2.10.
The long awaited hostapd 2.10 is finally here.

MFC after:	3 weeks
2022-01-18 07:45:39 -08:00
Mark Johnston
758d98debe exec: Remove the stack gap implementation
ASLR stack randomization will reappear in a forthcoming commit.  Rather
than inserting a random gap into the stack mapping, the entire stack
mapping itself will be randomized in the same way that other mappings
are when ASLR is enabled.

No functional change intended, as the stack gap implementation is
currently disabled by default.

Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33704
2022-01-17 16:11:54 -05:00
Jessica Clarke
340cebe990 etdump: Fix the file name included in the could not open error message
If only one file is passed, this reads the terminating NULL and so
prints (null). If multiple files are passed then this always prints the
second file, which may or may not exist (and will be particularly
confusing if it does exist since the output will include the dump of the
second file).

MFC after:	1 week
2022-01-16 06:55:39 +00:00
Brooks Davis
0910a41ef3 Revert "syscallarg_t: Add a type for system call arguments"
Missed issues in truss on at least armv7 and powerpcspe need to be
resolved before recommit.

This reverts commit 3889fb8af0.
This reverts commit 1544e0f5d1.
2022-01-12 23:29:20 +00:00
Brooks Davis
1544e0f5d1 syscallarg_t: Add a type for system call arguments
This more clearly differentiates system call arguments from integer
registers and return values. On current architectures it has no effect,
but on architectures where pointers are not integers (CHERI) and may
not even share registers (CHERI-MIPS) it is necessiary to differentiate
between system call arguments (syscallarg_t) and integer register values
(register_t).

Obtained from:	CheriBSD

Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D33780
2022-01-12 22:51:25 +00:00
Konstantin Belousov
12f747e6ff truss(1): detach more carefully
When detaching, truss(1) sends SIGSTOP to the traced process to ensure
that it is detaching in the steady state.  But it is possible, for
multithreaded process, that wait() call returns event other than our
SIGSTOP notification.  As result, SIGSTOP might sit in some thread'
sigqueue, which makes SIGCONT a nop.  Then, the process is stopped when
the queued SIGSTOP is acted upon.

To handle this, loop until we drain everything before SIGSTOP,
and see that the process is stopped.

Note that the earlier fix makes it safe to have some more debugging
events longering after SIGSTOP is acted upon.  They will be ignored
after PT_DETACH.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33861
2022-01-12 20:04:41 +02:00
Konstantin Belousov
ba33c28848 truss: remove write-only variable
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33861
2022-01-12 20:04:41 +02:00
Konstantin Belousov
c0ba4c2ee2 script(1): work around slow reading child
If child is slow reading from its input, or even completely stops doing
the read, script(1) hangs in write(2) to the pts master waiting until
there is a space in the terminal discipline buffer.  This also stops
handling any outer io, as well as child output.

Work around the problem by making pts master fd non-blocking, and be
prepared for short writes to it.  The data to be written to master is
buffered in the tailq which is processed when select(2) detects that
master is ready for write.

PR:	260938
Reported by:	наб <nabijaczleweli@nabijaczleweli.xyz>
See also:	https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003095
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33789
2022-01-10 17:34:51 +02:00
Ed Maste
1a0a41b105 ar: accept but ignore 'T' option
In previous versions of BSD ar -T was an alias for -f -- use only the
first 15 characters of archive member names.  In GNU ar and LLVM ar -T
creates a thin archive.

The -f / old BSD ar -T functionality is not particularly useful, and
ignoring -T still results in a usable and compatible (but not thin)
archive.

An exp-run found a few ports invoking ar -T but they all expect thin
archives.  In addition, -T will be used to specify thin archives after
a migration to LLVM-ar.

PR:             260523 [exp-run]
Reviewed by:	markj
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D33553
2022-01-03 11:42:59 -05:00
Robert Watson
7776d3ccd1 Add a -q flag to ministat to suppress headers in output, for use with -n.
Reviewed by:	jrtc27
Differential Revision: https://reviews.freebsd.org/D33724
MFC after:	2 weeks
2021-12-18 22:53:03 +00:00
Kirk McKusick
a115a4aa51 systat -vm: Humanize output for ease of reading.
Using 8 width is too wide for large numbers like 1379991K;
1330M is easier to read.

Submitted by: ota_j.email.ne.jp
Reviewed by:  mckusick
MFC after:    2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D33495
2022-01-01 19:48:06 -08:00
Gleb Smirnoff
dcb724b5a7 ktrdump: properly parse %% in the format string
Discovered by:	27ca37acb7
2021-12-29 23:08:15 -08:00
Ed Maste
edadbb4606 ar: deprecate -T option
Other ar implementations (GNU, LLVM) use -T to mean thin archive
rather than use only the first fifteen characters of the archive member
name.  We support both -T and -f for this, with -f documented as an
alias of -T.

An exp-run showed that the ports invoking `ar -T` expect thin archives,
not truncated names.  Switch -f to be the documented flag for this
behaviour, and emit a warning when -T is used.

The warning will be changed to an error in the future (in main), once
ports no longer use -T.

PR:		260523 [exp-run]
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-12-29 15:14:06 -05:00
Alexander V. Chernikov
731bfa9f18 netstat: fix nhop prepend printing.
If present, print nexthop L2 prepend data in hex.

MFC after:	1 week
2021-12-26 15:05:10 +00:00
Baptiste Daroussin
d93b4d3203 bsddialog: import version 0.0.2 2021-12-21 16:13:00 +01:00
Emmanuel Vadot
13ef8134ef pkgbase: Create a FreeBSD-fetch package
It's useful for small image to fetch some data but we don't want to
install utilities nor bloat runtime.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33463
2021-12-21 10:17:46 +01:00
Emmanuel Vadot
93c4369096 pkgbase: Put more binaries/lib in runtime
Move some needed binaries/libs from FreeBSD-utilities to FreeBSD_runtime.
This is everything needed to boot to multiuser with FreeBSD-rc installed.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33435
2021-12-21 10:17:27 +01:00
Emmanuel Vadot
5abb10faa1 pkgbase: Put yellow pages programs to its own package
YP is less and less used, split them to users have the choice to not
install them.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33441
2021-12-21 10:17:22 +01:00
Ed Maste
3e01ee76f2 lorder: add note that it is no longer required
Use of lorder(1) is not required by contemporary linkers.

The GNU coreutils manual[1] has a good description of the use of lorder
and tsort:

    This whole procedure has been obsolete since about 1980, because
    Unix archives now contain a symbol table (traditionally built by
    ranlib, now generally built by ar itself), and the Unix linker uses
    the symbol table to effectively make multiple passes over an archive
    file.

See 0e1e341b48 for some more details.

[1] https://www.gnu.org/software/coreutils/manual/html_node/tsort-background.html

PR:		259254 [exp-run]
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2021-12-20 12:59:01 -05:00
Gleb Smirnoff
71d2d5adfe tcptw: count how many times a tcptw was actually useful
This will allow a sysadmin to lower net.inet.tcp.msl and
see how long tcptw are actually useful.
2021-12-19 08:22:12 -08:00
Simon J. Gerraty
1c04cf7d54 After-import bmake-20211212 2021-12-18 10:14:39 -08:00
Konstantin Belousov
01c77a436e Pass vdso address to userspace
Reviewed by:	emaste
Discussed with:	jrtc27
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D32960
2021-12-06 20:46:49 +02:00
Stefan Eßer
5e04571cf3 sys/bitset.h: reduce visibility of BIT_* macros
Add two underscore characters "__" to names of BIT_* and BITSET_*
macros to move them to the implementation name space and to prevent
a name space pollution due to BIT_* macros in 3rd party programs with
conflicting parameter signatures.

These prefixed macro names are used in kernel header files to define
macros in e.g. sched.h, sys/cpuset.h and sys/domainset.h.

If C programs are built with either -D_KERNEL (automatically passed
when building a kernel or kernel modules) or -D_WANT_FREENBSD_BITSET
(or this macros is defined in the source code before including the
bitset macros), then all macros are made visible with their previous
names, too. E.g., both __BIT_SET() and BIT_SET() are visible with
either of _KERNEL or _WANT_FREEBSD_BITSET defined.

The main reason for this change is that some 3rd party sources
including sched.h have been found to contain conflicting BIT_*
macros.

As a work-around, parts of shed.h have been made conditional and
depend on _WITH_CPU_SET_T being set when sched.h is included.
Ports that expect the full functionality provided by sched.h need
to be built with -D_WITH_CPU_SET_T. But this leads to conflicts if
BIT_* macros are defined in that program, too.

This patch set makes all of sched.h visible again without this
parameter being passed and without any name space pollution due
to BIT_* macros becoming visible when sched.h is included.

This patch set will be backported to the STABLE branches, but ports
will need to use -D_WITH_CPU_SET_T as long as there are supported
releases that do not contain these patches.

Reviewed by:	kib, markj
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D33235
2021-12-05 23:00:25 +01:00
Gordon Bergling
c8ca80e223 elf(3): Fix a typo in a sysctl description
- s/segement/segment/

MFC after:	3 days
2021-11-30 10:38:34 +01:00
Danilo G. Baio
ec80eab8a1 motd: Fix Questions List address
Following mailing lists migration from Mailman to Mlmmj.

https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
-->
https://lists.freebsd.org/subscription/freebsd-questions

Adding a short link (as we already have for Faq and Handbook), so all
links can be indented the same way.

Reviewed by:	imp (earlier version)
Approved by:	lwhsu
Differential Revision: https://reviews.freebsd.org/D33101
2021-11-28 18:15:04 -03:00
Baptiste Daroussin
848ee2a3a8 bsddialog: actually add directories 2021-11-24 12:13:45 +01:00
Ed Maste
036af1053a mkimg: zero entry in vhdx_write_metadata
Otherwise _reserved might contain uninitialized data.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-11-20 19:37:25 -05:00
Mateusz Piotrowski
01e3140571 top.1: Use the Dq macros instead of \*lq and \*rq
MFC after:	3 days
2021-11-18 15:56:49 +01:00
Mateusz Piotrowski
c947fc5fae top.1: Improve description of -m
Describe -m argument as "mode" instead of "display".

MFC after:	3 days
2021-11-18 15:56:48 +01:00
Mateusz Piotrowski
82d0f865ee top: Sort flags in usage message
While here, fix the indentation of the second line in the message.

MFC after:	3 days
2021-11-18 15:56:47 +01:00
Mateusz Piotrowski
1125390415 top.1: Sort options alphabetically
While here, add a short sentence introducing the options.

MFC after:	3 days
2021-11-18 15:56:47 +01:00
Mateusz Piotrowski
b8135ed67c top.1: Fix a typo in description of H interactive command
B is listed as an interactive command to toggle the display of threads.
This is a typo introduced during the conversion of the manual page to
mdoc.

Fixes:		9d6cce02a7
MFC after:	3 days
2021-11-18 15:56:46 +01:00
Warner Losh
d677d4be0c Skip -flto for all MIPS ports
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
2021-11-16 16:23:02 -07:00
Konstantin Belousov
7d20a08076 ldd: also use exec mode for -a
The -a option also requires passing specific environment variables to
instance of rtld doing tracing.

PR:	259069
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-15 22:49:33 +02:00
Brooks Davis
8e4a3add99 struct kevent_freebsd11 -> struct freebsd11_kevent
Rename to match the naming of syscalls and allow 32 to be appended
without making an ugly name like kevent_freebsd1132.

While here, make the kevent changelist argument const.

Reviewed by:	kib
2021-11-15 18:34:27 +00:00
Baptiste Daroussin
6d38604fc5 mandoc: import version 1.14.6
MFC after: 3 weeks
2021-11-15 16:58:58 +01:00
Konstantin Belousov
0864ab3d32 procstat auxv: print out FXRNG
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-15 02:32:00 +02:00
Rick Macklem
75c666197c nfsstat: Add output for counts of new RPCs to the "-E" option
Add output to the "-E" option for new RPCs related
to NFSv4.1/4.2. Also, add output of the counts for
allocated layouts and the title for the "Client"
section (which was lost during a previous commit).

MFC after:	2 weeks
2021-11-14 13:36:14 -08:00
Dimitry Andric
28a41182c0 Merge llvm-project 13.0.0 release
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13.0.0-0-gd7b669b3a303, aka 13.0.0 release.

PR:		258209
MFC after:	2 weeks
2021-11-13 21:49:29 +01:00
Dimitry Andric
fe6060f10f Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR:		258209
MFC after:	2 weeks
2021-11-13 21:39:49 +01:00
Felix Johnson
5504d83942 sockstat(1): Update Synopsis section
Update sockstat(1) manpage so the Synopsis section includes q (silent
mode) and the -j argument name is consistent.

PR:		256795
MFC after:	3 days
Reported by:	Nick Reilly <nreilly@blackberry.com>
2021-11-10 15:22:06 -05:00
Kyle Evans
4c14980baa grep: fix/remove references to -P
-P in gnugrepland means PCRE, which we do not support.  We may eventually
support it if onigmo ends up getting imported as a more performant regex
implementation, and we can re-add it properly in these places (and more)
when that time comes.

The optstr change is a functional nop; the case was not explicitly handled,
thus ending in usage() anyways.

Reported by:	Vladimir Misev (via twitter)
2021-11-10 00:42:42 -06:00
Mike Karels
a2e7dfca86 systat: clean up code assuming network classes
Similar to netstat, clean up code that uses inet_lnaof() to check for
binding to "host 0" (lowest host on network) as a "network" bind.
Such things don't happen, and current networks are seldom if ever
found in /etc/networks.

MFC after:	1 month
Reviewers:	tuexen
Differential Revision: https://reviews.freebsd.org/D32720
2021-11-09 09:35:16 -06:00
Mike Karels
64acb29b7d sockstat: change check for wildcard sockets to avoid historical classes
sockstat was checking whether a bound address was "host 0", the lowest
host on a network, using inet_lnaof().  This only works for class A/B/C.
However, it isn't useful to bind such an address unless it is really
the unspecified address INADDR_ANY.  Change the check to to use that.

MFC after:	1 month
Reviewd by:	tuexen
Differential Revision: https://reviews.freebsd.org/D32715
2021-11-09 09:34:44 -06:00
Mike Karels
bd27c71c45 netstat: reduce use of historical Internet classes
When attempting to characterize bound addresses, netstat was checking
for host 0 on a (historical) net using inet_lnaof().  Such addresses
are not normally bound, as they would not work, with the exception
of the unspecified address, INADDR_ANY.  Check for that explicitly.
Similarly, don't check bound addresses for a match to a network name.

MFC after:	1 month
Reviewed by:	tuexen
Differential Revision: https://reviews.freebsd.org/D32714
2021-11-09 09:34:22 -06:00
Dries Michiels
ecf58c066c Complete steps 5 and 9 for new committers (driesm)
Reviewed by: 0mp (mentor)
Approved by: 0mp (mentor)
Differential Revision: https://reviews.freebsd.org/D32890
2021-11-08 17:19:57 +01:00
Felix Johnson
52dbe1a0f4 find(1): Update date format reference and remove cvs(1) references
cvs(1) is not installed by default. Change the date format reference to
note that find(1) understands ISO8601 and RFC822 date formats. Also
remove references to cvs(1).

PR:		254894
MFC after:	3 days
Reported by:	danielsh@apache.org
2021-11-08 01:14:58 -05:00
Warner Losh
517e52b6c2 awk: Move to using two sets of tests
Upstream one-true-awk has two sets of tests. These are in addition to
NetBSD's tests we're using. The 'bugs-fixed' tests from upstream are
ready to use as-is (more or less). However, the 'tests' from upstream
are not, so for now we'll just use the netbsd and bugs-fixed tests.
They provide an OK workout and are better than nothing, though the tests
themselves are for specific esoteric things.

The upstream bugs-fixed tests are *ALMOST* a drop in. However, 3 test
for errors and the upstream test jig mashes stdout and stderr together,
which atf doesn't do, so make a tiny tweak to the upstream tests that I
hope to upstream. Plus upstream has ../a.out: instead of awk: in the
output. Not sure how to deal with this yet, so I've not proposed
anything upstream and have changed the test locally.

In addition, the system-status.awk test is not suitable to run in ATF.
It wants to force sh to dump core, but kyua doesn't seem to allow that
sometimes so the test will fail or pass based on whether or not a core
dump can be created. Since it's unstable, remove it.

This required moving the netbsd tests to a new direcotry, so update
mtree files as well. The change is useless for 'make check' without it.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31376
2021-11-05 08:53:36 -06:00
Hans Petter Selasky
8abfbe5a79 beep(1): Initial version of utility to create terminal beep via soundcard.
Reviewed by:	imp@, emaste@ and pstef@
Differential Revision:	https://reviews.freebsd.org/D32672
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2021-11-04 09:00:46 +01:00
Mateusz Piotrowski
3693250e8a dpv.1: Do not use mdoc macros for Bl width
Macros do not expand there.

MFC after:	3 days
2021-11-02 08:30:11 +01:00
Mateusz Piotrowski
f7c7a6ac00 dpv.1: Fix an example
dpv(1) requires a label to be specified.

MFC after:	3 days
2021-11-02 08:30:11 +01:00
Mateusz Piotrowski
a85aa7f9d3 dpv: Fix synopsis formatting & sort options
MFC after:	3 days
2021-11-02 08:30:11 +01:00
Mateusz Guzik
932c2667d9 systat: fix stack overflow when running -iostat
The new buffer is arbitrarily sized to likely "big enough".

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-01 23:57:27 +00:00
Mateusz Guzik
6d88f9fed6 systat: mostly clean up warns
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-01 23:11:16 +00:00
Andriy Gapon
e18fbe6f19 fuser: restore functionality by fixing fsid type
Use types from sys/stat.h for the filesystem and inode numbers for extra
safety.

PR:		259504
Reported by:	Markus Wild <freebsd-bugs@virtualtec.ch>
MFC after:	1 week
2021-11-01 08:45:26 +02:00
Stefan Eßer
20f8331aca usr.bin/stat: honour locale for "-t %+"
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.

Reported by:	Jamie Landeg-Jones <jamie@catflap.org>
MFC after:	3 days
2021-10-30 09:00:34 +02:00
Mark Johnston
e9bfb50d5e sort: Fix random sort
bwsrawdata() is supposed to return the string buffer.

PR:		259451
Reported by:	sigsys@gmail.com
Fixes:		d053fb22f6 ("usr.bin/sort: Avoid UBSan errors")
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2021-10-29 14:29:50 -04:00
Baptiste Daroussin
1a4d5f13ba ident: replace sbuf(9) with open_memstream(3)
This change makes ident only dependant on libc functions

This makes our ident(1) more portable, also the fact that we only
depend on libc which is maintained with excellent backward compatibility
means that if one day ident is removed from base, someone using FreeBSD
22 will be able to fetch ident from FreeBSD 14 to run ident against
FreeBSD 1.0 binary

MFC After:	1 week
2021-10-28 15:51:23 +02:00
Ed Maste
48cb3fee25 Retire obsolete iscsi_initiator(4)
The new iSCSI initiator iscsi(4) was introduced with FreeBSD 10.0, and
the old intiator was marked obsolete shortly thereafter (in commit
d32789d95c, MFC'd to stable/10 in ba54910169).  Remove it now.

Reviewed by:	jhb, mav
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32673
2021-10-26 16:17:35 -04:00
Konstantin Belousov
57e5da2c98 Augment systat(1) -swap to display large swap space processes
This change updates the systat(1) -swap display to use libprocstat to
obtain and display per-process swap space usage infomation following its
existing swap devise/file statistics. It also incorporates the disk I/O
information from the -vmstat display.

The new screen looks like below with 'systat -swap':
                    /0   /1   /2   /3   /4   /5   /6   /7   /8   /9 /10
     Load Average   |

Device/Path       Size  Used |0%  /10  /20  /30  /40  / 60\  70\  80\ 90\ 100|
ada0s1b          2048M 2034M
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
zvol/sys/tempora 1024M 1015M
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
zvol/sys/swap    1024M 1014M
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Total            4096M 4063M
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Pid    Username   Command     Swap/Total Per-Process    Per-System
 24153 hiro       seamonkey   98M /   1G  7%              2%
 23677 hiro       xfce4-pane  28M /  81M 34% XXX          0%
 23629 hiro       xfce4-sess  25M / 118M 21% XX           0%
 23681 hiro       xfdesktop   20M /  58M 34% XXX          0%
 23678 hiro       thunar      15M /  43M 36% XXX          0%
 23658 hiro       at-spi-bus  14M /  23M 63% XXXXXX       0%
 23660 hiro       gvfsd       12M /  21M 56% XXXXX        0%

Disks  ada0  ada1  ada2   cd0 pass0 pass1 pass2 pass3
KB/t   8.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
tps       0     0     0     0     1     0     0     0
MB/s   0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
%busy     0     0     0     0     0     0     0     0

Submitted by:	Yoshihiro Ota
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D29754
2021-10-26 15:50:29 +03:00
Kyle Evans
f1f7f31366 cmp: initialize limit to avoid stack garbage limits
Pointy hat:	kevans
Fixes:	4e380e8474 ("cmp: add -n, --bytes to limit number of bytes [...]")
Sponsored by:	Klara, Inc.
2021-10-21 11:30:55 -05:00
Mateusz Piotrowski
12615938c6 timeout.1: Fix typos in examples
MFC after:	3 days
2021-10-21 13:07:32 +02:00
Konstantin Belousov
2c7a6dad4d ldd: do not use dlopen(RTLD_TRACE) for dso when format is specified
Problem is that rtld cannot reliably access updated environment.
This was made more obvious by bfd4c875a1.  The application
environment can be in arbitrary state and place, system components
can observe it only during execve(2), or in case of rtld, right after
execve, when environment is still at know location and format.

Instead spawn ld-elf.so.1 in direct exec mode which can correctly read
all inherited updates to the environment.

PR:	259069
Reviewed by:	arichardson, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32464
2021-10-21 03:09:14 +03:00
Konstantin Belousov
ca8c576d10 ldd: style
Reviewed by:	arichardson, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32464
2021-10-21 03:09:03 +03:00
Baptiste Daroussin
3f550f0191 timeout: style fixes 2021-10-20 10:44:32 +02:00
Baptiste Daroussin
68914dab43 timeout: eliminate usage of sysexits
It brings no value at all the sysexits and maybe misleading as the
return value of timeout(1) matters.
2021-10-20 10:39:34 +02:00
Gleb Smirnoff
1fec1fa814 sockstat: don't query jail vnet if system is running without VIMAGE.
Fixes:  f1cd4902bf
2021-10-19 09:49:35 -07:00
Gleb Smirnoff
32723a3ba9 sockstat: make err(3) on jail errors more verbose. 2021-10-19 09:49:35 -07:00
Ed Maste
e1d6d6f924 lorder: process read-only data symbols
Previously they were skipped.  lorder(1) serves no functional purpose
today but we might as well address this longstanding bug while it is
still in the tree.

PR:		133860
MFC after:	1 week
Submitted by:	John Hein
2021-10-18 17:21:17 -04:00
Alex Richardson
367ec75323 Fix a syntax error in 1b85b68da0
Reported by:	Michael Butler, jenkins
2021-10-14 17:46:28 +01:00
Cameron Katri
1b85b68da0 llvm-readobj: Attach to buildsystem
Also install it as readelf when MK_LLVM_BINUTILS is set.

Reviewed By:	dim, arichardson
Differential Revision: https://reviews.freebsd.org/D32058
2021-10-14 17:18:05 +01:00
Piotr Pawel Stefaniak
8da2705253 last: improve non-UTF8 locale output after libxo support was added
Some strftime(3) conversion specifications will generate strings encoded
with the current locale, not necessarily UTF8. As per xo_format.5, use
the h string modifier so that libxo interprets it appropriately.

Reviewed by:	eugen, philip
Differential Revision:	https://reviews.freebsd.org/D32437
2021-10-11 19:02:12 +02:00
Piotr Pawel Stefaniak
902cde5d0a Revert "last(1): unbreak for 8-bit locales"
This reverts commits 8e67c427b5 (unbreak for 8-bit locales), 0ca58ca151
(correction after r351413), and f424ec1b80 (fix style after r351459).

A simpler fix can be done by using the h modifier for strings that are
encoded with the current locale.

Reviewed by:	eugen, philip
Differential Revision:	https://reviews.freebsd.org/D32437
2021-10-11 19:01:57 +02:00
Yoshihiro Takahashi
2c614481fd unzip: Fix segmentation fault if a zip file contains buggy filename.
PR:             259011
Reported by:    Robert Morris
Submitted by:   ak
MFC after::     1 week
2021-10-10 20:49:19 +09:00
Mariusz Zaborski
824bbb9a40 diff: consider two files with same inodes as identical
Obtained from:	OpenBSD
MFC after:	1 week
2021-10-07 17:07:00 +02:00
Kyle Evans
7f4bb50176 login: use sizeof(audit_cond) consistently, NFC
The other three instances were already converted to use audit_cond, this
one was just changed from sizeof(long) -> sizeof(int).
2021-10-05 23:25:29 -05:00
Elyes HAOUAS
7102ec5226 unifdef.1: Fix typo on "input"
Pull request: https://github.com/freebsd/freebsd-src/pull/549
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
2021-10-05 20:27:16 -04:00
Mateusz Guzik
ae4fb190fd netstat: split ipsec and ipsec6 statistics in libxo
In particular fixes --libxo json

PR:		254673
Reported by:	j.vandeville@gmail.com
Sponsored by:   Rubicon Communications, LLC ("Netgate")
2021-10-05 09:42:58 +00:00
Stefan Eßer
b8d895faf4 contrib/bc: re-enable tests after the import of version 5.1.0
The tests have been fixed to not write any data outside of the
temporary work directory provided by the test framework.

MFC after:	3 days
2021-10-04 22:14:27 +02:00
Warner Losh
d6dffbae96 lastcomm/sa: Remove sparc64 tests, they aren't needed.
These tests will run only on a sparc64 system, and so never run anymore.

Sponsored by:		Netflix
2021-10-04 10:51:15 -06:00
Baptiste Daroussin
cbc83e378a ncurses: chase dependency changes in the source tree
Differential Revision:	https://reviews.freebsd.org/D32098
2021-10-04 11:38:24 +02:00
Stefan Eßer
f774652b0e contrib/bc: temporarily disconnect the tests for 5.0.2
The tests that come with version 5.0.2 have been extended to cover the
line editing functions. It has been found that these tests generate
false negative results in FreeBSD, most likely due to an issue in the
pexpect functionality used.

These history tests are skipped on systems that do not have python and
py-pexpect installed (and thus are unlikely to cause CI test failures),
but in order to not cause irritating failures on systems were these
packages are in fact installed, I temporarily disconnect them.

I had planned to skip this version due to the issue with the history
tests, but some committer has asked me to go ahead since the currently
used version 5.0.0 contains a macro name that collides with a project
he is working on.

No MFC of this version is planned. A version 5.0.3 is expected to be
released soon, and that version will allow to reconnect the tests and
will be MFCed.
2021-10-04 09:50:44 +02:00
Randall Stewart
a36230f75e tcp: Make dsack stats available in netstat and also make sure its aware of TLP's.
DSACK accounting has been for quite some time under a NETFLIX_STATS ifdef. Statistics
on DSACKs however are very useful in figuring out how much bad retransmissions you
are doing. This is further complicated, however, by stacks that do TLP. A TLP
when discovering a lost ack in the reverse path will cause the generation
of a DSACK. For this situation we introduce a new dsack-tlp-bytes as well
as the more traditional dsack-bytes and dsack-packets. These will now
all display in netstat -p tcp -s. This also updates all stacks that
are currently built to keep track of these stats.

Reviewed by: tuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D32158
2021-10-01 10:36:27 -04:00
Kyle Evans
f66b9b40f4 cmp: add -b, --print-bytes
This is compatible with GNU cmp.

Reviewed by:	bapt, markj (earlier version)
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D32074
2021-09-29 13:04:57 -05:00
Kyle Evans
8d546b6832 cmp: add -i, --ignore-initial, an alternative to skip1/skip2 args
This is compatible with GNU cmp.

Reviewed by:	markj
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D32073
2021-09-29 13:03:34 -05:00
Kyle Evans
4e380e8474 cmp: add -n, --bytes to limit number of bytes to compare
This is compatible with GNU cmp.

Reviewed by:	markj
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D32072
2021-09-29 13:03:34 -05:00
Kyle Evans
f6787614fd cmp: accept SI suffixes for skip1 and skip2
This is compatible with GNU cmp.

Reviewed by:	bapt (earlier version), markj, imp
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D32071
2021-09-29 13:03:34 -05:00
Yasuhiro Kimura
74237127e3 Add myself to calendar.freebsd
It corresponds to the 9th step of the procedure described in section
7.1 of Committer's Guide.

Approved by:	meta (mentor)
Differential Revision:	https://reviews.freebsd.org/D32153
2021-09-27 17:47:01 +09:00
Yoshihiro Takahashi
a4724ff481 unzip: sync with NetBSD upstream to add passphrase support
- Add support for password protected zip archives.
  We use memset_s() rather than explicit_bzero() for more portable
  (See PR).
- Use success/failure macro in exit()
- Mention ZIPX format in unzip(1)

Submitted by:	Mingye Wang and Alex Kozlov (ak@)
PR:		244181
Reviewed by:	mizhka
Obtained from:	NetBSD
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28892
2021-09-26 01:32:42 +09:00