aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* usr.bin/netstat: use roundup2 when rounding up to power of 2.Xin LI2021-05-022-3/+3
| | | | MFC after: 2 weeks
* usr.bin/patch: remove unneeded header.Xin LI2021-05-021-1/+0
| | | | MFC after: 2 weeks
* Add a way to map arm64 non-posted device memoryAndrew Turner2021-05-011-0/+3
| | | | | | | | | | On arm64 we currently use a non-posted write for device memory, however we should move to use posted writes. This is expected to work on most hardware, however we will need to support a non-posted option for some broken hardware. Reviewed by: imp, manu, bcr (manpage) Differential Revision: https://reviews.freebsd.org/D29722
* poll(2): Add POLLRDHUP.Thomas Munro2021-04-281-1/+1
| | | | | | | | | | Teach poll(2) to support Linux-style POLLRDHUP events for sockets, if requested. Triggered when the remote peer shuts down writing or closes its end. Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D29757
* systat: Handle SIGWINCH to properly window resizing and adjustMichael Reifenberger2021-04-214-10/+22
| | | | | | | | | | -swap disk stat based on new size. Display corrupts after resizing a window. Process SIGWINCH to redraw all window. Submitted by: Yoshihiro Ota ota@j.email.ne.jp Differential Revision: https://reviews.freebsd.org/D29337
* systat: Avoid incorrect reallocation in pigs.cMichael Reifenberger2021-04-211-10/+7
| | | | | | | | | | | | Stop free() even if kvm_getprocs as we can come back but set nprocs = 0. Check nprocs in showpigs() to ensure not try displaying with kvm_getprocs failed. Current code can have pt with non-null after kvm_getprocs() failure. Replace to realloc for simpler operations. Submitted by: Yoshihiro Ota ota@j.email.ne.jp Reviewed by: mckusick@ Differential Revision: https://reviews.freebsd.org/D29303
* usr.bin/lex: regenerate bootstrap files after d37f81e35bAlex Richardson2021-04-212-18/+6
| | | | Reviewed by: jkim
* Revert "contrib/flex: Drop local __dead2 patch"Alex Richardson2021-04-212-6/+18
| | | | | | | | I missed the review comment to commit the changes separately, will reland in multiple smaller commits. Requested By: jkim This reverts commit bbd421cdf6d8c6102e6fd3979c5bec21ace3c2e3.
* contrib/flex: Drop local __dead2 patchAlex Richardson2021-04-202-18/+6
| | | | | | | | | | Upstream flex has added a yynoreturn, so this diff is no longer needed. Partially reverts r181269. Also regenerate the pre-generated files that are used for bootstrapping. Reviewed By: jkim Differential Revision: https://reviews.freebsd.org/D29679
* flex: Regen bootstrap filesJung-uk Kim2021-04-194-14/+18
| | | | | | | | | This also partially reverts r326025 (8a16b7a18f5d). I do not see any point of adding SPDX tag in generated file. MFC after: 3 days Submitted by: Dan McGregor <dan.mcgregor@usask.ca> (initial version) Differential Revision: https://reviews.freebsd.org/D28596
* less: upgrade to v581.Xin LI2021-04-191-1/+12
| | | | MFC after: 2 weeks
* tcp: add support for TCP over UDPMichael Tuexen2021-04-183-7/+16
| | | | | | | | | | | | Adding support for TCP over UDP allows communication with TCP stacks which can be implemented in userspace without requiring special priviledges or specific support by the OS. This is joint work with rrs. Reviewed by: rrs Sponsored by: Netflix, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29469
* Fix zgrep --versionMateusz Piotrowski2021-04-181-3/+3
| | | | | | | | | | | | | | "zgrep --version" is expected to print the version information in the same way as "zgrep -V". However, the case handling the --version flag is never reached, so "zgrep --version" prints: zgrep: missing pattern instead of: grep (BSD grep, GNU compatible) 2.6.0-FreeBSD Reviewed by: yuripv Approved by: yuripv (src) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29813
* grep: Fix an incorrect description of the -C flagMateusz Piotrowski2021-04-172-14/+11
| | | | | | | | | | | It seems that the number of lines is no longer an optional parameter to the -C flag. Document it accordingly both in the manual page and the usage message. Reviewed by: yuripv Approved by: yuripv MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28509
* Use if ... else when printing memory attributesAndrew Turner2021-04-111-36/+18
| | | | | | | | | | | | | | In vmstat there is a switch statement that converts these attributes to a string. As some values can be duplicate we have to hide these from userspace. Replace this switch statement with an if ... else macro that lets us repeat values without a compiler error. Reviewed by: kib MFC after: 2 weeks Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D29703
* m4(1): Add a SEE ALSO section and reference an AT&T manualGordon Bergling2021-04-081-1/+12
| | | | | Obtained from: OpenBSD MFC after: 1 week
* sed(1): Add a reference for a 4.4BSD manual documentGordon Bergling2021-04-081-1/+10
| | | | | Obtained from: OpenBSD MFC after: 1 week
* [bc] Update to version 4.0.0Stefan Eßer2021-04-061-2/+0
| | | | | | | | | | | | | | | This version fixes an issue (missing pop of top-of-stack value in the "P" command of the dc program). This issue did not affect the bc program, since it does not use dc as an back-end to actually perform the calculations as was the case with the traditional bc and dc programs. The major number has been bumped due to Windows support that has been added to this version. It does not correspond to a major change that might affect FreeBSD. MFC after: 3 days
* Fix `netstat -rs` reporting.Alexander V. Chernikov2021-03-312-13/+1
| | | | | | | | | rttrash (unused but not yet delete entries) were eliminated during routing rework. Remove reading these symbols from the kernel. PR: 254681 Reported by: rashey@superbox.pl MFC after: immediately
* fortune/freebsd-tips: Fix markup and wordingDaniel Ebdrup Jensen2021-03-311-3/+3
| | | | | | | | | | | | 'ps' is not a word - rather, it is a utility with its own manual page. As every other utility referenced in the file has it, append the relevant manual section that ps(1) can be found in. While here, also wordsmith a sentence to avoid awkward phrasing, and fix a typo. Pointy hat to: me Reported by: danfe, brueffer, maxim
* fortune/freebsd-tips: Add a few fortunesDaniel Ebdrup Jensen2021-03-301-0/+34
| | | | | These are fortunes I've used locally, probably for decades, so there's no reason why they shouldn't be available to everyone.
* fortune/freebsd-tips: Remove errant spacesDaniel Ebdrup Jensen2021-03-301-9/+10
| | | | | | | I noticed these errant spaces while removing a bogus fortune, and decided I might as well fix them. While here, reflow a line to it within 80 columns
* fortune/freebsd-tips: Remove bogus fortuneDaniel Ebdrup Jensen2021-03-301-3/+0
| | | | | | | | | | | | | | | | The RCS IDs have been retired as of the move to git, so on 14-CURRENT and 13.0-STABLE this fortune returns the following. This fortune brought to you by: $FreeBSD$ While faintly amusing the first time, this might just cause confusion for folks, and in addition it's not the most useful of tips, so doesn't add much. Therefore it seems prudent to get rid of it. MFC: Not to 11-STABLE or 12-STABLE.
* truss: improved support for decoding compat32 argumentsAlex Richardson2021-03-253-45/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently running `truss -a -e` does not decode any argument values for freebsd32_* syscalls (open/readlink/etc.) This change checks whether a syscall starts with freebsd{32,64}_ and if so strips that prefix when looking up the syscall information. To ensure that the truss logs include the real syscall name we create a copy of the syscall information struct with the updated. The other problem is that when reading string array values, truss naively iterates over an array of char* and fetches the pointer value. This will result in arguments not being loaded if the pointer is not aligned to sizeof(void*), which can happens in the compat32 case. If it happens to be aligned, we would end up printing every other value. To fix this problem, this changes adds a pointer_size member to the procabi struct and uses that to correctly read indirect arguments as 64/32 bit addresses in the the compat32 case (and also compat64 on CheriBSD). The motivating use-case for this change is using truss for 64-bit programs on a CHERI system, but most of the diff also applies to 32-bit compat on a 64-bit system, so I'm upstreaming this instead of keeping it as a local CheriBSD patch. Output of `truss -aef ldd32 /usr/bin/ldd32` before: 39113: freebsd32_mmap(0x0,0x1000,0x3,0x1002,0xffffffff,0x0,0x0) = 543440896 (0x20644000) 39113: freebsd32_ioctl(0x1,0x402c7413,0xffffd2a0) = 0 (0x0) /usr/bin/ldd32: 39113: write(1,"/usr/bin/ldd32:\n",16) = 16 (0x10) 39113: fork() = 39114 (0x98ca) 39114: <new process> 39114: freebsd32_execve(0xffffd97e,0xffffd680,0x20634000) EJUSTRETURN 39114: freebsd32_mmap(0x0,0x20000,0x3,0x1002,0xffffffff,0x0,0x0) = 541237248 (0x2042a000) 39114: freebsd32_mprotect(0x20427000,0x1000,0x1) = 0 (0x0) 39114: issetugid() = 0 (0x0) 39114: openat(AT_FDCWD,"/etc/libmap32.conf",O_RDONLY|O_CLOEXEC,00) ERR#2 'No such file or directory' 39114: openat(AT_FDCWD,"/var/run/ld-elf32.so.hints",O_RDONLY|O_CLOEXEC,00) = 3 (0x3) 39114: read(3,"Ehnt\^A\0\0\0\M^@\0\0\0#\0\0\0\0"...,128) = 128 (0x80) 39114: freebsd32_fstat(0x3,0xffffbd98) = 0 (0x0) 39114: freebsd32_pread(0x3,0x2042f000,0x23,0x80,0x0) = 35 (0x23) 39114: close(3) = 0 (0x0) 39114: openat(AT_FDCWD,"/usr/lib32/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3) 39114: freebsd32_fstat(0x3,0xffffc7d0) = 0 (0x0) 39114: freebsd32_mmap(0x0,0x1000,0x1,0x40002,0x3,0x0,0x0) = 541368320 (0x2044a000) After: 783: freebsd32_mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12),-1,0x0) = 543543296 (0x2065d000) 783: freebsd32_ioctl(1,TIOCGETA,0xffffd7b0) = 0 (0x0) /usr/bin/ldd32: 783: write(1,"/usr/bin/ldd32:\n",16) = 16 (0x10) 784: <new process> 783: fork() = 784 (0x310) 784: freebsd32_execve("/usr/bin/ldd32",[ "(null)" ],[ "LD_32_TRACE_LOADED_OBJECTS_PROGNAME=/usr/bin/ldd32", "LD_TRACE_LOADED_OBJECTS_PROGNAME=/usr/bin/ldd32", "LD_32_TRACE_LOADED_OBJECTS=yes", "LD_TRACE_LOADED_OBJECTS=yes", "USER=root", "LOGNAME=root", "HOME=/root", "SHELL=/bin/csh", "BLOCKSIZE=K", "MAIL=/var/mail/root", "MM_CHARSET=UTF-8", "LANG=C.UTF-8", "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin", "TERM=vt100", "HOSTTYPE=FreeBSD", "VENDOR=amd", "OSTYPE=FreeBSD", "MACHTYPE=x86_64", "SHLVL=1", "PWD=/root", "GROUP=wheel", "HOST=freebsd-amd64", "EDITOR=vi", "PAGER=less" ]) EJUSTRETURN 784: freebsd32_mmap(0x0,135168,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 541212672 (0x20424000) 784: freebsd32_mprotect(0x20421000,4096,PROT_READ) = 0 (0x0) 784: issetugid() = 0 (0x0) 784: sigfastblock(0x1,0x204234fc) = 0 (0x0) 784: open("/etc/libmap32.conf",O_RDONLY|O_CLOEXEC,00) ERR#2 'No such file or directory' 784: open("/var/run/ld-elf32.so.hints",O_RDONLY|O_CLOEXEC,00) = 3 (0x3) 784: read(3,"Ehnt\^A\0\0\0\M^@\0\0\0\v\0\0\0"...,128) = 128 (0x80) 784: freebsd32_fstat(3,{ mode=-r--r--r-- ,inode=18680,size=32768,blksize=0 }) = 0 (0x0) 784: freebsd32_pread(3,"/usr/lib32\0",11,0x80) = 11 (0xb) Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D27625
* Fix warning about signed comparison and drop WARNS for ktrdump(8).Dmitry Chagin2021-03-242-9/+7
| | | | | | Reviewed By: jhb, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29381
* ls(1): Refine the HISTORY within the manual page.Gordon Bergling2021-03-131-3/+10
| | | | | | | | | | A simple find command appeared in Version 1 AT&T UNIX and was removed in Version 3 AT&T UNIX. It was rewritten for Version 5 AT&T UNIX and later be enhanced for the Programmer's Workbench (PWB). These changes were later incorporated in AT&T UNIX v7. Reviewed by: imp MFC after: 1 week
* Fix some common typos in commentsGordon Bergling2021-03-132-3/+3
| | | | | | | | | | | - occured -> occurred - normaly -> normally - controling -> controlling - fileds -> fields - insterted -> inserted - outputing -> outputting MFC after: 1 week
* Improve the wording for showing the brightness levelBrad Davis2021-03-121-2/+2
| | | | Reviewed by: allanjude
* Remove the never-installed setchannel(1) utility. It only work(s|ed)Mark Murray2021-03-074-411/+0
| | | | | with the never-committed cxm(4) driver and the now-removed bktr(4) driver.
* Fix 'make bmake' top-level bootstrapping.Bryan Drewery2021-03-061-0/+2
| | | | Fixes: ee10666327b62
* truss: split counting of syscalls and syscall calling conventionAlex Richardson2021-03-044-63/+67
| | | | | | | | | | | | | | This change is a refactoring cleanup to improve support for compat32 syscalls (and compat64 on CHERI systems). Each process ABI now has it's own struct sycall instead of using one global list. The list of all syscalls is replaced with a list of seen syscalls. Looking up the syscall argument passing convention now interates over the fixed-size array instead of using a link-list that's populated on startup so we no longer need the init_syscall() function. The actual functional changes are in D27625. Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D27636
* compress(1): warn about link handlingFernando Apesteguía2021-03-041-1/+10
| | | | | | | | | | compress(1) handles links badly and does not provide link-handling options. Document this behavior. PR: 84271 Submitted by: garys@opusnet.com Approved by: gbe@ (mentor) Differential Revision: https://reviews.freebsd.org/D28552
* env: style(9) fix, add a spaceKyle Evans2021-03-031-1/+1
| | | | | Reported by: pstef Fixes: 55deb0a5f089 ("service(8): use an environment more [...]")
* service(8): use an environment more consistent with init(8)Andrew Gierth2021-03-032-10/+22
| | | | | | | | | | | | | | | init(8) sets the "daemon" login class without specifying a pw entry (so no substitutions are done on the variables). service(8)'s use of env -L had the effect of specifying root's pw entry, with two effects: getpwnam and getpwuid are being called, which may not be entirely safe depending on what nsswitch is up to and what stage of boot we are at, and substitutions would have been done. Fix by teaching env(8) to allow -L -/classname to set the class environment with no pw entry at all specified, and use it in service(8). PR: 253959
* backlight(8): Add note that with option it print the current brightness.Emmanuel Vadot2021-03-031-1/+4
| | | | | MFC after: 3 days PR: 253737
* backlight: Fix incr/decr with percent value of 0David Schlachter2021-03-031-2/+7
| | | | | | | This now does nothing instead of incr/decr by 10% MFC After: 3 days PR: 253736
* fortune: add a tip about gstatAlan Somers2021-02-261-0/+6
| | | | MFC after: 3 weeks
* mkimg: Add support for offset if the source is an imageEmmanuel Vadot2021-02-251-8/+11
| | | | | | | | | | This allow us to create image with the following format: mkimg -v -o sdcard -s gpt -p efi:=esp_aarch64.img:1M -p freebsd-ufs::1G Which will add a efi partition at a 1M offset on the image with its content coming from the esp_aarch64.img file. MFC after: 3 days
* mkimg: We always want the last block of the last inserted partitionEmmanuel Vadot2021-02-251-4/+2
| | | | | | | | | | | | Even with an absolute offset we want to know the last block the partition otherwise we endup with an image the size of the metadata. This allow to create image with the ESP placed at a specific position which is useful on arm/arm64 where u-boot have always a hard time to read the ESP if it's not aligned on 512k. mkimg -v -o sdcard -s gpt -p efi::54M:1M -p freebsd-ufs::1G now works. MFC after: 3 days
* ncurses: Add support for terminfo databaseBaptiste Daroussin2021-02-2518-2180/+51
| | | | | | | | | | | | | | | | | | | | | | | | | Along with the termcap database, ncurses will now lookup for the terminfo database, note that the terminfo database is being looked up first and then it fallsback on the termcap one. While here drop our custom reader for the termcap database, over the time it is needed maintenance to be able to catchup with changes on ncurses side. Install the ncurses tools which are needed to deal with the terminfo database: tic, infocmp, toe Replace our termcap only aware tools with the ncurses counterpart: tput, tabs, tset, clear and reset In particular they can your the extra capabilities described in the terminfo database, which does not exist in termcap Note that to add a new terminfo information to the database from ports the ports will just need to add their extra information into: /usr/local/share/site-terminfo/<firstletteroftheterm>/<term> Tested by: jbeich, manu
* Add GPT PREP-boot type to mkimg(1) from geom_gpt.Nathan Whitehorn2021-02-241-0/+2
| | | | | | This partition type can be used to boot some PowerKVM VMs. We don't support it well because of some limitations in SLOF, but it's worth at least have feature parity in geom and mkimg.
* find(1): Mark -not as an extensions to POSIXDaniel Ebdrup Jensen2021-02-231-3/+3
| | | | | | | While here, change mdoc macro from Ic to Fl. PR: 253499 Reported by: Michael Siegel <bugcounterism at malbolge.net>
* Source repo changes to add new committer Rajesh Kumar M ARajesh Kumar M A2021-02-161-0/+1
| | | | | | Approved by: vmaffione, gallatin Differential Revision: https://reviews.freebsd.org/D28586
* Improve size readability.Michael Reifenberger2021-02-153-89/+49
| | | | | | | | | | | Preserve more space for swap devise names. Prevent line overflow with long devise name. Don't draw a bar when swap is not used at all. Simplify and optimize code. Change the label to end at end of 100%. PR: 251655 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27496
* bsd.links.mk wants full pathsSimon J. Gerraty2021-02-151-1/+1
| | | | The values in LINKS need to be full paths.
* Links for bmake and bmake.1Simon J. Gerraty2021-02-151-0/+2
| | | | | | Some folk forget that make is bmake, and want the links... MFC after: 1 week
* procstat: distinguish vm map guards in procstat vm output.Konstantin Belousov2021-02-142-1/+7
| | | | | | | Requested and reviewed by: rwatson (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28658
* Update Subversion to 1.14.1 LTS. See contrib/subversion/CHANGES for aDimitry Andric2021-02-132-2/+3
| | | | | | | | | | | | | | | | summary of changes, or for a more thorough overview: https://subversion.apache.org/docs/release-notes/1.14 NOTE 1: There is no need to dump and reload repositories, and the working copy format is still the same as Subversion 1.8 through 1.13. NOTE 2: The upstream release also contains a fix for a security issue in mod_dav_svn (CVE-2020-17525), but since we do not build or use any Apache modules, it is not an issue for the FreeBSD base system. Relnotes: yes MFC after: 3 days
* Merge bmake-20210206Simon J. Gerraty2021-02-113-20/+69
|\ | | | | | | | | | | | | | | | | | | | | Changes of interest o unit-tests: use private TMPDIR to avoid errors from other users o avoid strdup in mkTempFile o always use vfork o job.c: do not create empty shell files in jobs mode reduce unnecessary calls to waitpid o cond.c: fix debug output for comparison operators in conditionals
* | systat.1: Fix synopsisMateusz Piotrowski2021-02-101-1/+1
| | | | | | | | | | | | | | systat does not have a "-display" flag. Use Ar to indicate that "display" is meant to be substituted with an actual display command. MFC after: 1 week