aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* Improve usability of head(1) and tail(1):Xin LI2022-07-1310-30/+173
| | | | | | | | | | | - 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
* protect.1: Document that protect(1) does not work in jailsMateusz Piotrowski2022-07-111-1/+19
| | | | | | | | 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
* protect.1: Improve synopsisMateusz Piotrowski2022-07-071-3/+6
| | | | | | | While here, make the list's -width argument a bit shorter for readability. MFC after: 3 days
* sockstat(1): print PID adjusted to the rightGleb Smirnoff2022-07-071-1/+1
| | | | | | | | 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
* sockstat(1): print out full connection graph for unix(4) socketsGleb Smirnoff2022-07-072-34/+110
| | | | | | | | | | | | | | | | | | 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
* sockstat(1): widen the FD printing formatGleb Smirnoff2022-07-071-4/+4
| | | | | | | | 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
* sockstat(1): use tree(3) rbtree instead of hashGleb Smirnoff2022-07-071-48/+57
| | | | | | | | | | | | 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
* sockstat(1): we don't need kernel struct unpcbGleb Smirnoff2022-07-071-1/+0
| | | | Fixes: 0e229f343f4e8791f84a7acc6300f0bd1476c7b5
* netstat -i: do not truncate interface namesMike Karels2022-07-062-14/+20
| | | | | | | | | | | | | | | | | 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
* xargs: fix description of strnsubst return valueTom Jones2022-07-051-1/+1
| | | | | | Reported by: oshogbo Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35574
* xargs: terminate if line replacement cannot be constructedTom Jones2022-07-052-7/+16
| | | | | | | | | | | | 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
* diff3: make the eflag logic easier to followTom Jones2022-07-051-13/+20
| | | | | | Discussed with: dim Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35324
* gcore: Use PT_GETREGSET for NT_THRMISC and NT_PTLWPINFO.John Baldwin2022-06-302-88/+2
| | | | | | | | | | 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
* gcore: Remove unused typedefs.John Baldwin2022-06-301-6/+0
| | | | | | | | | | These are no longer needed after commit 4965ac059da1 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
* Bump .Dd for recently modified manual pagesFernando Apesteguía2022-06-271-1/+1
| | | | | | | | During the removal of named(8) references, some pages were modified but their .Dd where not updated accordingly. Reported by: lwhsu@ Fixes: 942e234d868d
* Remove references to named(8)Fernando Apesteguía2022-06-261-2/+1
| | | | | | | | 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
* diff3: Add man page description for version and helpTom Jones2022-06-231-2/+9
| | | | | | Reviewed by: Pau Amma Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35325
* netstat: print path weight when showing routes in structured output.Alexander V. Chernikov2022-06-221-0/+2
| | | | | Differential Revision: https://reviews.freebsd.org/D35530 MFC after: 2 weeks
* kdump: Decode Linux *at() syscallsDmitry Chagin2022-06-221-3/+232
| | | | MFC after: 2 weeks
* kdump: For future use made decode_filemode() publicDmitry Chagin2022-06-222-1/+2
| | | | MFC after: 2 weeks
* kdump: Decode Linux clock_nanosleep syscallDmitry Chagin2022-06-221-0/+22
| | | | MFC after: 2 weeks
* kdump: Decode Linux sigprocmask how argumentDmitry Chagin2022-06-221-0/+18
| | | | MFC after: 2 weeks
* kdump: Decode getitimer, setitimer which argumentDmitry Chagin2022-06-224-2/+36
| | | | | | Reviewed by: jhb (previous version, without truss) Differential revision: https://reviews.freebsd.org/D35231 MFC after: 2 weeks
* kdump: Decode Linux l_sigset_t.Dmitry Chagin2022-06-223-1/+49
| | | | | | Reviewed by: markj Differential revision: https://reviews.freebsd.org/D35153 MFC after: 2 weeks
* kdump: Add preliminary support for decoding Linux syscallsDmitry Chagin2022-06-224-13/+245
| | | | | | Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D35216 MFC after: 2 weeks
* kdump: For future use extract common code to a separate filesDmitry Chagin2022-06-222-40/+89
| | | | | | Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D35356 MFC after: 2 weeks
* mixer: remove volume backwards compat, add % interpretationKyle Evans2022-06-182-8/+8
| | | | | | | | | | | | | | | | 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
* truss: Make control message header parsing more robustMark Johnston2022-06-141-0/+10
| | | | | | | | | | | | 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
* usr.bin/bc: update to version 5.3.1Stefan Eßer2022-06-111-4/+7
| | | | | | | | | | | | | | | | | 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
* usr.bin/dtc: Include <limits> for std::numeric_limits<>.John Baldwin2022-06-092-1/+2
| | | | | | | | 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
* gcore: Don't hardcode VM write permissions.John Baldwin2022-06-061-1/+3
| | | | | | | | | 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
* gcore: Remove unused elf_note_arm_vfp function.John Baldwin2022-06-061-25/+0
| | | | Fixes: add00c381e5c Use a regset for NT_ARM_VFP.
* sed(1): Fix a typo in a source code commentGordon Bergling2022-06-041-1/+1
| | | | | | | - s/Initialy/Initially/ Obtained from: NetBSD MFC after: 3 days
* netinet6: Fix mbuf leak in NDPArseny Smalyuk2022-05-311-0/+2
| | | | | | | | | | | | | | | 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
* zdiff: avoid non-conformant featuresKyle Evans2022-05-314-22/+154
| | | | | | | | | | | | | `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
* sockstat: be more verbose when reporting kernel/userland size mismatch.Alexander V. Chernikov2022-05-301-18/+31
| | | | MFC after: 2 weeks
* nfsstat: Add an entry to output NFSPROC_APPENDWRITE countRick Macklem2022-05-281-6/+9
| | | | | | | | | | Commit 5218d82c81f9 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.
* sockbuf: remove unused mbuf counter and cluster counterGleb Smirnoff2022-05-272-17/+5
| | | | | | | | | | | 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
* diff3: Add help and version optionsTom Jones2022-05-251-3/+16
| | | | | Add help and version flags. Exit values in these paths are set to match the behaviour of gnu diff3.
* diff3: Copy line into debug informationTom Jones2022-05-251-1/+1
| | | | Sponsored by: Klara Inc.
* diff3: Don't perform a bitwise OR when comparing diffsTom Jones2022-05-251-1/+1
| | | | | | This fixes the build now that it uses -Wbitwise-instead-of-logical Sponsored by: Klara Inc.
* irdma: Add RDMA driver for Intel(R) Ethernet Controller E810Bartosz Sobczak2022-05-232-2/+2
| | | | | | | | | | | | | | | | | 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
* Use getpagesize in gcore to find the page sizeAndrew Turner2022-05-191-3/+5
| | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35194
* truss: add ppoll(2) argument decodingChristian Weisgerber2022-05-171-0/+3
| | | | | | PR: 264029 Approved by: emaste MFC after: 3 days
* Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35Dimitry Andric2022-05-142-6/+2
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-14-init-17616-g024a1fab5c35. PR: 261742 MFC after: 2 weeks
* Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3Dimitry Andric2022-05-143-5/+4
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-14-init-10223-g401b76fdf2b3. PR: 261742 MFC after: 2 weeks
* kdump: Decode cpuset_t.Dmitry Chagin2022-05-111-1/+39
| | | | | | Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D34982 MFC after: 2 weeks
* diff3: Remove test case that references non existent test filesTom Jones2022-05-021-2/+1
| | | | Sponsored by: Klara, Inc.
* base64: ignore -i as promisedPiotr Pawel Stefaniak2022-04-241-0/+4
|
* Add a quoted-printable encoder/decoderPiotr Pawel Stefaniak2022-04-244-8/+35
| | | | | | | | | | 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)