aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlen Barber <gjb@FreeBSD.org>2020-08-12 17:16:26 +0000
committerGlen Barber <gjb@FreeBSD.org>2020-08-12 17:16:26 +0000
commit440cec3faf778469b36b998bb52aab7fbc43eae3 (patch)
treeac86950162195a2d336cf3b77d7d7a963e848c27
parent0a459a714f4977f27679b5727bbdf1d63a181896 (diff)
parentf7d79f6c6d50b5ddba2ca9936345bf6f07837c1a (diff)
downloadsrc-440cec3faf778469b36b998bb52aab7fbc43eae3.tar.gz
src-440cec3faf778469b36b998bb52aab7fbc43eae3.zip
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
Notes
Notes: svn path=/projects/release-git/; revision=364173
-rw-r--r--Makefile.inc161
-rw-r--r--ObsoleteFiles.inc4
-rw-r--r--RELNOTES7
-rw-r--r--UPDATING11
-rw-r--r--cddl/contrib/opensolaris/cmd/zinject/translate.c4
-rw-r--r--cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c1
-rwxr-xr-xcddl/contrib/opensolaris/lib/libdtrace/common/mkerrno.sh16
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/mkerrtags.sh38
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh38
-rwxr-xr-xcddl/contrib/opensolaris/lib/libdtrace/common/mksignal.sh16
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h2
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c40
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c24
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h4
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c1
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h10
-rw-r--r--contrib/bc/Makefile.in2
-rw-r--r--contrib/bc/NEWS.md27
-rw-r--r--contrib/bc/README.md8
-rw-r--r--contrib/bc/include/bc.h3
-rw-r--r--contrib/bc/include/vm.h18
-rw-r--r--contrib/bc/locales/zh_CN.GB18030.msg9
-rw-r--r--contrib/bc/locales/zh_CN.GB2312.msg9
-rw-r--r--contrib/bc/locales/zh_CN.GBK.msg9
-rw-r--r--contrib/bc/locales/zh_CN.UTF-8.msg13
-rw-r--r--contrib/bc/locales/zh_CN.eucCN.msg9
-rw-r--r--contrib/bc/manuals/bc.1.md.in26
-rw-r--r--contrib/bc/manuals/bc/A.135
-rw-r--r--contrib/bc/manuals/bc/A.1.md26
-rw-r--r--contrib/bc/manuals/bc/E.135
-rw-r--r--contrib/bc/manuals/bc/E.1.md26
-rw-r--r--contrib/bc/manuals/bc/EH.135
-rw-r--r--contrib/bc/manuals/bc/EH.1.md26
-rw-r--r--contrib/bc/manuals/bc/EHN.135
-rw-r--r--contrib/bc/manuals/bc/EHN.1.md26
-rw-r--r--contrib/bc/manuals/bc/EHNP.135
-rw-r--r--contrib/bc/manuals/bc/EHNP.1.md26
-rw-r--r--contrib/bc/manuals/bc/EHP.135
-rw-r--r--contrib/bc/manuals/bc/EHP.1.md26
-rw-r--r--contrib/bc/manuals/bc/EN.135
-rw-r--r--contrib/bc/manuals/bc/EN.1.md26
-rw-r--r--contrib/bc/manuals/bc/ENP.135
-rw-r--r--contrib/bc/manuals/bc/ENP.1.md26
-rw-r--r--contrib/bc/manuals/bc/EP.135
-rw-r--r--contrib/bc/manuals/bc/EP.1.md26
-rw-r--r--contrib/bc/manuals/bc/H.135
-rw-r--r--contrib/bc/manuals/bc/H.1.md26
-rw-r--r--contrib/bc/manuals/bc/HN.135
-rw-r--r--contrib/bc/manuals/bc/HN.1.md26
-rw-r--r--contrib/bc/manuals/bc/HNP.135
-rw-r--r--contrib/bc/manuals/bc/HNP.1.md26
-rw-r--r--contrib/bc/manuals/bc/HP.135
-rw-r--r--contrib/bc/manuals/bc/HP.1.md26
-rw-r--r--contrib/bc/manuals/bc/N.135
-rw-r--r--contrib/bc/manuals/bc/N.1.md26
-rw-r--r--contrib/bc/manuals/bc/NP.135
-rw-r--r--contrib/bc/manuals/bc/NP.1.md26
-rw-r--r--contrib/bc/manuals/bc/P.135
-rw-r--r--contrib/bc/manuals/bc/P.1.md26
-rw-r--r--contrib/bc/manuals/dc.1.md.in12
-rw-r--r--contrib/bc/manuals/dc/A.117
-rw-r--r--contrib/bc/manuals/dc/A.1.md12
-rw-r--r--contrib/bc/manuals/dc/E.117
-rw-r--r--contrib/bc/manuals/dc/E.1.md12
-rw-r--r--contrib/bc/manuals/dc/EH.117
-rw-r--r--contrib/bc/manuals/dc/EH.1.md12
-rw-r--r--contrib/bc/manuals/dc/EHN.117
-rw-r--r--contrib/bc/manuals/dc/EHN.1.md12
-rw-r--r--contrib/bc/manuals/dc/EHNP.117
-rw-r--r--contrib/bc/manuals/dc/EHNP.1.md12
-rw-r--r--contrib/bc/manuals/dc/EHP.117
-rw-r--r--contrib/bc/manuals/dc/EHP.1.md12
-rw-r--r--contrib/bc/manuals/dc/EN.117
-rw-r--r--contrib/bc/manuals/dc/EN.1.md12
-rw-r--r--contrib/bc/manuals/dc/ENP.117
-rw-r--r--contrib/bc/manuals/dc/ENP.1.md12
-rw-r--r--contrib/bc/manuals/dc/EP.117
-rw-r--r--contrib/bc/manuals/dc/EP.1.md12
-rw-r--r--contrib/bc/manuals/dc/H.117
-rw-r--r--contrib/bc/manuals/dc/H.1.md12
-rw-r--r--contrib/bc/manuals/dc/HN.117
-rw-r--r--contrib/bc/manuals/dc/HN.1.md12
-rw-r--r--contrib/bc/manuals/dc/HNP.117
-rw-r--r--contrib/bc/manuals/dc/HNP.1.md12
-rw-r--r--contrib/bc/manuals/dc/HP.117
-rw-r--r--contrib/bc/manuals/dc/HP.1.md12
-rw-r--r--contrib/bc/manuals/dc/N.117
-rw-r--r--contrib/bc/manuals/dc/N.1.md12
-rw-r--r--contrib/bc/manuals/dc/NP.117
-rw-r--r--contrib/bc/manuals/dc/NP.1.md12
-rw-r--r--contrib/bc/manuals/dc/P.117
-rw-r--r--contrib/bc/manuals/dc/P.1.md12
-rw-r--r--contrib/bc/src/args.c14
-rw-r--r--contrib/bc/src/bc/bc.c2
-rw-r--r--contrib/bc/src/bc/parse.c18
-rw-r--r--contrib/bc/src/dc/dc.c2
-rw-r--r--contrib/bc/src/program.c7
-rw-r--r--contrib/bc/src/vm.c74
-rw-r--r--contrib/bc/tests/bc/all.txt2
l---------contrib/bc/tests/bc/misc6.txt1
l---------contrib/bc/tests/bc/misc6_results.txt1
l---------contrib/bc/tests/bc/misc7.txt1
l---------contrib/bc/tests/bc/misc7_results.txt1
-rw-r--r--contrib/bc/tests/bc/stdin1.txt2
-rw-r--r--contrib/bc/tests/bc/stdin1_results.txt1
-rw-r--r--contrib/bc/tests/bc/stdin2.txt1
-rw-r--r--contrib/bc/tests/bc/stdin2_results.txt3
-rw-r--r--contrib/ipfilter/iplang/iplang_y.y30
-rw-r--r--contrib/telnet/telnet/telnet.110
-rw-r--r--etc/mtree/BSD.tests.dist2
-rw-r--r--lib/Makefile1
-rw-r--r--lib/csu/mips/Makefile21
-rw-r--r--lib/googletest/gtest/Makefile2
-rw-r--r--lib/lib80211/lib80211_regdomain.h8
-rw-r--r--lib/libc/gen/Makefile.inc1
-rw-r--r--lib/libc/gen/Symbol.map2
-rw-r--r--lib/libc/gen/directory.374
-rw-r--r--lib/libc/gen/getpeereid.c2
-rw-r--r--lib/libc/gen/scandir-compat11.c31
-rw-r--r--lib/libc/gen/scandir.c5
-rw-r--r--lib/libc/gen/setmode.c9
-rw-r--r--lib/libc/locale/mbsrtowcs.322
-rw-r--r--lib/libc/locale/setlocale.325
-rw-r--r--lib/libc/powerpc64/gen/makecontext.c4
-rw-r--r--lib/libc/regex/regcomp.c312
-rw-r--r--lib/libc/regex/regex.313
-rw-r--r--lib/libc/regex/regex2.h1
-rw-r--r--lib/libc/riscv/gen/Makefile.inc2
-rw-r--r--lib/libc/riscv/gen/fpgetmask.c41
-rw-r--r--lib/libc/riscv/gen/fpsetmask.c53
-rw-r--r--lib/libc/stdio/tmpnam.34
-rw-r--r--lib/libclang_rt/fuzzer/Makefile4
-rw-r--r--lib/libclang_rt/profile/Makefile4
-rw-r--r--lib/libclang_rt/xray/Makefile6
-rw-r--r--lib/libdevinfo/Makefile10
-rw-r--r--lib/libdevinfo/devinfo.c32
-rw-r--r--lib/libifconfig/Makefile21
-rw-r--r--lib/libifconfig/libifconfig.h4
-rw-r--r--lib/libifconfig/libifconfig_sfp.c592
-rw-r--r--lib/libifconfig/libifconfig_sfp.h219
-rw-r--r--lib/libifconfig/libifconfig_sfp_tables.tpl.c124
-rw-r--r--lib/libifconfig/libifconfig_sfp_tables.tpl.h130
-rw-r--r--lib/libifconfig/libifconfig_sfp_tables_internal.tpl.h66
-rw-r--r--lib/libifconfig/sfp.lua367
-rw-r--r--lib/libpmc/libpmc.c22
-rw-r--r--lib/libpmcstat/libpmcstat.h3
-rw-r--r--lib/libregex/tests/gnuext.in22
-rwxr-xr-xlib/libregex/tests/libregex_test.sh4
-rw-r--r--lib/ncurses/ncurses/Makefile2
-rwxr-xr-xlibexec/rc/rc.d/ipfilter1
-rwxr-xr-xlibexec/rc/rc.d/ipmon2
-rwxr-xr-xlibexec/rc/rc.d/ipnat1
-rwxr-xr-xlibexec/rc/rc.d/netif2
-rwxr-xr-xlibexec/rc/rc.d/netwait2
-rwxr-xr-xlibexec/rc/rc.d/securelevel2
-rw-r--r--release/arm64/RPI3.conf2
-rw-r--r--release/packages/binutils.ucl6
-rw-r--r--release/packages/caroot.ucl6
-rw-r--r--release/packages/clang.ucl6
-rw-r--r--release/packages/gdb.ucl6
-rwxr-xr-xrelease/packages/generate-ucl.sh5
-rw-r--r--release/packages/groff.ucl6
-rw-r--r--release/packages/jail.ucl6
-rw-r--r--release/packages/kernel.ucl8
-rw-r--r--release/packages/lld.ucl6
-rw-r--r--release/packages/lldb.ucl6
-rw-r--r--release/packages/runtime.ucl8
-rw-r--r--release/packages/ssh.ucl6
-rw-r--r--release/packages/svn.ucl6
-rw-r--r--release/packages/template.ucl6
-rw-r--r--release/packages/unbound.ucl6
-rw-r--r--release/packages/utilities.ucl6
-rw-r--r--rescue/rescue/Makefile3
-rw-r--r--sbin/ifconfig/Makefile3
-rw-r--r--sbin/ifconfig/ifieee80211.c23
-rw-r--r--sbin/ifconfig/sfp.c986
-rw-r--r--sbin/ipfw/ipfw.833
-rw-r--r--sbin/ipfw/ipfw2.c20
-rw-r--r--sbin/ipfw/nat64clat.c3
-rw-r--r--sbin/ipfw/nat64stl.c3
-rw-r--r--sbin/iscontrol/Makefile2
-rw-r--r--sbin/mount/mount.c4
-rw-r--r--sbin/route/tests/basic.sh4
-rw-r--r--share/dtrace/mbuf.d68
-rw-r--r--share/examples/etc/make.conf6
-rw-r--r--share/examples/ipfilter/Makefile2
-rw-r--r--share/examples/smbfs/Makefile2
-rw-r--r--share/examples/smbfs/print/Makefile2
-rw-r--r--share/man/man4/Makefile2
-rw-r--r--share/man/man4/cp2112.487
-rw-r--r--share/man/man4/gpiokeys.4152
-rw-r--r--share/man/man4/net80211.412
-rw-r--r--share/man/man4/unix.46
-rw-r--r--share/man/man5/core.54
-rw-r--r--share/man/man7/build.79
-rw-r--r--share/man/man7/environ.774
-rw-r--r--share/man/man7/ports.79
-rw-r--r--share/man/man9/Makefile5
-rw-r--r--share/man/man9/VOP_ATTRIB.945
-rw-r--r--share/man/man9/malloc.96
-rw-r--r--share/man/man9/seqc.91
-rw-r--r--share/man/man9/zone.99
-rw-r--r--share/mk/bsd.linker.mk3
-rw-r--r--share/mk/bsd.sys.mk9
-rw-r--r--share/mk/src.libnames.mk2
-rw-r--r--share/mk/src.opts.mk8
-rw-r--r--share/mk/sys.mk1
-rwxr-xr-xstand/common/newvers.sh6
-rw-r--r--stand/defs.mk2
-rw-r--r--stand/i386/loader/Makefile2
-rw-r--r--sys/amd64/include/iommu.h6
-rw-r--r--sys/arm/allwinner/aw_cir.c52
-rw-r--r--sys/arm/allwinner/clkng/aw_clk_nm.c4
-rw-r--r--sys/arm/allwinner/clkng/ccu_sun8i_r.c2
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_firmware.c24
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_mbox.c23
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h18
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2838_xhci.c217
-rw-r--r--sys/arm/broadcom/bcm2835/files.bcm283x1
-rw-r--r--sys/arm/broadcom/bcm2835/raspberrypi_gpio.c457
-rw-r--r--sys/arm64/conf/GENERIC1
-rw-r--r--sys/arm64/include/armreg.h15
-rw-r--r--sys/arm64/include/profile.h2
-rw-r--r--sys/arm64/rockchip/clk/rk3328_cru.c286
-rw-r--r--sys/arm64/rockchip/clk/rk_clk_composite.c57
-rw-r--r--sys/arm64/rockchip/clk/rk_clk_composite.h1
-rw-r--r--sys/arm64/rockchip/if_dwc_rk.c542
-rw-r--r--sys/cam/ctl/ctl.c82
-rw-r--r--sys/cam/ctl/ctl_cmd_table.c20
-rw-r--r--sys/cam/ctl/ctl_private.h1
-rw-r--r--sys/cam/mmc/mmc_all.h1
-rw-r--r--sys/cam/mmc/mmc_da.c6
-rw-r--r--sys/cam/mmc/mmc_xpt.c92
-rw-r--r--sys/cam/scsi/scsi_all.h26
-rw-r--r--sys/cddl/compat/opensolaris/sys/assfail.h4
-rw-r--r--sys/cddl/compat/opensolaris/sys/stat.h13
-rw-r--r--sys/cddl/compat/opensolaris/sys/time.h1
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c7
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h2
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h4
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h26
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c2
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c158
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c66
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c2
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h4
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h9
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c130
-rw-r--r--sys/compat/linprocfs/linprocfs.c40
-rw-r--r--sys/compat/linuxkpi/common/include/linux/bitops.h3
-rw-r--r--sys/compat/linuxkpi/common/include/linux/dma-mapping.h1
-rw-r--r--sys/compat/linuxkpi/common/include/linux/jiffies.h2
-rw-r--r--sys/compat/linuxkpi/common/include/linux/kref.h15
-rw-r--r--sys/compat/linuxkpi/common/include/linux/mutex.h2
-rw-r--r--sys/compat/linuxkpi/common/include/linux/radix-tree.h1
-rw-r--r--sys/compat/linuxkpi/common/include/linux/sched.h5
-rw-r--r--sys/compat/linuxkpi/common/include/linux/sizes.h51
-rw-r--r--sys/compat/linuxkpi/common/src/linux_compat.c2
-rw-r--r--sys/compat/linuxkpi/common/src/linux_radix.c143
-rw-r--r--sys/compat/linuxkpi/common/src/linux_rcu.c18
-rw-r--r--sys/compat/netbsd/dvcfg.h67
-rw-r--r--sys/conf/files1
-rw-r--r--sys/conf/files.arm642
-rw-r--r--sys/conf/kern.pre.mk4
-rw-r--r--sys/dev/acpica/acpi_apei.c36
-rw-r--r--sys/dev/ahci/ahci_pci.c1
-rw-r--r--sys/dev/dwc/if_dwc.c25
-rw-r--r--sys/dev/dwc/if_dwc.h4
-rw-r--r--sys/dev/dwc/if_dwc_if.m14
-rw-r--r--sys/dev/dwc/if_dwcvar.h1
-rw-r--r--sys/dev/e1000/if_em.c5
-rw-r--r--sys/dev/fdt/simplebus.c6
-rw-r--r--sys/dev/fdt/simplebus.h5
-rw-r--r--sys/dev/gpio/gpiokeys.c94
-rw-r--r--sys/dev/hwpmc/hwpmc_arm64.c24
-rw-r--r--sys/dev/hwpmc/hwpmc_mod.c14
-rw-r--r--sys/dev/hwpmc/pmc_events.h43
-rw-r--r--sys/dev/ioat/ioat.c2
-rw-r--r--sys/dev/iommu/busdma_iommu.c58
-rw-r--r--sys/dev/iommu/iommu.h11
-rw-r--r--sys/dev/iommu/iommu_gas.c23
-rw-r--r--sys/dev/mpr/mpr_sas.c1
-rw-r--r--sys/dev/mps/mps_sas.c1
-rw-r--r--sys/dev/neta/if_mvneta.c7
-rw-r--r--sys/dev/nvme/nvme_qpair.c4
-rw-r--r--sys/dev/pci/pci.c2
-rw-r--r--sys/dev/rtwn/usb/rtwn_usb_attach.h1
-rw-r--r--sys/dev/safexcel/safexcel.c2
-rw-r--r--sys/dev/usb/controller/xhci.h3
-rw-r--r--sys/dev/usb/controller/xhci_pci.c12
-rw-r--r--sys/dev/usb/misc/cp2112.c1459
-rw-r--r--sys/dev/usb/usbdevs4
-rw-r--r--sys/dev/vt/vt_core.c15
-rw-r--r--sys/fs/cd9660/cd9660_vnops.c2
-rw-r--r--sys/fs/devfs/devfs.h6
-rw-r--r--sys/fs/devfs/devfs_devs.c17
-rw-r--r--sys/fs/devfs/devfs_int.h3
-rw-r--r--sys/fs/devfs/devfs_vnops.c189
-rw-r--r--sys/fs/ext2fs/ext2_vnops.c2
-rw-r--r--sys/fs/fuse/fuse_internal.c2
-rw-r--r--sys/fs/msdosfs/msdosfs_vnops.c2
-rw-r--r--sys/fs/nfs/nfs.h1
-rw-r--r--sys/fs/nfs/nfs_commonkrpc.c6
-rw-r--r--sys/fs/nfs/nfs_commonsubs.c21
-rw-r--r--sys/fs/nfs/nfs_var.h10
-rw-r--r--sys/fs/nfsclient/nfs_clcomsubs.c2
-rw-r--r--sys/fs/nfsclient/nfs_clrpcops.c2
-rw-r--r--sys/fs/nfsclient/nfs_clvfsops.c4
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c4
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c109
-rw-r--r--sys/fs/nfsserver/nfs_nfsdserv.c73
-rw-r--r--sys/fs/nfsserver/nfs_nfsdstate.c8
-rw-r--r--sys/fs/nullfs/null_vnops.c16
-rw-r--r--sys/fs/pseudofs/pseudofs_vnops.c4
-rw-r--r--sys/fs/smbfs/smbfs_vnops.c2
-rw-r--r--sys/fs/tmpfs/tmpfs_vfsops.c9
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.c53
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.h1
-rw-r--r--sys/fs/udf/udf_vnops.c2
-rw-r--r--sys/gnu/dts/arm/am335x-baltos.dtsi2
-rw-r--r--sys/gnu/dts/arm/am335x-boneblack-common.dtsi1
-rw-r--r--sys/gnu/dts/arm/am335x-boneblack-wireless.dts1
-rw-r--r--sys/gnu/dts/arm/am335x-boneblue.dts1
-rw-r--r--sys/gnu/dts/arm/am335x-bonegreen-wireless.dts1
-rw-r--r--sys/gnu/dts/arm/am335x-evm.dts3
-rw-r--r--sys/gnu/dts/arm/am335x-evmsk.dts2
-rw-r--r--sys/gnu/dts/arm/am335x-guardian.dts1
-rw-r--r--sys/gnu/dts/arm/am335x-lxm.dts2
-rw-r--r--sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi2
-rw-r--r--sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts2
-rw-r--r--sys/gnu/dts/arm/am335x-pepper.dts4
-rw-r--r--sys/gnu/dts/arm/am335x-phycore-som.dtsi2
-rw-r--r--sys/gnu/dts/arm/am335x-pocketbeagle.dts1
-rw-r--r--sys/gnu/dts/arm/am33xx-l4.dtsi12
-rw-r--r--sys/gnu/dts/arm/am33xx.dtsi22
-rw-r--r--sys/gnu/dts/arm/am3517-evm.dts1
-rw-r--r--sys/gnu/dts/arm/am3517.dtsi24
-rw-r--r--sys/gnu/dts/arm/am4372.dtsi23
-rw-r--r--sys/gnu/dts/arm/am437x-cm-t43.dts2
-rw-r--r--sys/gnu/dts/arm/am437x-gp-evm.dts20
-rw-r--r--sys/gnu/dts/arm/am437x-l4.dtsi26
-rw-r--r--sys/gnu/dts/arm/am437x-sk-evm.dts18
-rw-r--r--sys/gnu/dts/arm/am43x-epos-evm.dts16
-rw-r--r--sys/gnu/dts/arm/am571x-idk.dts48
-rw-r--r--sys/gnu/dts/arm/am5729-beagleboneai.dts731
-rw-r--r--sys/gnu/dts/arm/am572x-idk-common.dtsi63
-rw-r--r--sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi63
-rw-r--r--sys/gnu/dts/arm/am57xx-idk-common.dtsi58
-rw-r--r--sys/gnu/dts/arm/armada-370-xp.dtsi2
-rw-r--r--sys/gnu/dts/arm/armada-375.dtsi2
-rw-r--r--sys/gnu/dts/arm/armada-38x.dtsi5
-rw-r--r--sys/gnu/dts/arm/armada-39x.dtsi4
-rw-r--r--sys/gnu/dts/arm/aspeed-ast2600-evb.dts4
-rw-r--r--sys/gnu/dts/arm/aspeed-bmc-facebook-tiogapass.dts78
-rw-r--r--sys/gnu/dts/arm/aspeed-bmc-facebook-yosemitev2.dts231
-rw-r--r--sys/gnu/dts/arm/aspeed-bmc-ibm-rainier.dts202
-rw-r--r--sys/gnu/dts/arm/aspeed-bmc-opp-mihawk.dts310
-rw-r--r--sys/gnu/dts/arm/aspeed-bmc-opp-nicole.dts326
-rw-r--r--sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts35
-rw-r--r--sys/gnu/dts/arm/aspeed-bmc-opp-tacoma.dts112
-rw-r--r--sys/gnu/dts/arm/aspeed-bmc-opp-witherspoon.dts34
-rw-r--r--sys/gnu/dts/arm/aspeed-bmc-opp-zaius.dts37
-rw-r--r--sys/gnu/dts/arm/aspeed-g4.dtsi10
-rw-r--r--sys/gnu/dts/arm/aspeed-g5.dtsi43
-rw-r--r--sys/gnu/dts/arm/aspeed-g6.dtsi64
-rw-r--r--sys/gnu/dts/arm/at91-dvk_su60_somc.dtsi2
-rw-r--r--sys/gnu/dts/arm/at91-kizbox3-hs.dts4
-rw-r--r--sys/gnu/dts/arm/at91-kizbox3_common.dtsi48
-rw-r--r--sys/gnu/dts/arm/at91-sam9x60ek.dts23
-rw-r--r--sys/gnu/dts/arm/at91-sama5d27_som1.dtsi54
-rw-r--r--sys/gnu/dts/arm/at91-sama5d27_som1_ek.dts64
-rw-r--r--sys/gnu/dts/arm/at91-sama5d27_wlsom1.dtsi16
-rw-r--r--sys/gnu/dts/arm/at91-sama5d27_wlsom1_ek.dts12
-rw-r--r--sys/gnu/dts/arm/at91-sama5d2_icp.dts767
-rw-r--r--sys/gnu/dts/arm/at91-sama5d2_ptc_ek.dts25
-rw-r--r--sys/gnu/dts/arm/at91-sama5d2_xplained.dts118
-rw-r--r--sys/gnu/dts/arm/at91-wb50n.dtsi4
-rw-r--r--sys/gnu/dts/arm/at91rm9200.dtsi296
-rw-r--r--sys/gnu/dts/arm/at91sam9g45.dtsi392
-rw-r--r--sys/gnu/dts/arm/at91sam9m10g45ek.dts4
-rw-r--r--sys/gnu/dts/arm/at91sam9n12.dtsi324
-rw-r--r--sys/gnu/dts/arm/at91sam9n12ek.dts2
-rw-r--r--sys/gnu/dts/arm/at91sam9rl.dtsi54
-rw-r--r--sys/gnu/dts/arm/at91sam9x5.dtsi54
-rw-r--r--sys/gnu/dts/arm/bcm-nsp.dtsi10
-rw-r--r--sys/gnu/dts/arm/bcm2711-rpi-4-b.dts13
-rw-r--r--sys/gnu/dts/arm/bcm2835-common.dtsi1
-rw-r--r--sys/gnu/dts/arm/bcm2835-rpi-common.dtsi12
-rw-r--r--sys/gnu/dts/arm/bcm2835.dtsi1
-rw-r--r--sys/gnu/dts/arm/bcm2836.dtsi1
-rw-r--r--sys/gnu/dts/arm/bcm2837.dtsi1
-rw-r--r--sys/gnu/dts/arm/bcm47094-luxul-xwc-2000.dts1
-rw-r--r--sys/gnu/dts/arm/bcm958522er.dts4
-rw-r--r--sys/gnu/dts/arm/bcm958525er.dts4
-rw-r--r--sys/gnu/dts/arm/bcm958525xmc.dts4
-rw-r--r--sys/gnu/dts/arm/bcm958622hr.dts4
-rw-r--r--sys/gnu/dts/arm/bcm958623hr.dts4
-rw-r--r--sys/gnu/dts/arm/bcm958625hr.dts4
-rw-r--r--sys/gnu/dts/arm/bcm958625k.dts4
-rw-r--r--sys/gnu/dts/arm/berlin2.dtsi6
-rw-r--r--sys/gnu/dts/arm/berlin2cd.dtsi2
-rw-r--r--sys/gnu/dts/arm/berlin2q.dtsi6
-rw-r--r--sys/gnu/dts/arm/dm814x.dtsi74
-rw-r--r--sys/gnu/dts/arm/dm816x.dtsi78
-rw-r--r--sys/gnu/dts/arm/dove.dtsi3
-rw-r--r--sys/gnu/dts/arm/dra7-evm-common.dtsi21
-rw-r--r--sys/gnu/dts/arm/dra7-evm.dts54
-rw-r--r--sys/gnu/dts/arm/dra7-ipu-dsp-common.dtsi39
-rw-r--r--sys/gnu/dts/arm/dra7-l4.dtsi63
-rw-r--r--sys/gnu/dts/arm/dra7.dtsi46
-rw-r--r--sys/gnu/dts/arm/dra71-evm.dts42
-rw-r--r--sys/gnu/dts/arm/dra72-evm-common.dtsi18
-rw-r--r--sys/gnu/dts/arm/dra72-evm-revc.dts42
-rw-r--r--sys/gnu/dts/arm/dra72-evm.dts42
-rw-r--r--sys/gnu/dts/arm/dra72x.dtsi6
-rw-r--r--sys/gnu/dts/arm/dra74-ipu-dsp-common.dtsi18
-rw-r--r--sys/gnu/dts/arm/dra74x.dtsi21
-rw-r--r--sys/gnu/dts/arm/dra76-evm.dts54
-rw-r--r--sys/gnu/dts/arm/e60k02.dtsi2
-rw-r--r--sys/gnu/dts/arm/exynos3250-monk.dts3
-rw-r--r--sys/gnu/dts/arm/exynos3250-rinato.dts48
-rw-r--r--sys/gnu/dts/arm/exynos4210-i9100.dts768
-rw-r--r--sys/gnu/dts/arm/exynos4210-origen.dts7
-rw-r--r--sys/gnu/dts/arm/exynos4210-trats.dts41
-rw-r--r--sys/gnu/dts/arm/exynos4210-universal_c210.dts33
-rw-r--r--sys/gnu/dts/arm/exynos4412-galaxy-s3.dtsi6
-rw-r--r--sys/gnu/dts/arm/exynos4412-midas.dtsi17
-rw-r--r--sys/gnu/dts/arm/exynos4412-odroid-common.dtsi8
-rw-r--r--sys/gnu/dts/arm/exynos4412-origen.dts14
-rw-r--r--sys/gnu/dts/arm/exynos5250-arndale.dts13
-rw-r--r--sys/gnu/dts/arm/exynos5420-arndale-octa.dts2
-rw-r--r--sys/gnu/dts/arm/imx50.dtsi8
-rw-r--r--sys/gnu/dts/arm/imx51.dtsi3
-rw-r--r--sys/gnu/dts/arm/imx53-cx9020.dts25
-rw-r--r--sys/gnu/dts/arm/imx53.dtsi3
-rw-r--r--sys/gnu/dts/arm/imx6dl-colibri-v1_1-eval-v3.dts31
-rw-r--r--sys/gnu/dts/arm/imx6q-dhcom-pdk2.dts115
-rw-r--r--sys/gnu/dts/arm/imx6qdl-colibri-v1_1-uhs.dtsi44
-rw-r--r--sys/gnu/dts/arm/imx6qdl-colibri.dtsi11
-rw-r--r--sys/gnu/dts/arm/imx6qdl-gw551x.dtsi2
-rw-r--r--sys/gnu/dts/arm/imx6qdl-gw552x.dtsi14
-rw-r--r--sys/gnu/dts/arm/imx6qdl-gw560x.dtsi31
-rw-r--r--sys/gnu/dts/arm/imx6qdl-gw5904.dtsi31
-rw-r--r--sys/gnu/dts/arm/imx6qdl-gw5910.dtsi35
-rw-r--r--sys/gnu/dts/arm/imx6qdl-icore.dtsi3
-rw-r--r--sys/gnu/dts/arm/imx6qdl-sabresd.dtsi1
-rw-r--r--sys/gnu/dts/arm/imx6qdl-sr-som.dtsi11
-rw-r--r--sys/gnu/dts/arm/imx6qdl.dtsi15
-rw-r--r--sys/gnu/dts/arm/imx6sl.dtsi13
-rw-r--r--sys/gnu/dts/arm/imx6sx-sabreauto.dts2
-rw-r--r--sys/gnu/dts/arm/imx6sx-sdb.dtsi2
-rw-r--r--sys/gnu/dts/arm/imx6sx.dtsi4
-rw-r--r--sys/gnu/dts/arm/imx6ul-kontron-n6x1x-s.dtsi13
-rw-r--r--sys/gnu/dts/arm/imx6ul-kontron-n6x1x-som-common.dtsi13
-rw-r--r--sys/gnu/dts/arm/imx6ul.dtsi4
-rw-r--r--sys/gnu/dts/arm/imx7-tqma7.dtsi2
-rw-r--r--sys/gnu/dts/arm/imx7d-cl-som-imx7.dts4
-rw-r--r--sys/gnu/dts/arm/imx7d-colibri.dtsi4
-rw-r--r--sys/gnu/dts/arm/imx7d-nitrogen7.dts4
-rw-r--r--sys/gnu/dts/arm/imx7d-pinfunc.h2
-rw-r--r--sys/gnu/dts/arm/imx7d-sdb.dts4
-rw-r--r--sys/gnu/dts/arm/imx7d-tqma7.dtsi4
-rw-r--r--sys/gnu/dts/arm/imx7d-zii-rmu2.dts2
-rw-r--r--sys/gnu/dts/arm/imx7d-zii-rpu2.dts2
-rw-r--r--sys/gnu/dts/arm/imx7d.dtsi1
-rw-r--r--sys/gnu/dts/arm/imx7s.dtsi3
-rw-r--r--sys/gnu/dts/arm/integratorap-im-pd1.dts270
-rw-r--r--sys/gnu/dts/arm/integratorap.dts53
-rw-r--r--sys/gnu/dts/arm/keystone-k2e.dtsi4
-rw-r--r--sys/gnu/dts/arm/keystone-k2g-evm.dts103
-rw-r--r--sys/gnu/dts/arm/keystone-k2g.dtsi26
-rw-r--r--sys/gnu/dts/arm/keystone-k2hk.dtsi4
-rw-r--r--sys/gnu/dts/arm/keystone-k2l.dtsi4
-rw-r--r--sys/gnu/dts/arm/kirkwood-l-50.dts438
-rw-r--r--sys/gnu/dts/arm/kirkwood-netgear_readynas_nv+_v2.dts14
-rw-r--r--sys/gnu/dts/arm/kirkwood.dtsi2
-rw-r--r--sys/gnu/dts/arm/logicpd-torpedo-baseboard.dtsi1
-rw-r--r--sys/gnu/dts/arm/ls1021a-twr.dts14
-rw-r--r--sys/gnu/dts/arm/meson.dtsi5
-rw-r--r--sys/gnu/dts/arm/meson8b-odroidc1.dts3
-rw-r--r--sys/gnu/dts/arm/meson8b.dtsi5
-rw-r--r--sys/gnu/dts/arm/meson8m2-mxiii-plus.dts4
-rw-r--r--sys/gnu/dts/arm/meson8m2.dtsi13
-rw-r--r--sys/gnu/dts/arm/mmp2.dtsi2
-rw-r--r--sys/gnu/dts/arm/mmp3.dtsi26
-rw-r--r--sys/gnu/dts/arm/motorola-cpcap-mapphone.dtsi4
-rw-r--r--sys/gnu/dts/arm/mt2701-evb.dts21
-rw-r--r--sys/gnu/dts/arm/mt2701.dtsi33
-rw-r--r--sys/gnu/dts/arm/mt7623.dtsi25
-rw-r--r--sys/gnu/dts/arm/mt7623n-rfb-emmc.dts1
-rw-r--r--sys/gnu/dts/arm/omap2.dtsi31
-rw-r--r--sys/gnu/dts/arm/omap2420.dtsi68
-rw-r--r--sys/gnu/dts/arm/omap2430.dtsi68
-rw-r--r--sys/gnu/dts/arm/omap3-beagle.dts33
-rw-r--r--sys/gnu/dts/arm/omap3-devkit8000.dts33
-rw-r--r--sys/gnu/dts/arm/omap3-gta04.dtsi1
-rw-r--r--sys/gnu/dts/arm/omap3-n900.dts12
-rw-r--r--sys/gnu/dts/arm/omap3.dtsi134
-rw-r--r--sys/gnu/dts/arm/omap4-duovero-parlor.dts2
-rw-r--r--sys/gnu/dts/arm/omap4-l4.dtsi4
-rw-r--r--sys/gnu/dts/arm/omap4.dtsi10
-rw-r--r--sys/gnu/dts/arm/omap5-l4.dtsi35
-rw-r--r--sys/gnu/dts/arm/omap5.dtsi96
-rw-r--r--sys/gnu/dts/arm/pxa168.dtsi8
-rw-r--r--sys/gnu/dts/arm/pxa3xx.dtsi2
-rw-r--r--sys/gnu/dts/arm/pxa910.dtsi4
-rw-r--r--sys/gnu/dts/arm/qcom-ipq4019.dtsi29
-rw-r--r--sys/gnu/dts/arm/qcom-ipq8064.dtsi6
-rw-r--r--sys/gnu/dts/arm/qcom-msm8974-samsung-klte.dts405
-rw-r--r--sys/gnu/dts/arm/qcom-msm8974.dtsi11
-rw-r--r--sys/gnu/dts/arm/r8a7740.dtsi2
-rw-r--r--sys/gnu/dts/arm/r8a7742-iwg21d-q7.dts37
-rw-r--r--sys/gnu/dts/arm/r8a7742-iwg21m.dtsi53
-rw-r--r--sys/gnu/dts/arm/r8a7742.dtsi648
-rw-r--r--sys/gnu/dts/arm/r8a7743.dtsi12
-rw-r--r--sys/gnu/dts/arm/r8a7744.dtsi12
-rw-r--r--sys/gnu/dts/arm/r8a7745.dtsi12
-rw-r--r--sys/gnu/dts/arm/r8a7790.dtsi12
-rw-r--r--sys/gnu/dts/arm/r8a7791.dtsi95
-rw-r--r--sys/gnu/dts/arm/r8a7793.dtsi14
-rw-r--r--sys/gnu/dts/arm/r8a7794.dtsi12
-rw-r--r--sys/gnu/dts/arm/rk3036-kylin.dts2
-rw-r--r--sys/gnu/dts/arm/rk3066a-mk808.dts2
-rw-r--r--sys/gnu/dts/arm/rk3188-radxarock.dts6
-rw-r--r--sys/gnu/dts/arm/rk3229-xms6.dts19
-rw-r--r--sys/gnu/dts/arm/rk322x.dtsi10
-rw-r--r--sys/gnu/dts/arm/rk3288-firefly-reload.dts12
-rw-r--r--sys/gnu/dts/arm/rk3288-firefly.dtsi12
-rw-r--r--sys/gnu/dts/arm/rk3288-miqi.dts2
-rw-r--r--sys/gnu/dts/arm/rk3288-phycore-som.dtsi6
-rw-r--r--sys/gnu/dts/arm/rk3288-rock2-square.dts4
-rw-r--r--sys/gnu/dts/arm/rk3288-tinker.dtsi6
-rw-r--r--sys/gnu/dts/arm/rk3288.dtsi1
-rw-r--r--sys/gnu/dts/arm/rtd1195-horseradish.dts32
-rw-r--r--sys/gnu/dts/arm/rtd1195-mele-x1000.dts32
-rw-r--r--sys/gnu/dts/arm/rtd1195.dtsi217
-rw-r--r--sys/gnu/dts/arm/s5pv210-aries.dtsi359
-rw-r--r--sys/gnu/dts/arm/s5pv210-fascinate4g.dts249
-rw-r--r--sys/gnu/dts/arm/s5pv210-galaxys.dts292
-rw-r--r--sys/gnu/dts/arm/s5pv210-pinctrl.dtsi9
-rw-r--r--sys/gnu/dts/arm/s5pv210.dtsi23
-rw-r--r--sys/gnu/dts/arm/sama5d2.dtsi415
-rw-r--r--sys/gnu/dts/arm/sama5d3.dtsi537
-rw-r--r--sys/gnu/dts/arm/sama5d3_can.dtsi20
-rw-r--r--sys/gnu/dts/arm/sama5d3_emac.dtsi8
-rw-r--r--sys/gnu/dts/arm/sama5d3_gmac.dtsi11
-rw-r--r--sys/gnu/dts/arm/sama5d3_lcd.dtsi19
-rw-r--r--sys/gnu/dts/arm/sama5d3_mci2.dtsi11
-rw-r--r--sys/gnu/dts/arm/sama5d3_tcb1.dtsi12
-rw-r--r--sys/gnu/dts/arm/sama5d3_uart.dtsi20
-rw-r--r--sys/gnu/dts/arm/sama5d3xmb.dtsi6
-rw-r--r--sys/gnu/dts/arm/sama5d3xmb_cmp.dtsi6
-rw-r--r--sys/gnu/dts/arm/sama5d4.dtsi126
-rw-r--r--sys/gnu/dts/arm/sh73a0.dtsi2
-rw-r--r--sys/gnu/dts/arm/socfpga.dtsi18
-rw-r--r--sys/gnu/dts/arm/socfpga_arria10.dtsi2
-rw-r--r--sys/gnu/dts/arm/ste-ux500-samsung-golden.dts65
-rw-r--r--sys/gnu/dts/arm/ste-ux500-samsung-skomer.dts39
-rw-r--r--sys/gnu/dts/arm/stih407-family.dtsi14
-rw-r--r--sys/gnu/dts/arm/stih418.dtsi8
-rw-r--r--sys/gnu/dts/arm/stm32f429.dtsi4
-rw-r--r--sys/gnu/dts/arm/stm32h743.dtsi4
-rw-r--r--sys/gnu/dts/arm/stm32mp15-pinctrl.dtsi666
-rw-r--r--sys/gnu/dts/arm/stm32mp151.dtsi37
-rw-r--r--sys/gnu/dts/arm/stm32mp157.dtsi8
-rw-r--r--sys/gnu/dts/arm/stm32mp157a-avenger96.dts314
-rw-r--r--sys/gnu/dts/arm/stm32mp157a-dhcor-avenger96.dts38
-rw-r--r--sys/gnu/dts/arm/stm32mp157a-iot-box.dts68
-rw-r--r--sys/gnu/dts/arm/stm32mp157a-stinger96.dts12
-rw-r--r--sys/gnu/dts/arm/stm32mp157a-stinger96.dtsi342
-rw-r--r--sys/gnu/dts/arm/stm32mp157c-dhcom-pdk2.dts265
-rw-r--r--sys/gnu/dts/arm/stm32mp157c-dk2.dts8
-rw-r--r--sys/gnu/dts/arm/stm32mp157c-ed1.dts7
-rw-r--r--sys/gnu/dts/arm/stm32mp157c-ev1.dts14
-rw-r--r--sys/gnu/dts/arm/stm32mp157c-lxa-mc1.dts252
-rw-r--r--sys/gnu/dts/arm/stm32mp15xx-dhcom-pdk2.dtsi337
-rw-r--r--sys/gnu/dts/arm/stm32mp15xx-dhcom-som.dtsi (renamed from sys/gnu/dts/arm/stm32mp157c-dhcom-som.dtsi)9
-rw-r--r--sys/gnu/dts/arm/stm32mp15xx-dhcor-avenger96.dtsi401
-rw-r--r--sys/gnu/dts/arm/stm32mp15xx-dhcor-io1v8.dtsi23
-rw-r--r--sys/gnu/dts/arm/stm32mp15xx-dhcor-som.dtsi209
-rw-r--r--sys/gnu/dts/arm/stm32mp15xx-dkx.dtsi20
-rw-r--r--sys/gnu/dts/arm/stm32mp15xx-osd32.dtsi230
-rw-r--r--sys/gnu/dts/arm/sun4i-a10.dtsi2
-rw-r--r--sys/gnu/dts/arm/sun5i.dtsi2
-rw-r--r--sys/gnu/dts/arm/sun7i-a20-olinuxino-lime-emmc.dts32
-rw-r--r--sys/gnu/dts/arm/sun7i-a20.dtsi2
-rw-r--r--sys/gnu/dts/arm/sun8i-a83t.dtsi10
-rw-r--r--sys/gnu/dts/arm/sun8i-h2-plus-bananapi-m2-zero.dts2
-rw-r--r--sys/gnu/dts/arm/sun8i-h3.dtsi24
-rw-r--r--sys/gnu/dts/arm/sunxi-h3-h5.dtsi10
-rw-r--r--sys/gnu/dts/arm/tegra114-dalmore.dts3
-rw-r--r--sys/gnu/dts/arm/tegra124-venice2.dts2
-rw-r--r--sys/gnu/dts/arm/tegra20-colibri-eval-v3.dts2
-rw-r--r--sys/gnu/dts/arm/tegra20-colibri-iris.dts2
-rw-r--r--sys/gnu/dts/arm/tegra20-harmony.dts2
-rw-r--r--sys/gnu/dts/arm/tegra20-medcom-wide.dts2
-rw-r--r--sys/gnu/dts/arm/tegra20-paz00.dts2
-rw-r--r--sys/gnu/dts/arm/tegra20-seaboard.dts2
-rw-r--r--sys/gnu/dts/arm/tegra20-ventana.dts2
-rw-r--r--sys/gnu/dts/arm/tegra30-apalis-eval.dts2
-rw-r--r--sys/gnu/dts/arm/tegra30-apalis-v1.1-eval.dts2
-rw-r--r--sys/gnu/dts/arm/tegra30-beaver.dts40
-rw-r--r--sys/gnu/dts/arm/tegra30-cardhu.dtsi2
-rw-r--r--sys/gnu/dts/arm/tegra30-colibri-eval-v3.dts2
-rw-r--r--sys/gnu/dts/arm/uniphier-ld4.dtsi2
-rw-r--r--sys/gnu/dts/arm/uniphier-ld6b-ref.dts1
-rw-r--r--sys/gnu/dts/arm/uniphier-pro4-ace.dts1
-rw-r--r--sys/gnu/dts/arm/uniphier-pro4-ref.dts1
-rw-r--r--sys/gnu/dts/arm/uniphier-pro4-sanji.dts1
-rw-r--r--sys/gnu/dts/arm/uniphier-pro4.dtsi10
-rw-r--r--sys/gnu/dts/arm/uniphier-pro5.dtsi12
-rw-r--r--sys/gnu/dts/arm/uniphier-pxs2-gentil.dts1
-rw-r--r--sys/gnu/dts/arm/uniphier-pxs2-vodka.dts1
-rw-r--r--sys/gnu/dts/arm/uniphier-pxs2.dtsi12
-rw-r--r--sys/gnu/dts/arm/uniphier-sld8.dtsi2
-rw-r--r--sys/gnu/dts/arm/vexpress-v2m-rs1.dtsi304
-rw-r--r--sys/gnu/dts/arm64/allwinner/sun50i-a64-olinuxino.dts9
-rw-r--r--sys/gnu/dts/arm64/allwinner/sun50i-a64.dtsi12
-rw-r--r--sys/gnu/dts/arm64/allwinner/sun50i-h6-beelink-gs1.dts9
-rw-r--r--sys/gnu/dts/arm64/allwinner/sun50i-h6-cpu-opp.dtsi117
-rw-r--r--sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-3.dts3
-rw-r--r--sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-lite2.dts65
-rw-r--r--sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi.dtsi17
-rw-r--r--sys/gnu/dts/arm64/allwinner/sun50i-h6-pine-h64.dts43
-rw-r--r--sys/gnu/dts/arm64/allwinner/sun50i-h6-tanix-tx6.dts13
-rw-r--r--sys/gnu/dts/arm64/allwinner/sun50i-h6.dtsi61
-rw-r--r--sys/gnu/dts/arm64/altera/socfpga_stratix10.dtsi8
-rw-r--r--sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk.dts1
-rw-r--r--sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk_nand.dts7
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-axg.dtsi6
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-g12-common.dtsi11
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-g12.dtsi32
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-g12b-gtking-pro.dts125
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-g12b-gtking.dts145
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-g12b-khadas-vim3.dtsi18
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-g12b-s922x.dtsi15
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-g12b-ugoos-am6.dts377
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-g12b-w400.dtsi423
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-g12b.dtsi22
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gx-libretech-pc.dtsi78
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gx-p23x-q20x.dtsi98
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gx.dtsi23
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxbb-kii-pro.dts2
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxbb-nanopi-k2.dts2
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxbb-nexbox-a95x.dts2
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxbb-odroidc2.dts2
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95.dtsi2
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek-play2.dts4
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek.dtsi6
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxbb.dtsi23
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-libretech-ac.dts75
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-p241.dts5
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxl-s805x.dtsi24
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-phicomm-n1.dts4
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-sml5442tw.dts80
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxl-s905w-p281.dts4
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxl-s905w-tx3-mini.dts4
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts4
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts77
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts3
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-p212.dtsi3
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxl.dtsi84
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxm-khadas-vim2.dts3
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxm-nexbox-a1.dts3
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxm-rbox-pro.dts4
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxm-vega-s96.dts4
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-gxm.dtsi7
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-khadas-vim3.dtsi4
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-sm1-odroid-c4.dts402
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-sm1-sei610.dts2
-rw-r--r--sys/gnu/dts/arm64/amlogic/meson-sm1.dtsi24
-rw-r--r--sys/gnu/dts/arm64/arm/foundation-v8-gicv2.dtsi4
-rw-r--r--sys/gnu/dts/arm64/arm/foundation-v8-gicv3.dtsi11
-rw-r--r--sys/gnu/dts/arm64/arm/foundation-v8.dtsi142
-rw-r--r--sys/gnu/dts/arm64/arm/fvp-base-revc.dts10
-rw-r--r--sys/gnu/dts/arm64/arm/juno-base.dtsi82
-rw-r--r--sys/gnu/dts/arm64/arm/juno-motherboard.dtsi166
-rw-r--r--sys/gnu/dts/arm64/arm/rtsm_ve-aemv8a.dts2
-rw-r--r--sys/gnu/dts/arm64/arm/rtsm_ve-motherboard-rs2.dtsi4
-rw-r--r--sys/gnu/dts/arm64/arm/rtsm_ve-motherboard.dtsi152
-rw-r--r--sys/gnu/dts/arm64/arm/vexpress-v2m-rs1.dtsi304
-rw-r--r--sys/gnu/dts/arm64/freescale/fsl-ls1012a-frdm.dts15
-rw-r--r--sys/gnu/dts/arm64/freescale/fsl-ls1012a-frwy.dts15
-rw-r--r--sys/gnu/dts/arm64/freescale/fsl-ls1012a-qds.dts15
-rw-r--r--sys/gnu/dts/arm64/freescale/fsl-ls1012a-rdb.dts15
-rw-r--r--sys/gnu/dts/arm64/freescale/fsl-ls1012a.dtsi13
-rw-r--r--sys/gnu/dts/arm64/freescale/fsl-ls1028a-kontron-sl28-var2.dts4
-rw-r--r--sys/gnu/dts/arm64/freescale/fsl-ls1028a-kontron-sl28.dts5
-rw-r--r--sys/gnu/dts/arm64/freescale/fsl-ls1028a.dtsi6
-rw-r--r--sys/gnu/dts/arm64/freescale/fsl-ls1043a-rdb.dts33
-rw-r--r--sys/gnu/dts/arm64/freescale/fsl-ls1043a.dtsi65
-rw-r--r--sys/gnu/dts/arm64/freescale/fsl-lx2160a.dtsi130
-rw-r--r--sys/gnu/dts/arm64/freescale/imx8mm-beacon-baseboard.dtsi285
-rw-r--r--sys/gnu/dts/arm64/freescale/imx8mm-beacon-kit.dts19
-rw-r--r--sys/gnu/dts/arm64/freescale/imx8mm-beacon-som.dtsi410
-rw-r--r--sys/gnu/dts/arm64/freescale/imx8mm-evk.dts16
-rw-r--r--sys/gnu/dts/arm64/freescale/imx8mm.dtsi14
-rw-r--r--sys/gnu/dts/arm64/freescale/imx8mn-ddr4-evk.dts16
-rw-r--r--sys/gnu/dts/arm64/freescale/imx8mn.dtsi12
-rw-r--r--sys/gnu/dts/arm64/freescale/imx8mp.dtsi88
-rw-r--r--sys/gnu/dts/arm64/freescale/imx8mq-librem5-devkit.dts4
-rw-r--r--sys/gnu/dts/arm64/freescale/imx8mq.dtsi10
-rw-r--r--sys/gnu/dts/arm64/freescale/imx8qxp-mek.dts95
-rw-r--r--sys/gnu/dts/arm64/freescale/imx8qxp.dtsi18
-rw-r--r--sys/gnu/dts/arm64/freescale/qoriq-fman3-0.dtsi1
-rw-r--r--sys/gnu/dts/arm64/hisilicon/hi3660.dtsi4
-rw-r--r--sys/gnu/dts/arm64/hisilicon/hi6220-coresight.dtsi130
-rw-r--r--sys/gnu/dts/arm64/hisilicon/hikey960-pinctrl.dtsi6
-rw-r--r--sys/gnu/dts/arm64/intel/socfpga_agilex.dtsi4
-rw-r--r--sys/gnu/dts/arm64/intel/socfpga_agilex_socdk.dts1
-rw-r--r--sys/gnu/dts/arm64/marvell/armada-3720-db.dts3
-rw-r--r--sys/gnu/dts/arm64/marvell/armada-3720-espressobin.dtsi2
-rw-r--r--sys/gnu/dts/arm64/marvell/armada-3720-turris-mox.dts10
-rw-r--r--sys/gnu/dts/arm64/marvell/armada-3720-uDPU.dts22
-rw-r--r--sys/gnu/dts/arm64/marvell/armada-37xx.dtsi4
-rw-r--r--sys/gnu/dts/arm64/marvell/armada-8040-clearfog-gt-8k.dts7
-rw-r--r--sys/gnu/dts/arm64/marvell/armada-8040-mcbin-singleshot.dts4
-rw-r--r--sys/gnu/dts/arm64/marvell/armada-8040-mcbin.dts4
-rw-r--r--sys/gnu/dts/arm64/marvell/armada-ap80x.dtsi1
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt2712-evb.dts74
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt2712e.dtsi158
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt6358.dtsi358
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt6797-x20-dev.dts49
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt6797.dtsi231
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt7622-bananapi-bpi-r64.dts4
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt7622-rfb1.dts4
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt7622.dtsi11
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt8173-elm-hana-rev7.dts27
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt8173-elm-hana.dts14
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt8173-elm-hana.dtsi70
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt8173-elm.dts14
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt8173-elm.dtsi1173
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt8173.dtsi80
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt8183-evb.dts147
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt8183.dtsi50
-rw-r--r--sys/gnu/dts/arm64/mediatek/mt8516.dtsi17
-rw-r--r--sys/gnu/dts/arm64/mediatek/pumpkin-common.dtsi34
-rw-r--r--sys/gnu/dts/arm64/nvidia/tegra132-norrin.dts2
-rw-r--r--sys/gnu/dts/arm64/nvidia/tegra186-p3310.dtsi3
-rw-r--r--sys/gnu/dts/arm64/nvidia/tegra194-p2888.dtsi5
-rw-r--r--sys/gnu/dts/arm64/nvidia/tegra194.dtsi30
-rw-r--r--sys/gnu/dts/arm64/nvidia/tegra210-p2180.dtsi3
-rw-r--r--sys/gnu/dts/arm64/nvidia/tegra210-p2597.dtsi10
-rw-r--r--sys/gnu/dts/arm64/nvidia/tegra210-p3450-0000.dts7
-rw-r--r--sys/gnu/dts/arm64/nvidia/tegra210.dtsi89
-rw-r--r--sys/gnu/dts/arm64/qcom/apq8016-sbc-pmic-pins.dtsi74
-rw-r--r--sys/gnu/dts/arm64/qcom/apq8016-sbc-soc-pins.dtsi89
-rw-r--r--sys/gnu/dts/arm64/qcom/apq8016-sbc.dtsi257
-rw-r--r--sys/gnu/dts/arm64/qcom/apq8096-db820c.dtsi53
-rw-r--r--sys/gnu/dts/arm64/qcom/ipq8074-hk01.dts112
-rw-r--r--sys/gnu/dts/arm64/qcom/ipq8074.dtsi474
-rw-r--r--sys/gnu/dts/arm64/qcom/msm8916-longcheer-l8150.dts25
-rw-r--r--sys/gnu/dts/arm64/qcom/msm8916-pins.dtsi221
-rw-r--r--sys/gnu/dts/arm64/qcom/msm8916-samsung-a2015-common.dtsi98
-rw-r--r--sys/gnu/dts/arm64/qcom/msm8916-samsung-a3u-eur.dts54
-rw-r--r--sys/gnu/dts/arm64/qcom/msm8916-samsung-a5u-eur.dts35
-rw-r--r--sys/gnu/dts/arm64/qcom/msm8916.dtsi228
-rw-r--r--sys/gnu/dts/arm64/qcom/msm8996.dtsi87
-rw-r--r--sys/gnu/dts/arm64/qcom/msm8998.dtsi38
-rw-r--r--sys/gnu/dts/arm64/qcom/pm8150.dtsi14
-rw-r--r--sys/gnu/dts/arm64/qcom/pm8150b.dtsi14
-rw-r--r--sys/gnu/dts/arm64/qcom/pm8150l.dtsi14
-rw-r--r--sys/gnu/dts/arm64/qcom/pmi8994.dtsi6
-rw-r--r--sys/gnu/dts/arm64/qcom/qcs404-evb.dtsi85
-rw-r--r--sys/gnu/dts/arm64/qcom/qcs404.dtsi100
-rw-r--r--sys/gnu/dts/arm64/qcom/sc7180-idp.dts66
-rw-r--r--sys/gnu/dts/arm64/qcom/sc7180.dtsi959
-rw-r--r--sys/gnu/dts/arm64/qcom/sdm660-xiaomi-lavender.dts46
-rw-r--r--sys/gnu/dts/arm64/qcom/sdm660.dtsi372
-rw-r--r--sys/gnu/dts/arm64/qcom/sdm845-cheza.dtsi7
-rw-r--r--sys/gnu/dts/arm64/qcom/sdm845-db845c.dts210
-rw-r--r--sys/gnu/dts/arm64/qcom/sdm845-mtp.dts2
-rw-r--r--sys/gnu/dts/arm64/qcom/sdm845.dtsi106
-rw-r--r--sys/gnu/dts/arm64/qcom/sdm850-lenovo-yoga-c630.dts13
-rw-r--r--sys/gnu/dts/arm64/qcom/sm8250-mtp.dts351
-rw-r--r--sys/gnu/dts/arm64/qcom/sm8250.dtsi126
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1293-ds418j.dts6
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1293.dtsi12
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1295-mele-v9.dts6
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1295-probox2-ava.dts6
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1295-xnano-x5.dts30
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1295-zidoo-x9s.dts4
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1295.dtsi21
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1296-ds418.dts4
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1296.dtsi8
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd129x.dtsi221
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1395-bpi-m4.dts30
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1395-lionskin.dts36
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1395.dtsi65
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd139x.dtsi193
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1619-mjolnir.dts44
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd1619.dtsi12
-rw-r--r--sys/gnu/dts/arm64/realtek/rtd16xx.dtsi229
-rw-r--r--sys/gnu/dts/arm64/renesas/aistarvision-mipi-adapter-2.1.dtsi94
-rw-r--r--sys/gnu/dts/arm64/renesas/r8a774a1.dtsi18
-rw-r--r--sys/gnu/dts/arm64/renesas/r8a774b1.dtsi18
-rw-r--r--sys/gnu/dts/arm64/renesas/r8a774c0-ek874-mipi-2.1.dts72
-rw-r--r--sys/gnu/dts/arm64/renesas/r8a774c0.dtsi18
-rw-r--r--sys/gnu/dts/arm64/renesas/r8a77950.dtsi14
-rw-r--r--sys/gnu/dts/arm64/renesas/r8a77951.dtsi34
-rw-r--r--sys/gnu/dts/arm64/renesas/r8a77960.dtsi22
-rw-r--r--sys/gnu/dts/arm64/renesas/r8a77961.dtsi403
-rw-r--r--sys/gnu/dts/arm64/renesas/r8a77965.dtsi20
-rw-r--r--sys/gnu/dts/arm64/renesas/r8a77970.dtsi10
-rw-r--r--sys/gnu/dts/arm64/renesas/r8a77980.dtsi16
-rw-r--r--sys/gnu/dts/arm64/renesas/r8a77990.dtsi20
-rw-r--r--sys/gnu/dts/arm64/renesas/r8a77995.dtsi20
-rw-r--r--sys/gnu/dts/arm64/rockchip/px30.dtsi3
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3308-roc-cc.dts7
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3326-odroid-go2.dts557
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3326.dtsi15
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3328-a1.dts2
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3328-roc-cc.dts4
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3328-rock64.dts4
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3328.dtsi2
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3368-geekbox.dts4
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3368-orion-r68-meta.dts4
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3368-r88.dts2
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3399-ficus.dts29
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3399-firefly.dts10
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3399-hugsun-x99.dts7
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3399-nanopi4.dtsi4
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3399-orangepi.dts4
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3399-pinebook-pro.dts11
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3399-rock960.dts29
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dtsi27
-rw-r--r--sys/gnu/dts/arm64/rockchip/rk3399.dtsi34
-rw-r--r--sys/gnu/dts/arm64/socionext/uniphier-ld11-global.dts1
-rw-r--r--sys/gnu/dts/arm64/socionext/uniphier-ld11-ref.dts1
-rw-r--r--sys/gnu/dts/arm64/socionext/uniphier-ld11.dtsi12
-rw-r--r--sys/gnu/dts/arm64/socionext/uniphier-ld20-akebi96.dts189
-rw-r--r--sys/gnu/dts/arm64/socionext/uniphier-ld20-global.dts1
-rw-r--r--sys/gnu/dts/arm64/socionext/uniphier-ld20-ref.dts1
-rw-r--r--sys/gnu/dts/arm64/socionext/uniphier-ld20.dtsi16
-rw-r--r--sys/gnu/dts/arm64/socionext/uniphier-pxs3-ref.dts18
-rw-r--r--sys/gnu/dts/arm64/socionext/uniphier-pxs3.dtsi12
-rw-r--r--sys/gnu/dts/arm64/sprd/sc9863a.dtsi66
-rw-r--r--sys/gnu/dts/arm64/sprd/sharkl3.dtsi164
-rw-r--r--sys/gnu/dts/arm64/ti/k3-am65-main.dtsi126
-rw-r--r--sys/gnu/dts/arm64/ti/k3-am65-mcu.dtsi21
-rw-r--r--sys/gnu/dts/arm64/ti/k3-am65-wakeup.dtsi11
-rw-r--r--sys/gnu/dts/arm64/ti/k3-am654-industrial-thermal.dtsi45
-rw-r--r--sys/gnu/dts/arm64/ti/k3-j721e-common-proc-board.dts20
-rw-r--r--sys/gnu/dts/arm64/ti/k3-j721e-main.dtsi87
-rw-r--r--sys/gnu/dts/arm64/ti/k3-j721e-mcu-wakeup.dtsi11
-rw-r--r--sys/gnu/dts/arm64/xilinx/zynqmp.dtsi6
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/agilex-clock.h70
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/at91.h4
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/bt1-ccu.h48
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/imx7ulp-clock.h5
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/imx8mp-clock.h90
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/intel,lgm-clk.h165
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/marvell,mmp2-audio.h10
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/marvell,mmp2.h3
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/meson8b-clkc.h1
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/mt6765-clk.h313
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8939.h206
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8998.h1
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sc7180.h1
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/r8a7742-cpg-mssr.h42
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/sprd,sc9863a-clk.h5
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/tegra114-car.h14
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/tegra124-car-common.h14
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/tegra20-car.h2
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/tegra210-car.h20
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/tegra30-car.h14
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/x1000-cgu.h64
-rw-r--r--sys/gnu/dts/include/dt-bindings/clock/x1830-cgu.h55
-rw-r--r--sys/gnu/dts/include/dt-bindings/firmware/imx/rsrc.h84
-rw-r--r--sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h3
-rw-r--r--sys/gnu/dts/include/dt-bindings/interconnect/imx8mm.h50
-rw-r--r--sys/gnu/dts/include/dt-bindings/interconnect/imx8mn.h41
-rw-r--r--sys/gnu/dts/include/dt-bindings/interconnect/imx8mq.h48
-rw-r--r--sys/gnu/dts/include/dt-bindings/mailbox/qcom-ipcc.h33
-rw-r--r--sys/gnu/dts/include/dt-bindings/phy/phy.h1
-rw-r--r--sys/gnu/dts/include/dt-bindings/pinctrl/pads-imx8dxl.h639
-rw-r--r--sys/gnu/dts/include/dt-bindings/pinctrl/rockchip.h11
-rw-r--r--sys/gnu/dts/include/dt-bindings/power/marvell,mmp2.h11
-rw-r--r--sys/gnu/dts/include/dt-bindings/power/meson-gxbb-power.h13
-rw-r--r--sys/gnu/dts/include/dt-bindings/power/meson8-power.h13
-rw-r--r--sys/gnu/dts/include/dt-bindings/power/qcom-rpmpd.h12
-rw-r--r--sys/gnu/dts/include/dt-bindings/power/r8a7742-sysc.h29
-rw-r--r--sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-gxbb-reset.h2
-rw-r--r--sys/gnu/dts/include/dt-bindings/reset/bt1-ccu.h25
-rw-r--r--sys/gnu/dts/include/dt-bindings/reset/imx8mp-reset.h50
-rw-r--r--sys/gnu/dts/include/dt-bindings/reset/imx8mq-reset.h56
-rw-r--r--sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8939.h110
-rw-r--r--sys/gnu/dts/include/dt-bindings/reset/realtek,rtd1195.h74
-rw-r--r--sys/gnu/dts/include/dt-bindings/reset/realtek,rtd1295.h3
-rw-r--r--sys/i386/include/iommu.h6
-rw-r--r--sys/kern/kern_conf.c30
-rw-r--r--sys/kern/kern_malloc.c34
-rw-r--r--sys/kern/kern_mbuf.c1
-rw-r--r--sys/kern/kern_mutex.c29
-rw-r--r--sys/kern/kern_proc.c4
-rw-r--r--sys/kern/kern_prot.c4
-rw-r--r--sys/kern/kern_rmlock.c4
-rw-r--r--sys/kern/kern_thread.c1
-rw-r--r--sys/kern/subr_acl_nfs4.c8
-rw-r--r--sys/kern/subr_acl_posix1e.c14
-rw-r--r--sys/kern/subr_bus.c38
-rw-r--r--sys/kern/subr_epoch.c71
-rw-r--r--sys/kern/subr_smp.c2
-rw-r--r--sys/kern/sys_pipe.c21
-rw-r--r--sys/kern/tty.c4
-rw-r--r--sys/kern/uipc_mbuf.c7
-rw-r--r--sys/kern/uipc_mqueue.c8
-rw-r--r--sys/kern/uipc_sem.c4
-rw-r--r--sys/kern/uipc_shm.c6
-rw-r--r--sys/kern/uipc_usrreq.c2
-rw-r--r--sys/kern/vfs_bio.c8
-rw-r--r--sys/kern/vfs_cache.c639
-rw-r--r--sys/kern/vfs_default.c113
-rw-r--r--sys/kern/vfs_hash.c2
-rw-r--r--sys/kern/vfs_lookup.c61
-rw-r--r--sys/kern/vfs_subr.c359
-rw-r--r--sys/kern/vfs_syscalls.c17
-rw-r--r--sys/kern/vfs_vnops.c113
-rw-r--r--sys/kern/vnode_if.src12
-rw-r--r--sys/modules/cpsw/Makefile2
-rw-r--r--sys/modules/linux/Makefile4
-rw-r--r--sys/modules/linux64/Makefile2
-rw-r--r--sys/modules/usb/Makefile1
-rw-r--r--sys/modules/usb/cp2112/Makefile (renamed from tools/debugscripts/kgdb)50
-rw-r--r--sys/net/if.c5
-rw-r--r--sys/net/iflib.c150
-rw-r--r--sys/net/iflib.h4
-rw-r--r--sys/net/route.c6
-rw-r--r--sys/net/route/route_ctl.c28
-rw-r--r--sys/net/route/route_ctl.h2
-rw-r--r--sys/net/route/route_var.h6
-rw-r--r--sys/net80211/ieee80211_ioctl.c7
-rw-r--r--sys/net80211/ieee80211_ioctl.h3
-rw-r--r--sys/netinet/in.c7
-rw-r--r--sys/netinet/in_mcast.c25
-rw-r--r--sys/netinet/in_var.h1
-rw-r--r--sys/netinet/tcp_syncache.c51
-rw-r--r--sys/netinet/tcp_syncache.h4
-rw-r--r--sys/netinet/udp_usrreq.c67
-rw-r--r--sys/netinet6/in6_ifattach.c2
-rw-r--r--sys/netinet6/in6_mcast.c34
-rw-r--r--sys/netinet6/in6_proto.c2
-rw-r--r--sys/netinet6/in6_rmx.c11
-rw-r--r--sys/netinet6/in6_var.h2
-rw-r--r--sys/netinet6/udp6_usrreq.c2
-rw-r--r--sys/netpfil/ipfw/ip_fw2.c18
-rw-r--r--sys/netpfil/ipfw/nat64/nat64_translate.c12
-rw-r--r--sys/powerpc/aim/mmu_radix.c4
-rw-r--r--sys/riscv/conf/GENERIC1
-rw-r--r--sys/riscv/include/ieeefp.h1
-rw-r--r--sys/riscv/include/profile.h2
-rw-r--r--sys/rpc/clnt.h2
-rw-r--r--sys/security/audit/audit_arg.c2
-rw-r--r--sys/security/mac/mac_framework.c3
-rw-r--r--sys/security/mac/mac_framework.h59
-rw-r--r--sys/security/mac/mac_vfs.c2
-rw-r--r--sys/sys/caprights.h48
-rw-r--r--sys/sys/capsicum.h45
-rw-r--r--sys/sys/malloc.h1
-rw-r--r--sys/sys/mbuf.h1
-rw-r--r--sys/sys/mount.h25
-rw-r--r--sys/sys/mutex.h1
-rw-r--r--sys/sys/namei.h77
-rw-r--r--sys/sys/param.h2
-rw-r--r--sys/sys/pmc.h3
-rw-r--r--sys/sys/protosw.h1
-rw-r--r--sys/sys/smp.h2
-rw-r--r--sys/sys/un.h2
-rw-r--r--sys/sys/vnode.h52
-rw-r--r--sys/tools/makesyscalls.lua27
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c2
-rw-r--r--sys/ufs/ffs/ffs_vnops.c14
-rw-r--r--sys/ufs/ufs/ufs_vnops.c72
-rw-r--r--sys/vm/uma.h10
-rw-r--r--sys/vm/uma_core.c29
-rw-r--r--sys/vm/vm_map.c1
-rw-r--r--sys/vm/vm_meter.c3
-rw-r--r--sys/vm/vm_page.c21
-rw-r--r--sys/vm/vm_page.h36
-rw-r--r--sys/vm/vm_pageout.c221
-rw-r--r--sys/vm/vm_pagequeue.h9
-rw-r--r--sys/vm/vnode_pager.c2
-rw-r--r--sys/x86/include/iommu.h13
-rw-r--r--sys/x86/iommu/intel_ctx.c108
-rw-r--r--sys/x86/iommu/intel_dmar.h21
-rw-r--r--sys/x86/iommu/intel_drv.c7
-rw-r--r--sys/x86/iommu/intel_idpgtbl.c16
-rw-r--r--sys/x86/iommu/intel_quirks.c2
-rw-r--r--sys/x86/x86/busdma_bounce.c8
-rw-r--r--tests/sys/fs/fusefs/forget.cc3
-rw-r--r--tests/sys/net/routing/rtsock_common.h4
-rw-r--r--tools/build/Makefile33
-rw-r--r--tools/lua/template.lua652
-rw-r--r--tools/uma/smrstress/smrstress.c2
-rw-r--r--usr.bin/calendar/calendars/calendar.history1
-rw-r--r--usr.bin/calendar/calendars/de_DE.ISO8859-1/calendar.geschichte2
-rw-r--r--usr.bin/chpass/Makefile4
-rw-r--r--usr.bin/fortune/fortune/fortune.c9
-rw-r--r--usr.bin/fortune/strfile/strfile.c18
-rw-r--r--usr.bin/gh-bc/Makefile3
-rw-r--r--usr.bin/gh-bc/tests/Makefile67
-rw-r--r--usr.bin/grep/Makefile8
-rw-r--r--usr.bin/grep/grep.110
-rw-r--r--usr.bin/grep/grep.c2
-rw-r--r--usr.bin/script/script.c43
-rw-r--r--usr.bin/tput/tput.163
-rw-r--r--usr.bin/uname/uname.15
-rw-r--r--usr.bin/vtfontcvt/vtfontcvt.86
-rw-r--r--usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c8
-rw-r--r--usr.sbin/crunch/crunchgen/crunchgen.c36
-rw-r--r--usr.sbin/ctladm/ctladm.88
-rw-r--r--usr.sbin/iovctl/iovctl.conf.52
-rw-r--r--usr.sbin/makefs/msdos/msdosfs_vnops.c1
-rw-r--r--usr.sbin/nmtree/Makefile6
-rw-r--r--usr.sbin/pmcstat/pmcpl_callgraph.c42
-rw-r--r--usr.sbin/pmcstat/pmcstat.815
-rw-r--r--usr.sbin/pmcstat/pmcstat.c13
-rw-r--r--usr.sbin/pmcstat/pmcstat_log.c12
-rw-r--r--usr.sbin/pwd_mkdb/Makefile3
-rw-r--r--usr.sbin/pwd_mkdb/bootstrap/pwd.h66
-rw-r--r--usr.sbin/tzsetup/Makefile2
-rw-r--r--usr.sbin/yp_mkdb/yp_mkdb.c4
1022 files changed, 39422 insertions, 10129 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index b604465c272a..12c99e02a082 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -180,7 +180,7 @@ MK_SYSTEM_LINKER= no
.if defined(CROSS_TOOLCHAIN_PREFIX)
CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
.endif
-XBINUTILS= AS AR LD NM OBJCOPY RANLIB SIZE STRINGS
+XBINUTILS= AS AR LD NM OBJCOPY RANLIB SIZE STRINGS STRIPBIN
.for BINUTIL in ${XBINUTILS}
.if defined(CROSS_BINUTILS_PREFIX) && \
exists(${CROSS_BINUTILS_PREFIX}/${${BINUTIL}})
@@ -554,6 +554,20 @@ PKG_VERSION= ${_REVISION}${EXTRA_REVISION}
.endif
.endif # !defined(PKG_VERSION)
+.if !defined(PKG_TIMESTAMP)
+TIMEEPOCHNOW= %s
+SOURCE_DATE_EPOCH= ${TIMEEPOCHNOW:gmtime}
+.else
+SOURCE_DATE_EPOCH= ${PKG_TIMESTAMP}
+.endif
+
+PKG_NAME_PREFIX?= FreeBSD
+PKG_MAINTAINER?= re@FreeBSD.org
+PKG_WWW?= https://www.FreeBSD.org
+.export PKG_NAME_PREFIX
+.export PKG_MAINTAINER
+.export PKG_WWW
+
.if !defined(_MKSHOWCONFIG)
_CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \
-m ${.CURDIR}/share/mk MK_AUTO_OBJ=no -V CPUTYPE
@@ -750,7 +764,7 @@ CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCXXFLAGS} ${XCFLAGS}" \
AS="${XAS}" AR="${XAR}" LD="${XLD}" LLVM_LINK="${XLLVM_LINK}" \
NM=${XNM} OBJCOPY="${XOBJCOPY}" \
RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \
- SIZE="${XSIZE}"
+ SIZE="${XSIZE}" STRIPBIN="${XSTRIPBIN}"
.if defined(CROSS_BINUTILS_PREFIX) && exists(${CROSS_BINUTILS_PREFIX})
# In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a
@@ -1791,6 +1805,7 @@ KSTAGEDIR?= ${OBJTOP}/kernelstage
REPODIR?= ${OBJROOT}repo
PKG_FORMAT?= txz
PKGSIGNKEY?= # empty
+PKG_OUTPUT_DIR?= ${PKG_VERSION}
.ORDER: stage-packages create-packages
.ORDER: create-packages create-world-packages
@@ -1840,6 +1855,7 @@ create-packages-kernel: _pkgbootstrap _repodir .PHONY
${MAKE} -f Makefile.inc1 \
DESTDIR=${KSTAGEDIR} \
PKG_VERSION=${PKG_VERSION} DISTDIR=kernel \
+ SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
create-kernel-packages
create-packages: .PHONY create-packages-world create-packages-kernel
@@ -1856,6 +1872,7 @@ create-world-packages: _pkgbootstrap .PHONY
done > ${WSTAGEDIR}/packages.mk
${_+_}@cd ${.CURDIR}; \
${MAKE} -f Makefile.inc1 create-world-packages-jobs \
+ SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
.MAKE.JOB.PREFIX=
.if make(create-world-packages-jobs)
@@ -1883,7 +1900,7 @@ create-world-package-${pkgname}: .PHONY
create -f ${PKG_FORMAT} -M ${WSTAGEDIR}/${pkgname}.ucl \
-p ${WSTAGEDIR}/${pkgname}.plist \
-r ${WSTAGEDIR} \
- -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION}
+ -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
.endfor
_default_flavor= -default
@@ -1905,6 +1922,9 @@ create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap
-e "s/%COMMENT%/FreeBSD ${INSTALLKERNEL} kernel ${flavor}/" \
-e "s/%DESC%/FreeBSD ${INSTALLKERNEL} kernel ${flavor}/" \
-e "s/ %VCS_REVISION%/${VCS_REVISION}/" \
+ -e "s/%PKG_NAME_PREFIX%/${PKG_NAME_PREFIX}/" \
+ -e "s/%PKG_MAINTAINER%/${PKG_MAINTAINER}/" \
+ -e "s|%PKG_WWW%|${PKG_WWW}|" \
${SRCDIR}/release/packages/kernel.ucl \
> ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \
awk -F\" ' \
@@ -1916,7 +1936,7 @@ create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap
-M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \
-p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \
-r ${KSTAGEDIR}/${DISTDIR} \
- -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION}
+ -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
. endfor
.endif
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
@@ -1938,6 +1958,9 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kerne
-e "s/%COMMENT%/FreeBSD ${_kernel} kernel ${flavor}/" \
-e "s/%DESC%/FreeBSD ${_kernel} kernel ${flavor}/" \
-e "s/ %VCS_REVISION%/${VCS_REVISION}/" \
+ -e "s/%PKG_NAME_PREFIX%/${PKG_NAME_PREFIX}/" \
+ -e "s/%PKG_MAINTAINER%/${PKG_MAINTAINER}/" \
+ -e "s|%PKG_WWW%|${PKG_WWW}|" \
${SRCDIR}/release/packages/kernel.ucl \
> ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \
awk -F\" ' \
@@ -1949,7 +1972,7 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kerne
-M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \
-p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \
-r ${KSTAGEDIR}/kernel.${_kernel} \
- -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION}
+ -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
. endfor
. endif
. endfor
@@ -1965,7 +1988,7 @@ sign-packages: _pkgbootstrap .PHONY
${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \
${PKGSIGNKEY} ; \
cd ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI); \
- ln -s ${PKG_VERSION} latest
+ ln -s ${PKG_OUTPUT_DIR} latest
#
#
@@ -2178,9 +2201,6 @@ _yacc= usr.bin/yacc
_gensnmptree= usr.sbin/bsnmpd/gensnmptree
.endif
-.if ${MK_LOCALES} != "no"
-_localedef= usr.bin/localedef
-.endif
# We need to build tblgen when we're building clang or lld, either as
# bootstrap tools, or as the part of the normal build.
@@ -2229,9 +2249,13 @@ ${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd
_basic_bootstrap_tools_multilink=usr.bin/grep grep,egrep,fgrep
_basic_bootstrap_tools_multilink+=bin/test test,[
# bootstrap tools needed by buildworld:
-_basic_bootstrap_tools=usr.bin/awk usr.bin/cut bin/expr usr.bin/gencat \
+_basic_bootstrap_tools=usr.bin/cut bin/expr usr.bin/gencat \
usr.bin/join usr.bin/mktemp bin/rmdir usr.bin/sed usr.bin/sort \
usr.bin/truncate usr.bin/tsort
+# Some build scripts use nawk instead of awk (this happens at least in
+# cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh) so we need both awk
+# and nawk in ${WORLDTMP}/legacy/bin.
+_basic_bootstrap_tools_multilink+=usr.bin/awk awk,nawk
# file2c is required for building usr.sbin/config:
_basic_bootstrap_tools+=usr.bin/file2c
# uuencode/uudecode required for share/tabset
@@ -2295,13 +2319,12 @@ ${_bt}-links: .PHONY
.for _tool in ${_bootstrap_tools_links}
${_bt}-link-${_tool}: .PHONY .MAKE
- @if [ ! -e "${WORLDTMP}/legacy/bin/${_tool}" ]; then \
- source_path=`which ${_tool}`; \
- if [ ! -e "$${source_path}" ] ; then \
- echo "Cannot find host tool '${_tool}'"; false; \
- fi; \
- ln -sfnv "$${source_path}" "${WORLDTMP}/legacy/bin/${_tool}"; \
- fi
+ @rm -f "${WORLDTMP}/legacy/bin/${_tool}"; \
+ source_path=`which ${_tool}`; \
+ if [ ! -e "$${source_path}" ] ; then \
+ echo "Cannot find host tool '${_tool}'"; false; \
+ fi; \
+ cp -f "$${source_path}" "${WORLDTMP}/legacy/bin/${_tool}"
${_bt}-links: ${_bt}-link-${_tool}
.endfor
@@ -2750,6 +2773,10 @@ _prebuild_libs+= gnu/lib/libdialog
gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L
.endif
+.if ${MK_GOOGLETEST} != "no"
+_prebuild_libs+= lib/libregex
+.endif
+
.if ${MK_LIBCPLUSPLUS} != "no"
_prebuild_libs+= lib/libc++
.endif
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index 6db60ca13866..160de5f37f4e 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -36,6 +36,10 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20200803: remove free_domain(9) and uma_zfree_domain(9)
+OLD_FILES+=usr/share/man/man9/free_domain.9.gz
+OLD_FILES+=usr/share/man/man9/uma_zfree_domain.9.gz
+
# 20200729: remove long expired serial drivers
OLD_FILES+=usr/share/man/man4/cy.4.gz
OLD_FILES+=usr/share/man/man4/rc.4.gz
diff --git a/RELNOTES b/RELNOTES
index d34c504ca760..d610258b40a8 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -27,6 +27,13 @@ r363180:
r363084:
nc(1) now implements SCTP mode, enabled by specifying the --sctp option.
+r362681:
+ A new implementation of bc and dc has been imported. It offers
+ better standards compliance, performance, localization and comes
+ with extensive test cases that are optionally installed.
+ Use WITHOUT_GH_BC=yes to build and install the world with the
+ previous version instead of the new one, if required.
+
r362158, r362163:
struct export_args has changed so that the "user" specified for
the -maproot and -mapall exports(5) options may be in more than
diff --git a/UPDATING b/UPDATING
index 9cd27c5f4f37..5f0377ebe822 100644
--- a/UPDATING
+++ b/UPDATING
@@ -26,6 +26,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
+20200810:
+ r364092 modified the internal ABI used between the kernel NFS
+ modules. As such, all of these modules need to be rebuilt
+ from sources, so a version bump was done.
+
+20200807:
+ Makefile.inc has been updated to work around the issue documented in
+ 20200729. It was a case where the optimization of using symbolic links
+ to point to binaries created a situation where we'd run new binaries
+ with old libraries starting midway through the installworld process.
+
20200729:
r363679 has redefined some undefined behavior in regcomp(3); notably,
extraneous escapes of most ordinary characters will no longer be
diff --git a/cddl/contrib/opensolaris/cmd/zinject/translate.c b/cddl/contrib/opensolaris/cmd/zinject/translate.c
index af25d3c3c17d..99a3d0ca4ff3 100644
--- a/cddl/contrib/opensolaris/cmd/zinject/translate.c
+++ b/cddl/contrib/opensolaris/cmd/zinject/translate.c
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2020 by Delphix. All rights reserved.
*/
#include <libzfs.h>
@@ -484,7 +484,7 @@ translate_device(const char *pool, const char *device, err_type_t label_type,
record->zi_end = record->zi_start + VDEV_PAD_SIZE - 1;
break;
case TYPE_LABEL_PAD2:
- record->zi_start = offsetof(vdev_label_t, vl_pad2);
+ record->zi_start = offsetof(vdev_label_t, vl_be);
record->zi_end = record->zi_start + VDEV_PAD_SIZE - 1;
break;
}
diff --git a/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c b/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
index c35b1a526d21..f48c09cce0e2 100644
--- a/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
+++ b/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
@@ -27,6 +27,7 @@
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/types.h>
+#include <sys/endian.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/zmod.h>
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrno.sh b/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrno.sh
index 50b7f1c1b908..de4b86270efa 100755
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrno.sh
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrno.sh
@@ -24,15 +24,15 @@
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
+set -e
-echo "\
-/*\n\
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.\n\
- * Use is subject to license terms.\n\
- */\n\
-\n\
-#pragma ident\t\"%Z%%M%\t%I%\t%E% SMI\"\n"
+printf "%s" "
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+"
pattern='^#define[ ]\(E[A-Z0-9]*\)[ ]*\([A-Z0-9]*\).*$'
replace='inline int \1 = \2;@#pragma D binding "1.0" \1'
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrtags.sh b/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrtags.sh
index d5651ff727fc..11b327cbff17 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrtags.sh
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/mkerrtags.sh
@@ -24,36 +24,34 @@
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-
-BSDECHO=-e
-
-echo ${BSDECHO} "\
-/*\n\
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.\n\
- * Use is subject to license terms.\n\
- */\n\
-\n\
-#pragma ident\t\"%Z%%M%\t%I%\t%E% SMI\"\n\
-\n\
+set -e
+
+printf "%s" "
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
#include <dt_errtags.h>
-\n\
-static const char *const _dt_errtags[] = {"
+
+static const char *const _dt_errtags[] = {
+"
pattern='^ \(D_[A-Z0-9_]*\),*'
replace=' "\1",'
sed -n "s/$pattern/$replace/p" || exit 1
-echo ${BSDECHO} "\
-};\n\
-\n\
-static const int _dt_ntag = sizeof (_dt_errtags) / sizeof (_dt_errtags[0]);\n\
-\n\
+printf "%s" "
+};
+
+static const int _dt_ntag = sizeof (_dt_errtags) / sizeof (_dt_errtags[0]);
+
const char *
dt_errtag(dt_errtag_t tag)
{
return (_dt_errtags[(tag > 0 && tag < _dt_ntag) ? tag : 0]);
-}"
+}
+"
exit 0
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh b/cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh
index 2fdc2fa636d5..c7c28e75364e 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh
@@ -24,32 +24,30 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
+set -e
-BSDECHO=-e
+printf "%s" "
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <dtrace.h>
-echo ${BSDECHO} "\
-/*\n\
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.\n\
- * Use is subject to license terms.\n\
- */\n\
-\n\
-#pragma ident\t\"%Z%%M%\t%I%\t%E% SMI\"\n\
-\n\
-#include <dtrace.h>\n\
-\n\
/*ARGSUSED*/
-const char *\n\
-dtrace_subrstr(dtrace_hdl_t *dtp, int subr)\n\
-{\n\
- switch (subr) {"
+const char *
+dtrace_subrstr(dtrace_hdl_t *dtp, int subr)
+{
+ switch (subr) {
+"
nawk '
/^#define[ ]*DIF_SUBR_/ && $2 != "DIF_SUBR_MAX" {
printf("\tcase %s: return (\"%s\");\n", $2, tolower(substr($2, 10)));
}'
-echo ${BSDECHO} "\
- default: return (\"unknown\");\n\
- }\n\
-}"
+printf "%s" "
+ default: return (\"unknown\");
+ }
+}
+"
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/mksignal.sh b/cddl/contrib/opensolaris/lib/libdtrace/common/mksignal.sh
index 1bffa6468c2b..2bd5ec92b43e 100755
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/mksignal.sh
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/mksignal.sh
@@ -24,15 +24,15 @@
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
+set -e
-echo "\
-/*\n\
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.\n\
- * Use is subject to license terms.\n\
- */\n\
-\n\
-#pragma ident\t\"%Z%%M%\t%I%\t%E% SMI\"\n"
+printf "%s" "
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+"
pattern='^#define[ ]*_*\(SIG[A-Z0-9]*\)[ ]\{1,\}\([A-Z0-9]*\).*$'
replace='inline int \1 = \2;@#pragma D binding "1.0" \1'
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
index 469d61f5e773..1899e318d53e 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
@@ -837,6 +837,8 @@ extern int zpool_in_use(libzfs_handle_t *, int, pool_state_t *, char **,
extern int zpool_read_label(int, nvlist_t **);
extern int zpool_read_all_labels(int, nvlist_t **);
extern int zpool_clear_label(int);
+extern int zpool_set_bootenv(zpool_handle_t *, const char *);
+extern int zpool_get_bootenv(zpool_handle_t *, char *, size_t, off_t);
/* is this zvol valid for use as a dump device? */
extern int zvol_check_dump_config(char *);
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
index 39b6c35f6fbd..434f77e27da9 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2017 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2020 by Delphix. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright 2016 Nexenta Systems, Inc.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
@@ -395,7 +395,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
* Assuming bootfs is a valid dataset name.
*/
static boolean_t
-bootfs_name_valid(const char *pool, char *bootfs)
+bootfs_name_valid(const char *pool, const char *bootfs)
{
int len = strlen(pool);
@@ -4233,6 +4233,42 @@ zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj,
free(mntpnt);
}
+int
+zpool_set_bootenv(zpool_handle_t *zhp, const char *envmap)
+{
+ int error = lzc_set_bootenv(zhp->zpool_name, envmap);
+ if (error != 0) {
+ (void) zpool_standard_error_fmt(zhp->zpool_hdl, error,
+ dgettext(TEXT_DOMAIN,
+ "error setting bootenv in pool '%s'"), zhp->zpool_name);
+ }
+
+ return (error);
+}
+
+int
+zpool_get_bootenv(zpool_handle_t *zhp, char *outbuf, size_t size, off_t offset)
+{
+ nvlist_t *nvl;
+ int error = lzc_get_bootenv(zhp->zpool_name, &nvl);;
+ if (error != 0) {
+ (void) zpool_standard_error_fmt(zhp->zpool_hdl, error,
+ dgettext(TEXT_DOMAIN,
+ "error getting bootenv in pool '%s'"), zhp->zpool_name);
+ return (-1);
+ }
+ char *envmap = fnvlist_lookup_string(nvl, "envmap");
+ if (offset >= strlen(envmap)) {
+ fnvlist_free(nvl);
+ return (0);
+ }
+
+ strlcpy(outbuf, envmap + offset, size);
+ int bytes = MIN(strlen(envmap + offset), size);
+ fnvlist_free(nvl);
+ return (bytes);
+}
+
#ifdef illumos
/*
* Read the EFI label from the config, if a label does not exist then
diff --git a/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c b/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
index f4ed52a29232..2a6b5cc5927c 100644
--- a/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
+++ b/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2012, 2018 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2020 by Delphix. All rights reserved.
* Copyright (c) 2013 Steven Hartland. All rights reserved.
* Copyright (c) 2014 Integros [integros.com]
* Copyright 2017 RackTop Systems.
@@ -1210,3 +1210,25 @@ lzc_initialize(const char *poolname, pool_initialize_func_t cmd_type,
return (error);
}
+
+/*
+ * Set the bootenv contents for the given pool.
+ */
+int
+lzc_set_bootenv(const char *pool, const char *env)
+{
+ nvlist_t *args = fnvlist_alloc();
+ fnvlist_add_string(args, "envmap", env);
+ int error = lzc_ioctl(ZFS_IOC_SET_BOOTENV, pool, args, NULL);
+ fnvlist_free(args);
+ return (error);
+}
+
+/*
+ * Get the contents of the bootenv of the given pool.
+ */
+int
+lzc_get_bootenv(const char *pool, nvlist_t **outnvl)
+{
+ return (lzc_ioctl(ZFS_IOC_GET_BOOTENV, pool, NULL, outnvl));
+}
diff --git a/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h b/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
index 97d7ce81d8ab..76c4fa1bf6b4 100644
--- a/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
+++ b/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2020 by Delphix. All rights reserved.
* Copyright (c) 2013 by Martin Matuska <mm@FreeBSD.org>. All rights reserved.
* Copyright 2017 RackTop Systems.
* Copyright (c) 2017 Datto Inc.
@@ -105,6 +105,8 @@ int lzc_channel_program_nosync(const char *, const char *, uint64_t,
int lzc_pool_checkpoint(const char *);
int lzc_pool_checkpoint_discard(const char *);
+int lzc_set_bootenv(const char *, const char *);
+int lzc_get_bootenv(const char *, nvlist_t **);
#ifdef __cplusplus
}
#endif
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c b/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c
index a3d05ad20b28..ddb5f388ca98 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c
@@ -665,6 +665,7 @@ wq_init(workqueue_t *wq, int nfiles)
for (i = 0; i < nslots; i++) {
pthread_mutex_init(&wq->wq_wip[i].wip_lock, NULL);
+ pthread_cond_init(&wq->wq_wip[i].wip_cv, NULL);
wq->wq_wip[i].wip_batchid = wq->wq_next_batchid++;
}
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h b/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h
index c8d272faa419..b7da16ac3ddd 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h
@@ -38,6 +38,7 @@
#include <pthread.h>
#include <sys/ccompile.h>
+#include <sys/endian.h>
#ifdef __cplusplus
extern "C" {
@@ -65,6 +66,15 @@ extern "C" {
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#endif
+/* Sanity check for cross-build bootstrap tools */
+#if !defined(BYTE_ORDER)
+#error "Missing BYTE_ORDER defines"
+#elif !defined(_LITTLE_ENDIAN)
+#error "Missing _LITTLE_ENDIAN defines"
+#elif !defined(_BIG_ENDIAN)
+#error "Missing _BIG_ENDIAN defines"
+#endif
+
#define TRUE 1
#define FALSE 0
diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in
index 2c67e92d13de..3edc9ef16ec1 100644
--- a/contrib/bc/Makefile.in
+++ b/contrib/bc/Makefile.in
@@ -29,7 +29,7 @@
#
.POSIX:
-VERSION = 3.1.3
+VERSION = 3.1.5
SRC = %%SRC%%
OBJ = %%OBJ%%
diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md
index 64e8deb9853d..6d36f300d2b8 100644
--- a/contrib/bc/NEWS.md
+++ b/contrib/bc/NEWS.md
@@ -1,5 +1,32 @@
# News
+## 3.1.5
+
+This is a production release that fixes the Chinese locales (which caused `bc`
+to crash) and a crash caused by `bc` executing code when it should not have been
+able to.
+
+***ALL USERS SHOULD UPGRADE.***
+
+## 3.1.4
+
+This is a production release that fixes one bug, changes two behaviors, and
+removes one environment variable.
+
+The bug is like the one in the last release except it applies if files are being
+executed. I also made the fix more general.
+
+The behavior that was changed is that `bc` now exits when given `-e`, `-f`,
+`--expression` or `--file`. However, if the last one of those is `-f-` (using
+`stdin` as the file), `bc` does not exit. If `-f-` exists and is not the last of
+the `-e` and `-f` options (and equivalents), `bc` gives a fatal error and exits.
+
+Next, I removed the `BC_EXPR_EXIT` and `DC_EXPR_EXIT` environment variables
+since their use is not needed with the behavior change.
+
+Finally, I made it so `bc` does not print the header, though the `-q` and
+`--quiet` options were kept for compatibility with GNU `bc`.
+
## 3.1.3
This is a production release that fixes one minor bug: if `bc` was invoked like
diff --git a/contrib/bc/README.md b/contrib/bc/README.md
index f2165e554221..8aacb21b004c 100644
--- a/contrib/bc/README.md
+++ b/contrib/bc/README.md
@@ -262,8 +262,8 @@ Other projects based on this bc are:
toybox `bc` should be reported there.
* [FreeBSD `bc`][23]. While the `bc` in FreeBSD is kept up-to-date, it is better
- to report bugs there, and the maintainers of the package will contact me if
- necessary.
+ to [report bugs there][24], as well as [submit patches][25], and the
+ maintainers of the package will contact me if necessary.
## Language
@@ -332,4 +332,6 @@ Folders:
[20]: https://git.yzena.com/gavin/bc
[21]: https://gavinhoward.com/2020/04/i-am-moving-away-from-github/
[22]: https://www.deepl.com/translator
-[23]: https://github.com/freebsd/freebsd/tree/master/contrib/bc
+[23]: https://svnweb.freebsd.org/base/head/contrib/bc/
+[24]: https://bugs.freebsd.org/
+[25]: https://reviews.freebsd.org/
diff --git a/contrib/bc/include/bc.h b/contrib/bc/include/bc.h
index ade18c828c28..4423525bad3e 100644
--- a/contrib/bc/include/bc.h
+++ b/contrib/bc/include/bc.h
@@ -159,9 +159,6 @@ void bc_parse_expr(BcParse *p, uint8_t flags);
void bc_parse_parse(BcParse *p);
void bc_parse_expr_status(BcParse *p, uint8_t flags, BcParseNext next);
-// This is necessary to clear up for if statements at the end of files.
-void bc_parse_noElse(BcParse *p);
-
extern const char bc_sig_msg[];
extern const uchar bc_sig_msg_len;
diff --git a/contrib/bc/include/vm.h b/contrib/bc/include/vm.h
index cdadfc8bed13..f178c0390853 100644
--- a/contrib/bc/include/vm.h
+++ b/contrib/bc/include/vm.h
@@ -102,11 +102,10 @@
#define BC_FLAG_G (UINTMAX_C(1)<<4)
#endif // BC_ENABLED
-#define BC_FLAG_Q (UINTMAX_C(1)<<5)
-#define BC_FLAG_I (UINTMAX_C(1)<<6)
-#define BC_FLAG_P (UINTMAX_C(1)<<7)
-#define BC_FLAG_TTYIN (UINTMAX_C(1)<<8)
-#define BC_FLAG_TTY (UINTMAX_C(1)<<9)
+#define BC_FLAG_I (UINTMAX_C(1)<<5)
+#define BC_FLAG_P (UINTMAX_C(1)<<6)
+#define BC_FLAG_TTYIN (UINTMAX_C(1)<<7)
+#define BC_FLAG_TTY (UINTMAX_C(1)<<8)
#define BC_TTYIN (vm.flags & BC_FLAG_TTYIN)
#define BC_TTY (vm.flags & BC_FLAG_TTY)
@@ -279,12 +278,6 @@
#define BC_VM_INVALID_CATALOG ((nl_catd) -1)
-// dc does not use is_stdin.
-#if !BC_ENABLED
-#define bc_vm_process(text, is_stdin) bc_vm_process(text)
-#else // BC_ENABLED
-#endif // BC_ENABLED
-
typedef struct BcVm {
volatile sig_atomic_t status;
@@ -310,6 +303,7 @@ typedef struct BcVm {
uint16_t nchars;
uint16_t line_len;
+ bool no_exit_exprs;
bool eof;
BcBigDig maxes[BC_PROG_GLOBALS_LEN + BC_ENABLE_EXTRA_MATH];
@@ -360,7 +354,7 @@ typedef struct BcVm {
void bc_vm_info(const char* const help);
void bc_vm_boot(int argc, char *argv[], const char *env_len,
- const char* const env_args, const char* env_exp_quit);
+ const char* const env_args);
void bc_vm_shutdown(void);
void bc_vm_printf(const char *fmt, ...);
diff --git a/contrib/bc/locales/zh_CN.GB18030.msg b/contrib/bc/locales/zh_CN.GB18030.msg
index e305f0d93471..36b150b2bcbf 100644
--- a/contrib/bc/locales/zh_CN.GB18030.msg
+++ b/contrib/bc/locales/zh_CN.GB18030.msg
@@ -103,9 +103,6 @@ $set 6
3 "无法打开文件。%s"
4 "文件不是ASCII: %s"
5 "路径是一个目录:%s"
-6 "无效的命令行选项:'%c'(\"%s\")"
-
-$set 7
-
-1 "选项需要一个参数:'%c'(\"%s\")"
-2 "选项不需要参数。'%c'(\"%s\")"
+6 "无效的命令行选项:\"%s\""
+7 "选项需要一个参数:'%c'(\"%s\")"
+8 "选项不需要参数。'%c'(\"%s\")"
diff --git a/contrib/bc/locales/zh_CN.GB2312.msg b/contrib/bc/locales/zh_CN.GB2312.msg
index e305f0d93471..36b150b2bcbf 100644
--- a/contrib/bc/locales/zh_CN.GB2312.msg
+++ b/contrib/bc/locales/zh_CN.GB2312.msg
@@ -103,9 +103,6 @@ $set 6
3 "无法打开文件。%s"
4 "文件不是ASCII: %s"
5 "路径是一个目录:%s"
-6 "无效的命令行选项:'%c'(\"%s\")"
-
-$set 7
-
-1 "选项需要一个参数:'%c'(\"%s\")"
-2 "选项不需要参数。'%c'(\"%s\")"
+6 "无效的命令行选项:\"%s\""
+7 "选项需要一个参数:'%c'(\"%s\")"
+8 "选项不需要参数。'%c'(\"%s\")"
diff --git a/contrib/bc/locales/zh_CN.GBK.msg b/contrib/bc/locales/zh_CN.GBK.msg
index e305f0d93471..36b150b2bcbf 100644
--- a/contrib/bc/locales/zh_CN.GBK.msg
+++ b/contrib/bc/locales/zh_CN.GBK.msg
@@ -103,9 +103,6 @@ $set 6
3 "无法打开文件。%s"
4 "文件不是ASCII: %s"
5 "路径是一个目录:%s"
-6 "无效的命令行选项:'%c'(\"%s\")"
-
-$set 7
-
-1 "选项需要一个参数:'%c'(\"%s\")"
-2 "选项不需要参数。'%c'(\"%s\")"
+6 "无效的命令行选项:\"%s\""
+7 "选项需要一个参数:'%c'(\"%s\")"
+8 "选项不需要参数。'%c'(\"%s\")"
diff --git a/contrib/bc/locales/zh_CN.UTF-8.msg b/contrib/bc/locales/zh_CN.UTF-8.msg
index b2d0389f9fd6..4ca46786fc94 100644
--- a/contrib/bc/locales/zh_CN.UTF-8.msg
+++ b/contrib/bc/locales/zh_CN.UTF-8.msg
@@ -91,7 +91,7 @@ $set 5
5 "閫掑綊璇诲彇()璋冪敤"
6 "鍙橀噺鎴栨暟缁勫厓绱犳槸閿欒鐨勭被鍨"
7 "鍫嗘爤鐨勫厓绱犲お灏"
-8 "鍙傛暟鏁伴噺閿欒锛涢渶瑕%zu锛屾湁%zu"
+8 "鍙傛暟鏁伴噺閿欒锛氶渶瑕%zu锛屾湁%zu"
9 "鏈畾涔夌殑鍑芥暟锛%s()"
10 鈥滀笉鑳藉湪琛ㄨ揪寮忎腑浣跨敤绌哄尖
@@ -100,12 +100,9 @@ $set 6
1 "鍐呭瓨鍒嗛厤澶辫触"
2 "I/O閿欒"
-3 "鏃犳硶鎵撳紑鏂囦欢銆%s"
+3 "鏃犳硶鎵撳紑鏂囦欢锛%s"
4 "鏂囦欢涓嶆槸ASCII: %s"
5 "璺緞鏄竴涓洰褰曪細%s"
-6 "鏃犳晥鐨勫懡浠よ閫夐」锛'%c'(\"%s\")"
-
-$set 7
-
-1 "閫夐」闇瑕佷竴涓弬鏁帮細'%c'(\"%s\")"
-2 "閫夐」涓嶉渶瑕佸弬鏁般'%c'(\"%s\")"
+6 "鏃犳晥鐨勫懡浠よ閫夐」锛歕"%s\""
+7 "閫夐」闇瑕佷竴涓弬鏁帮細'%c'(\"%s\")"
+8 "閫夐」涓嶉渶瑕佸弬鏁般'%c'(\"%s\")"
diff --git a/contrib/bc/locales/zh_CN.eucCN.msg b/contrib/bc/locales/zh_CN.eucCN.msg
index e305f0d93471..36b150b2bcbf 100644
--- a/contrib/bc/locales/zh_CN.eucCN.msg
+++ b/contrib/bc/locales/zh_CN.eucCN.msg
@@ -103,9 +103,6 @@ $set 6
3 "无法打开文件。%s"
4 "文件不是ASCII: %s"
5 "路径是一个目录:%s"
-6 "无效的命令行选项:'%c'(\"%s\")"
-
-$set 7
-
-1 "选项需要一个参数:'%c'(\"%s\")"
-2 "选项不需要参数。'%c'(\"%s\")"
+6 "无效的命令行选项:\"%s\""
+7 "选项需要一个参数:'%c'(\"%s\")"
+8 "选项不需要参数。'%c'(\"%s\")"
diff --git a/contrib/bc/manuals/bc.1.md.in b/contrib/bc/manuals/bc.1.md.in
index ed2fa8beae7b..80892e742345 100644
--- a/contrib/bc/manuals/bc.1.md.in
+++ b/contrib/bc/manuals/bc.1.md.in
@@ -195,10 +195,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -229,9 +229,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -241,9 +242,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -1615,12 +1615,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/A.1 b/contrib/bc/manuals/bc/A.1
index 6421238febb6..f0966ba9d877 100644
--- a/contrib/bc/manuals/bc/A.1
+++ b/contrib/bc/manuals/bc/A.1
@@ -187,13 +187,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -231,10 +231,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -246,10 +248,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1915,14 +1916,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/A.1.md b/contrib/bc/manuals/bc/A.1.md
index 31b491a3bc70..e67c20656e23 100644
--- a/contrib/bc/manuals/bc/A.1.md
+++ b/contrib/bc/manuals/bc/A.1.md
@@ -153,10 +153,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -187,9 +187,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -199,9 +200,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -1524,12 +1524,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/E.1 b/contrib/bc/manuals/bc/E.1
index 70afc2b716f4..d85db650606c 100644
--- a/contrib/bc/manuals/bc/E.1
+++ b/contrib/bc/manuals/bc/E.1
@@ -148,13 +148,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -192,10 +192,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -207,10 +209,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1161,14 +1162,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/E.1.md b/contrib/bc/manuals/bc/E.1.md
index 4b5b95ab4d27..ab432274fa52 100644
--- a/contrib/bc/manuals/bc/E.1.md
+++ b/contrib/bc/manuals/bc/E.1.md
@@ -137,10 +137,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -171,9 +171,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -183,9 +184,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -920,12 +920,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/EH.1 b/contrib/bc/manuals/bc/EH.1
index 90708661143a..c9b196f7452a 100644
--- a/contrib/bc/manuals/bc/EH.1
+++ b/contrib/bc/manuals/bc/EH.1
@@ -145,13 +145,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -189,10 +189,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -204,10 +206,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1158,14 +1159,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/EH.1.md b/contrib/bc/manuals/bc/EH.1.md
index 60efac2dd904..32ef6e0d009f 100644
--- a/contrib/bc/manuals/bc/EH.1.md
+++ b/contrib/bc/manuals/bc/EH.1.md
@@ -134,10 +134,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -168,9 +168,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -180,9 +181,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -917,12 +917,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/EHN.1 b/contrib/bc/manuals/bc/EHN.1
index 203cc531e8b7..0117a4cd0b68 100644
--- a/contrib/bc/manuals/bc/EHN.1
+++ b/contrib/bc/manuals/bc/EHN.1
@@ -145,13 +145,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -189,10 +189,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -204,10 +206,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1158,14 +1159,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/EHN.1.md b/contrib/bc/manuals/bc/EHN.1.md
index 6264e7bf5c81..38b7cf78d76a 100644
--- a/contrib/bc/manuals/bc/EHN.1.md
+++ b/contrib/bc/manuals/bc/EHN.1.md
@@ -134,10 +134,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -168,9 +168,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -180,9 +181,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -917,12 +917,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/EHNP.1 b/contrib/bc/manuals/bc/EHNP.1
index da6a25888ce0..02b96492075d 100644
--- a/contrib/bc/manuals/bc/EHNP.1
+++ b/contrib/bc/manuals/bc/EHNP.1
@@ -140,13 +140,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -184,10 +184,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -199,10 +201,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1153,14 +1154,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/EHNP.1.md b/contrib/bc/manuals/bc/EHNP.1.md
index 917b7bc6665c..df608db015b4 100644
--- a/contrib/bc/manuals/bc/EHNP.1.md
+++ b/contrib/bc/manuals/bc/EHNP.1.md
@@ -130,10 +130,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -164,9 +164,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -176,9 +177,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -913,12 +913,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/EHP.1 b/contrib/bc/manuals/bc/EHP.1
index 3352c2ee5610..cc2920f84403 100644
--- a/contrib/bc/manuals/bc/EHP.1
+++ b/contrib/bc/manuals/bc/EHP.1
@@ -140,13 +140,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -184,10 +184,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -199,10 +201,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1153,14 +1154,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/EHP.1.md b/contrib/bc/manuals/bc/EHP.1.md
index 30e411236e46..0ce1f5209c21 100644
--- a/contrib/bc/manuals/bc/EHP.1.md
+++ b/contrib/bc/manuals/bc/EHP.1.md
@@ -130,10 +130,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -164,9 +164,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -176,9 +177,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -913,12 +913,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/EN.1 b/contrib/bc/manuals/bc/EN.1
index a662d40fdda9..d7f967d96cd5 100644
--- a/contrib/bc/manuals/bc/EN.1
+++ b/contrib/bc/manuals/bc/EN.1
@@ -148,13 +148,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -192,10 +192,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -207,10 +209,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1161,14 +1162,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/EN.1.md b/contrib/bc/manuals/bc/EN.1.md
index cefe8630da75..55ca344ddeb2 100644
--- a/contrib/bc/manuals/bc/EN.1.md
+++ b/contrib/bc/manuals/bc/EN.1.md
@@ -137,10 +137,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -171,9 +171,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -183,9 +184,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -920,12 +920,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/ENP.1 b/contrib/bc/manuals/bc/ENP.1
index b98a2a2ce2fe..736e26bd9acd 100644
--- a/contrib/bc/manuals/bc/ENP.1
+++ b/contrib/bc/manuals/bc/ENP.1
@@ -143,13 +143,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -187,10 +187,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -202,10 +204,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1156,14 +1157,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/ENP.1.md b/contrib/bc/manuals/bc/ENP.1.md
index 6d7194f31cf6..1eae3dee00d1 100644
--- a/contrib/bc/manuals/bc/ENP.1.md
+++ b/contrib/bc/manuals/bc/ENP.1.md
@@ -133,10 +133,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -167,9 +167,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -179,9 +180,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -916,12 +916,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/EP.1 b/contrib/bc/manuals/bc/EP.1
index 9c841d8bab4b..107342a54361 100644
--- a/contrib/bc/manuals/bc/EP.1
+++ b/contrib/bc/manuals/bc/EP.1
@@ -143,13 +143,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -187,10 +187,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -202,10 +204,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1156,14 +1157,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/EP.1.md b/contrib/bc/manuals/bc/EP.1.md
index 090b07f0a2d0..7e3d6aca7384 100644
--- a/contrib/bc/manuals/bc/EP.1.md
+++ b/contrib/bc/manuals/bc/EP.1.md
@@ -133,10 +133,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -167,9 +167,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -179,9 +180,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -916,12 +916,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/H.1 b/contrib/bc/manuals/bc/H.1
index 17a913896886..48ccfb55b962 100644
--- a/contrib/bc/manuals/bc/H.1
+++ b/contrib/bc/manuals/bc/H.1
@@ -182,13 +182,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -226,10 +226,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -241,10 +243,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1910,14 +1911,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/H.1.md b/contrib/bc/manuals/bc/H.1.md
index 089953f9706a..413032534554 100644
--- a/contrib/bc/manuals/bc/H.1.md
+++ b/contrib/bc/manuals/bc/H.1.md
@@ -149,10 +149,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -183,9 +183,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -195,9 +196,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -1520,12 +1520,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/HN.1 b/contrib/bc/manuals/bc/HN.1
index f275ceaffb9b..9126c9209da5 100644
--- a/contrib/bc/manuals/bc/HN.1
+++ b/contrib/bc/manuals/bc/HN.1
@@ -182,13 +182,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -226,10 +226,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -241,10 +243,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1910,14 +1911,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/HN.1.md b/contrib/bc/manuals/bc/HN.1.md
index 2e1935a12539..c9ac146efbb2 100644
--- a/contrib/bc/manuals/bc/HN.1.md
+++ b/contrib/bc/manuals/bc/HN.1.md
@@ -149,10 +149,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -183,9 +183,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -195,9 +196,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -1520,12 +1520,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/HNP.1 b/contrib/bc/manuals/bc/HNP.1
index e3583a545c74..ad09513f0528 100644
--- a/contrib/bc/manuals/bc/HNP.1
+++ b/contrib/bc/manuals/bc/HNP.1
@@ -177,13 +177,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -221,10 +221,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -236,10 +238,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1905,14 +1906,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/HNP.1.md b/contrib/bc/manuals/bc/HNP.1.md
index 7501316421d6..dc8c70ac09a9 100644
--- a/contrib/bc/manuals/bc/HNP.1.md
+++ b/contrib/bc/manuals/bc/HNP.1.md
@@ -145,10 +145,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -179,9 +179,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -191,9 +192,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -1516,12 +1516,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/HP.1 b/contrib/bc/manuals/bc/HP.1
index 9c7d0abab262..3ede3a2d5ca8 100644
--- a/contrib/bc/manuals/bc/HP.1
+++ b/contrib/bc/manuals/bc/HP.1
@@ -177,13 +177,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -221,10 +221,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -236,10 +238,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1905,14 +1906,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/HP.1.md b/contrib/bc/manuals/bc/HP.1.md
index cafab919d324..2c4053a302d0 100644
--- a/contrib/bc/manuals/bc/HP.1.md
+++ b/contrib/bc/manuals/bc/HP.1.md
@@ -145,10 +145,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -179,9 +179,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -191,9 +192,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -1516,12 +1516,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/N.1 b/contrib/bc/manuals/bc/N.1
index 83049e7c7b14..5c3e86157ba7 100644
--- a/contrib/bc/manuals/bc/N.1
+++ b/contrib/bc/manuals/bc/N.1
@@ -187,13 +187,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -231,10 +231,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -246,10 +248,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1915,14 +1916,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/N.1.md b/contrib/bc/manuals/bc/N.1.md
index 49aaf0fbbcfd..9eabb2591eab 100644
--- a/contrib/bc/manuals/bc/N.1.md
+++ b/contrib/bc/manuals/bc/N.1.md
@@ -153,10 +153,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -187,9 +187,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -199,9 +200,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -1524,12 +1524,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/NP.1 b/contrib/bc/manuals/bc/NP.1
index a50dfe2dcc17..8c2a2994a17f 100644
--- a/contrib/bc/manuals/bc/NP.1
+++ b/contrib/bc/manuals/bc/NP.1
@@ -182,13 +182,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -226,10 +226,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -241,10 +243,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1910,14 +1911,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/NP.1.md b/contrib/bc/manuals/bc/NP.1.md
index a5aa258659d2..be11fe236209 100644
--- a/contrib/bc/manuals/bc/NP.1.md
+++ b/contrib/bc/manuals/bc/NP.1.md
@@ -149,10 +149,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -183,9 +183,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -195,9 +196,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -1520,12 +1520,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/P.1 b/contrib/bc/manuals/bc/P.1
index 4f6b4ece227c..db807e440c28 100644
--- a/contrib/bc/manuals/bc/P.1
+++ b/contrib/bc/manuals/bc/P.1
@@ -182,13 +182,13 @@ This is a \f[B]non\-portable extension\f[].
.RE
.TP
.B \f[B]\-q\f[], \f[B]\-\-quiet\f[]
-Do not print copyright header.
-bc(1) will also suppress the header in non\-interactive mode.
+This option is for compatibility with the GNU
+bc(1) (https://www.gnu.org/software/bc/); it is a no\-op.
+Without this option, GNU bc(1) prints a copyright header.
+This bc(1) only prints the copyright header if one or more of the
+\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given.
.RS
.PP
-This is mostly for compatibility with the GNU
-bc(1) (https://www.gnu.org/software/bc/).
-.PP
This is a \f[B]non\-portable extension\f[].
.RE
.TP
@@ -226,10 +226,12 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -241,10 +243,9 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other bc(1) implementations, this option causes the program to
-execute the files and then exit.
-This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, bc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -1910,14 +1911,6 @@ the backslash (\f[B]\\\f[]).
The default line length is \f[B]70\f[].
.RS
.RE
-.TP
-.B \f[B]BC_EXPR_EXIT\f[]
-If this variable exists (no matter the contents), bc(1) will exit
-immediately after executing expressions and files given by the
-\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any
-equivalents).
-.RS
-.RE
.SH EXIT STATUS
.PP
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/bc/P.1.md b/contrib/bc/manuals/bc/P.1.md
index 1f7379ebfe41..1058a91aa6d2 100644
--- a/contrib/bc/manuals/bc/P.1.md
+++ b/contrib/bc/manuals/bc/P.1.md
@@ -149,10 +149,10 @@ The following are the options that bc(1) accepts.
**-q**, **--quiet**
-: Do not print copyright header. bc(1) will also suppress the header in
- non-interactive mode.
-
- This is mostly for compatibility with the [GNU bc(1)][2].
+: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op.
+ Without this option, GNU bc(1) prints a copyright header. This bc(1) only
+ prints the copyright header if one or more of the **-v**, **-V**, or
+ **--version** options are given.
This is a **non-portable extension**.
@@ -183,9 +183,10 @@ The following are the options that bc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other bc(1) implementations, this option causes the program to execute
- the expressions and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
@@ -195,9 +196,8 @@ The following are the options that bc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other bc(1) implementations, this option causes the program to execute
- the files and then exit. This bc(1) does not, unless the
- **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, bc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -1520,12 +1520,6 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
-**BC_EXPR_EXIT**
-
-: If this variable exists (no matter the contents), bc(1) will exit
- immediately after executing expressions and files given by the **-e** and/or
- **-f** command-line options (and any equivalents).
-
# EXIT STATUS
bc(1) returns the following exit statuses:
diff --git a/contrib/bc/manuals/dc.1.md.in b/contrib/bc/manuals/dc.1.md.in
index b6d252a2276e..abb1c4aac773 100644
--- a/contrib/bc/manuals/dc.1.md.in
+++ b/contrib/bc/manuals/dc.1.md.in
@@ -106,9 +106,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -118,9 +117,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/A.1 b/contrib/bc/manuals/dc/A.1
index 10627cb197ec..001fe5a1f2c5 100644
--- a/contrib/bc/manuals/dc/A.1
+++ b/contrib/bc/manuals/dc/A.1
@@ -118,10 +118,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -133,10 +132,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/A.1.md b/contrib/bc/manuals/dc/A.1.md
index 36b20862c57f..50c7c8f08c6b 100644
--- a/contrib/bc/manuals/dc/A.1.md
+++ b/contrib/bc/manuals/dc/A.1.md
@@ -101,9 +101,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -113,9 +112,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/E.1 b/contrib/bc/manuals/dc/E.1
index 7f11a33bb18a..f5b1f194f206 100644
--- a/contrib/bc/manuals/dc/E.1
+++ b/contrib/bc/manuals/dc/E.1
@@ -118,10 +118,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -133,10 +132,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/E.1.md b/contrib/bc/manuals/dc/E.1.md
index 028e61b42bcc..bb2ab4b0366d 100644
--- a/contrib/bc/manuals/dc/E.1.md
+++ b/contrib/bc/manuals/dc/E.1.md
@@ -101,9 +101,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -113,9 +112,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/EH.1 b/contrib/bc/manuals/dc/EH.1
index d7efbd649a76..9c5cf7d14c92 100644
--- a/contrib/bc/manuals/dc/EH.1
+++ b/contrib/bc/manuals/dc/EH.1
@@ -118,10 +118,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -133,10 +132,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/EH.1.md b/contrib/bc/manuals/dc/EH.1.md
index 774ba6e32b3a..e1a0540d1243 100644
--- a/contrib/bc/manuals/dc/EH.1.md
+++ b/contrib/bc/manuals/dc/EH.1.md
@@ -101,9 +101,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -113,9 +112,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/EHN.1 b/contrib/bc/manuals/dc/EHN.1
index a77032398174..4d95b4a1ac96 100644
--- a/contrib/bc/manuals/dc/EHN.1
+++ b/contrib/bc/manuals/dc/EHN.1
@@ -118,10 +118,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -133,10 +132,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/EHN.1.md b/contrib/bc/manuals/dc/EHN.1.md
index b4845bf77d86..1fe5ab8cac09 100644
--- a/contrib/bc/manuals/dc/EHN.1.md
+++ b/contrib/bc/manuals/dc/EHN.1.md
@@ -101,9 +101,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -113,9 +112,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/EHNP.1 b/contrib/bc/manuals/dc/EHNP.1
index fb350b8ed2f9..aceea91027ad 100644
--- a/contrib/bc/manuals/dc/EHNP.1
+++ b/contrib/bc/manuals/dc/EHNP.1
@@ -113,10 +113,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -128,10 +127,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/EHNP.1.md b/contrib/bc/manuals/dc/EHNP.1.md
index 71a24ac4e635..97585bba14bb 100644
--- a/contrib/bc/manuals/dc/EHNP.1.md
+++ b/contrib/bc/manuals/dc/EHNP.1.md
@@ -98,9 +98,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -110,9 +109,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/EHP.1 b/contrib/bc/manuals/dc/EHP.1
index 2a47184695cb..70e45ae52363 100644
--- a/contrib/bc/manuals/dc/EHP.1
+++ b/contrib/bc/manuals/dc/EHP.1
@@ -113,10 +113,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -128,10 +127,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/EHP.1.md b/contrib/bc/manuals/dc/EHP.1.md
index 5445e17e5811..d101695a1c89 100644
--- a/contrib/bc/manuals/dc/EHP.1.md
+++ b/contrib/bc/manuals/dc/EHP.1.md
@@ -98,9 +98,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -110,9 +109,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/EN.1 b/contrib/bc/manuals/dc/EN.1
index cc6ec8baaefd..4c57b0dd03e3 100644
--- a/contrib/bc/manuals/dc/EN.1
+++ b/contrib/bc/manuals/dc/EN.1
@@ -118,10 +118,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -133,10 +132,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/EN.1.md b/contrib/bc/manuals/dc/EN.1.md
index 114c4d1916b1..e1826daa4e18 100644
--- a/contrib/bc/manuals/dc/EN.1.md
+++ b/contrib/bc/manuals/dc/EN.1.md
@@ -101,9 +101,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -113,9 +112,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/ENP.1 b/contrib/bc/manuals/dc/ENP.1
index 01a49aff21ae..2e8e2341a739 100644
--- a/contrib/bc/manuals/dc/ENP.1
+++ b/contrib/bc/manuals/dc/ENP.1
@@ -113,10 +113,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -128,10 +127,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/ENP.1.md b/contrib/bc/manuals/dc/ENP.1.md
index df9c398527c8..cc5eea424fb2 100644
--- a/contrib/bc/manuals/dc/ENP.1.md
+++ b/contrib/bc/manuals/dc/ENP.1.md
@@ -98,9 +98,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -110,9 +109,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/EP.1 b/contrib/bc/manuals/dc/EP.1
index 00d29fc3ff9c..f97f2a8ae98f 100644
--- a/contrib/bc/manuals/dc/EP.1
+++ b/contrib/bc/manuals/dc/EP.1
@@ -113,10 +113,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -128,10 +127,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/EP.1.md b/contrib/bc/manuals/dc/EP.1.md
index 99bb462fb0a0..cd58549b17a5 100644
--- a/contrib/bc/manuals/dc/EP.1.md
+++ b/contrib/bc/manuals/dc/EP.1.md
@@ -98,9 +98,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -110,9 +109,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/H.1 b/contrib/bc/manuals/dc/H.1
index 02825b898261..44617c0b1a3c 100644
--- a/contrib/bc/manuals/dc/H.1
+++ b/contrib/bc/manuals/dc/H.1
@@ -118,10 +118,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -133,10 +132,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/H.1.md b/contrib/bc/manuals/dc/H.1.md
index ab3b13fbf758..327e27a0c893 100644
--- a/contrib/bc/manuals/dc/H.1.md
+++ b/contrib/bc/manuals/dc/H.1.md
@@ -101,9 +101,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -113,9 +112,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/HN.1 b/contrib/bc/manuals/dc/HN.1
index cb97ca4cafb3..8b032e82f1f9 100644
--- a/contrib/bc/manuals/dc/HN.1
+++ b/contrib/bc/manuals/dc/HN.1
@@ -118,10 +118,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -133,10 +132,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/HN.1.md b/contrib/bc/manuals/dc/HN.1.md
index a4d3b9f6ca9e..f128840138a5 100644
--- a/contrib/bc/manuals/dc/HN.1.md
+++ b/contrib/bc/manuals/dc/HN.1.md
@@ -101,9 +101,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -113,9 +112,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/HNP.1 b/contrib/bc/manuals/dc/HNP.1
index fefaa2a56c9d..f5152fa781d4 100644
--- a/contrib/bc/manuals/dc/HNP.1
+++ b/contrib/bc/manuals/dc/HNP.1
@@ -113,10 +113,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -128,10 +127,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/HNP.1.md b/contrib/bc/manuals/dc/HNP.1.md
index b97a4a118d89..fc71488f8b53 100644
--- a/contrib/bc/manuals/dc/HNP.1.md
+++ b/contrib/bc/manuals/dc/HNP.1.md
@@ -98,9 +98,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -110,9 +109,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/HP.1 b/contrib/bc/manuals/dc/HP.1
index 45b0cc111be8..eeae02949fc0 100644
--- a/contrib/bc/manuals/dc/HP.1
+++ b/contrib/bc/manuals/dc/HP.1
@@ -113,10 +113,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -128,10 +127,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/HP.1.md b/contrib/bc/manuals/dc/HP.1.md
index fb7569dab186..88e0914d6266 100644
--- a/contrib/bc/manuals/dc/HP.1.md
+++ b/contrib/bc/manuals/dc/HP.1.md
@@ -98,9 +98,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -110,9 +109,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/N.1 b/contrib/bc/manuals/dc/N.1
index a4fb86637c1f..a7ca5b5fec27 100644
--- a/contrib/bc/manuals/dc/N.1
+++ b/contrib/bc/manuals/dc/N.1
@@ -118,10 +118,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -133,10 +132,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/N.1.md b/contrib/bc/manuals/dc/N.1.md
index ac7e27b6e5a3..6e843649b37d 100644
--- a/contrib/bc/manuals/dc/N.1.md
+++ b/contrib/bc/manuals/dc/N.1.md
@@ -101,9 +101,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -113,9 +112,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/NP.1 b/contrib/bc/manuals/dc/NP.1
index 9b0b407bb327..bfd1c0e59d4f 100644
--- a/contrib/bc/manuals/dc/NP.1
+++ b/contrib/bc/manuals/dc/NP.1
@@ -113,10 +113,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -128,10 +127,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/NP.1.md b/contrib/bc/manuals/dc/NP.1.md
index f521c3df205e..b83d20a806bb 100644
--- a/contrib/bc/manuals/dc/NP.1.md
+++ b/contrib/bc/manuals/dc/NP.1.md
@@ -98,9 +98,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -110,9 +109,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/manuals/dc/P.1 b/contrib/bc/manuals/dc/P.1
index 4ba6c64322d9..6f5cd4cec1d3 100644
--- a/contrib/bc/manuals/dc/P.1
+++ b/contrib/bc/manuals/dc/P.1
@@ -113,10 +113,9 @@ This means that if a file is given before an expression, the file is
read in and evaluated first.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the expressions and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
.PP
This is a \f[B]non\-portable extension\f[].
.RE
@@ -128,10 +127,12 @@ If expressions are also given (see above), the expressions are evaluated
in the order given.
.RS
.PP
-In other dc(1) implementations, this option causes the program to
-execute the files and then exit.
-This dc(1) does not, unless the \f[B]DC_EXPR_EXIT\f[] is defined (see
-the \f[B]ENVIRONMENT VARIABLES\f[] section).
+After processing all expressions and files, dc(1) will exit, unless
+\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to
+\f[B]\-f\f[] or \f[B]\-\-file\f[].
+However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[],
+\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1)
+will give a fatal error and exit.
.PP
This is a \f[B]non\-portable extension\f[].
.RE
diff --git a/contrib/bc/manuals/dc/P.1.md b/contrib/bc/manuals/dc/P.1.md
index dc6d3d950067..41aad658bb3d 100644
--- a/contrib/bc/manuals/dc/P.1.md
+++ b/contrib/bc/manuals/dc/P.1.md
@@ -98,9 +98,8 @@ The following are the options that dc(1) accepts.
evaluated in the order given. This means that if a file is given before an
expression, the file is read in and evaluated first.
- In other dc(1) implementations, this option causes the program to execute
- the expressions and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
This is a **non-portable extension**.
@@ -110,9 +109,10 @@ The following are the options that dc(1) accepts.
through **stdin**. If expressions are also given (see above), the
expressions are evaluated in the order given.
- In other dc(1) implementations, this option causes the program to execute
- the files and then exit. This dc(1) does not, unless the
- **DC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section).
+ After processing all expressions and files, dc(1) will exit, unless **-**
+ (**stdin**) was given as an argument at least once to **-f** or **--file**.
+ However, if any other **-e**, **--expression**, **-f**, or **--file**
+ arguments are given after that, bc(1) will give a fatal error and exit.
This is a **non-portable extension**.
diff --git a/contrib/bc/src/args.c b/contrib/bc/src/args.c
index 1626ad4944e4..029237627786 100644
--- a/contrib/bc/src/args.c
+++ b/contrib/bc/src/args.c
@@ -108,13 +108,20 @@ void bc_args(int argc, char *argv[]) {
case 'e':
{
+ if (vm.no_exit_exprs)
+ bc_vm_verr(BC_ERROR_FATAL_OPTION, "-e (--expression)");
bc_args_exprs(opts.optarg);
break;
}
case 'f':
{
- bc_args_file(opts.optarg);
+ if (!strcmp(opts.optarg, "-")) vm.no_exit_exprs = true;
+ else {
+ if (vm.no_exit_exprs)
+ bc_vm_verr(BC_ERROR_FATAL_OPTION, "-f (--file)");
+ bc_args_file(opts.optarg);
+ }
break;
}
@@ -155,7 +162,7 @@ void bc_args(int argc, char *argv[]) {
case 'q':
{
assert(BC_IS_BC);
- vm.flags |= BC_FLAG_Q;
+ // Do nothing.
break;
}
@@ -205,9 +212,8 @@ void bc_args(int argc, char *argv[]) {
if (version) bc_vm_info(NULL);
if (do_exit) exit((int) vm.status);
- if (vm.exprs.len > 1 || BC_IS_DC) vm.flags |= BC_FLAG_Q;
- if (opts.optind < (size_t) argc)
+ if (opts.optind < (size_t) argc && vm.files.v == NULL)
bc_vec_init(&vm.files, sizeof(char*), NULL);
for (i = opts.optind; i < (size_t) argc; ++i)
diff --git a/contrib/bc/src/bc/bc.c b/contrib/bc/src/bc/bc.c
index ef0fc3d6865d..3d488b5640c8 100644
--- a/contrib/bc/src/bc/bc.c
+++ b/contrib/bc/src/bc/bc.c
@@ -52,6 +52,6 @@ void bc_main(int argc, char **argv) {
vm.parse = bc_parse_parse;
vm.expr = bc_parse_expr;
- bc_vm_boot(argc, argv, "BC_LINE_LENGTH", "BC_ENV_ARGS", "BC_EXPR_EXIT");
+ bc_vm_boot(argc, argv, "BC_LINE_LENGTH", "BC_ENV_ARGS");
}
#endif // BC_ENABLED
diff --git a/contrib/bc/src/bc/parse.c b/contrib/bc/src/bc/parse.c
index 2aa9d97468ff..329c1a84b419 100644
--- a/contrib/bc/src/bc/parse.c
+++ b/contrib/bc/src/bc/parse.c
@@ -179,10 +179,10 @@ static void bc_parse_params(BcParse *p, uint8_t flags) {
bc_lex_next(&p->l);
- for (nparams = 0; p->l.t != BC_LEX_RPAREN; ++nparams) {
+ flags &= ~(BC_PARSE_PRINT | BC_PARSE_REL);
+ flags |= (BC_PARSE_ARRAY | BC_PARSE_NEEDVAL);
- flags &= ~(BC_PARSE_PRINT | BC_PARSE_REL);
- flags |= (BC_PARSE_ARRAY | BC_PARSE_NEEDVAL);
+ for (nparams = 0; p->l.t != BC_LEX_RPAREN; ++nparams) {
bc_parse_expr_status(p, flags, bc_parse_next_param);
@@ -516,6 +516,12 @@ static void bc_parse_return(BcParse *p) {
}
}
+static void bc_parse_noElse(BcParse *p) {
+ uint16_t *flag_ptr = BC_PARSE_TOP_FLAG_PTR(p);
+ *flag_ptr = (*flag_ptr & ~(BC_PARSE_FLAG_IF_END));
+ bc_parse_setLabel(p);
+}
+
static void bc_parse_endBody(BcParse *p, bool brace) {
bool has_brace, new_else = false;
@@ -610,12 +616,6 @@ static void bc_parse_startBody(BcParse *p, uint16_t flags) {
bc_vec_push(&p->flags, &flags);
}
-void bc_parse_noElse(BcParse *p) {
- uint16_t *flag_ptr = BC_PARSE_TOP_FLAG_PTR(p);
- *flag_ptr = (*flag_ptr & ~(BC_PARSE_FLAG_IF_END));
- bc_parse_setLabel(p);
-}
-
static void bc_parse_if(BcParse *p) {
size_t idx;
diff --git a/contrib/bc/src/dc/dc.c b/contrib/bc/src/dc/dc.c
index 21d7bfbd4385..8c03ccf0e414 100644
--- a/contrib/bc/src/dc/dc.c
+++ b/contrib/bc/src/dc/dc.c
@@ -52,6 +52,6 @@ void dc_main(int argc, char **argv) {
vm.parse = dc_parse_parse;
vm.expr = dc_parse_expr;
- bc_vm_boot(argc, argv, "DC_LINE_LENGTH", "DC_ENV_ARGS", "DC_EXPR_EXIT");
+ bc_vm_boot(argc, argv, "DC_LINE_LENGTH", "DC_ENV_ARGS");
}
#endif // DC_ENABLED
diff --git a/contrib/bc/src/program.c b/contrib/bc/src/program.c
index 20b301e5bc05..a14887e7f135 100644
--- a/contrib/bc/src/program.c
+++ b/contrib/bc/src/program.c
@@ -1271,12 +1271,13 @@ static void bc_program_divmod(BcProgram *p) {
BcNum *n1, *n2;
size_t req;
+ bc_vec_expand(&p->results, p->results.len + 2);
+
+ // We don't need to update the pointer because
+ // the capacity is enough due to the line above.
res2 = bc_program_prepResult(p);
res = bc_program_prepResult(p);
- // Update the pointer, just in case.
- res2 = bc_vec_item_rev(&p->results, 1);
-
bc_program_binOpPrep(p, &opd1, &n1, &opd2, &n2, 2);
req = bc_num_mulReq(n1, n2, BC_PROG_SCALE(p));
diff --git a/contrib/bc/src/vm.c b/contrib/bc/src/vm.c
index 905613563e8d..e15b1398734e 100644
--- a/contrib/bc/src/vm.c
+++ b/contrib/bc/src/vm.c
@@ -452,7 +452,7 @@ static void bc_vm_clean(void) {
}
}
-static void bc_vm_process(const char *text, bool is_stdin) {
+static void bc_vm_process(const char *text) {
bc_parse_text(&vm.prs, text);
@@ -464,29 +464,36 @@ static void bc_vm_process(const char *text, bool is_stdin) {
while (BC_PARSE_CAN_PARSE(vm.prs)) vm.parse(&vm.prs);
-#if BC_ENABLED
- if (BC_IS_BC) {
+ if(BC_IS_DC || !BC_PARSE_NO_EXEC(&vm.prs)) bc_program_exec(&vm.prog);
- uint16_t *flags = BC_PARSE_TOP_FLAG_PTR(&vm.prs);
+ assert(BC_IS_DC || vm.prog.results.len == 0);
- if (!is_stdin && vm.prs.flags.len == 1 &&
- *flags == BC_PARSE_FLAG_IF_END)
- {
- bc_parse_noElse(&vm.prs);
- }
+ if (BC_I) bc_file_flush(&vm.fout);
- if (BC_PARSE_NO_EXEC(&vm.prs)) return;
- }
-#endif // BC_ENABLED
+ } while (vm.prs.l.t != BC_LEX_EOF);
+}
- bc_program_exec(&vm.prog);
+#if BC_ENABLED
+static void bc_vm_endif(void) {
- assert(BC_IS_DC || vm.prog.results.len == 0);
+ size_t i;
+ bool good;
- if (BC_I) bc_file_flush(&vm.fout);
+ if (BC_NO_ERR(!BC_PARSE_NO_EXEC(&vm.prs))) return;
- } while (vm.prs.l.t != BC_LEX_EOF);
+ good = true;
+
+ for (i = 0; good && i < vm.prs.flags.len; ++i) {
+ uint16_t flag = *((uint16_t*) bc_vec_item(&vm.prs.flags, i));
+ good = ((flag & BC_PARSE_FLAG_BRACE) != BC_PARSE_FLAG_BRACE);
+ }
+
+ if (good) {
+ while (BC_PARSE_IF_END(&vm.prs)) bc_vm_process("else {}");
+ }
+ else bc_parse_err(&vm.prs, BC_ERROR_PARSE_BLOCK);
}
+#endif // BC_ENABLED
static void bc_vm_file(const char *file) {
@@ -504,11 +511,10 @@ static void bc_vm_file(const char *file) {
BC_SIG_UNLOCK;
- bc_vm_process(data, false);
+ bc_vm_process(data);
#if BC_ENABLED
- if (BC_IS_BC && BC_ERR(BC_PARSE_NO_EXEC(&vm.prs)))
- bc_parse_err(&vm.prs, BC_ERROR_PARSE_BLOCK);
+ if (BC_IS_BC) bc_vm_endif();
#endif // BC_ENABLED
err:
@@ -589,7 +595,7 @@ restart:
if (vm.history.stdin_has_data) continue;
#endif // BC_ENABLE_HISTORY
- bc_vm_process(buffer.v, true);
+ bc_vm_process(buffer.v);
bc_vec_empty(&buffer);
if (vm.eof) break;
@@ -602,21 +608,7 @@ restart:
else if (BC_ERR(string))
bc_parse_err(&vm.prs, BC_ERROR_PARSE_STRING);
#if BC_ENABLED
- else if (BC_IS_BC && BC_ERR(BC_PARSE_NO_EXEC(&vm.prs))) {
-
- size_t i;
- bool good = true;
-
- for (i = 0; good && i < vm.prs.flags.len; ++i) {
- uint16_t flag = *((uint16_t*) bc_vec_item(&vm.prs.flags, i));
- good = ((flag & BC_PARSE_FLAG_BRACE) != BC_PARSE_FLAG_BRACE);
- }
-
- if (good) {
- while (BC_PARSE_IF_END(&vm.prs)) bc_vm_process("else {}", true);
- }
- else bc_parse_err(&vm.prs, BC_ERROR_PARSE_BLOCK);
- }
+ else if (BC_IS_BC) bc_vm_endif();
#endif // BC_ENABLED
}
@@ -706,7 +698,7 @@ static void bc_vm_gettext(void) {
#endif // BC_ENABLE_NLS
}
-static void bc_vm_exec(const char* env_exp_exit) {
+static void bc_vm_exec(void) {
size_t i;
bool has_file = false;
@@ -743,7 +735,7 @@ static void bc_vm_exec(const char* env_exp_exit) {
more = bc_read_buf(&buf, vm.exprs.v, &len);
bc_vec_pushByte(&buf, '\0');
- bc_vm_process(buf.v, false);
+ bc_vm_process(buf.v);
bc_vec_npop(&buf, buf.len);
@@ -758,7 +750,7 @@ static void bc_vm_exec(const char* env_exp_exit) {
BC_SIG_UNLOCK;
- if (getenv(env_exp_exit) != NULL) return;
+ if (!vm.no_exit_exprs) return;
}
for (i = 0; i < vm.files.len; ++i) {
@@ -784,7 +776,7 @@ err:
}
void bc_vm_boot(int argc, char *argv[], const char *env_len,
- const char* const env_args, const char* env_exp_exit)
+ const char* const env_args)
{
int ttyin, ttyout, ttyerr;
struct sigaction sa;
@@ -863,9 +855,7 @@ void bc_vm_boot(int argc, char *argv[], const char *env_len,
vm.maxes[BC_PROG_GLOBALS_IBASE] = BC_NUM_MAX_IBASE;
#endif // BC_ENABLED
- if (BC_IS_BC && BC_I && !(vm.flags & BC_FLAG_Q)) bc_vm_info(NULL);
-
BC_SIG_UNLOCK;
- bc_vm_exec(env_exp_exit);
+ bc_vm_exec();
}
diff --git a/contrib/bc/tests/bc/all.txt b/contrib/bc/tests/bc/all.txt
index 069e60942404..b623e8a11b71 100644
--- a/contrib/bc/tests/bc/all.txt
+++ b/contrib/bc/tests/bc/all.txt
@@ -39,6 +39,8 @@ misc2
misc3
misc4
misc5
+misc6
+misc7
void
rand
lib2
diff --git a/contrib/bc/tests/bc/misc6.txt b/contrib/bc/tests/bc/misc6.txt
new file mode 120000
index 000000000000..1ddbfa42bea4
--- /dev/null
+++ b/contrib/bc/tests/bc/misc6.txt
@@ -0,0 +1 @@
+stdin1.txt \ No newline at end of file
diff --git a/contrib/bc/tests/bc/misc6_results.txt b/contrib/bc/tests/bc/misc6_results.txt
new file mode 120000
index 000000000000..a0374545ed82
--- /dev/null
+++ b/contrib/bc/tests/bc/misc6_results.txt
@@ -0,0 +1 @@
+stdin1_results.txt \ No newline at end of file
diff --git a/contrib/bc/tests/bc/misc7.txt b/contrib/bc/tests/bc/misc7.txt
new file mode 120000
index 000000000000..17ea58ae3ffd
--- /dev/null
+++ b/contrib/bc/tests/bc/misc7.txt
@@ -0,0 +1 @@
+stdin2.txt \ No newline at end of file
diff --git a/contrib/bc/tests/bc/misc7_results.txt b/contrib/bc/tests/bc/misc7_results.txt
new file mode 120000
index 000000000000..394d3e9d57c1
--- /dev/null
+++ b/contrib/bc/tests/bc/misc7_results.txt
@@ -0,0 +1 @@
+stdin2_results.txt \ No newline at end of file
diff --git a/contrib/bc/tests/bc/stdin1.txt b/contrib/bc/tests/bc/stdin1.txt
new file mode 100644
index 000000000000..3721c265baa2
--- /dev/null
+++ b/contrib/bc/tests/bc/stdin1.txt
@@ -0,0 +1,2 @@
+if (1 < 3)
+ if (2 < 3) 1
diff --git a/contrib/bc/tests/bc/stdin1_results.txt b/contrib/bc/tests/bc/stdin1_results.txt
new file mode 100644
index 000000000000..d00491fd7e5b
--- /dev/null
+++ b/contrib/bc/tests/bc/stdin1_results.txt
@@ -0,0 +1 @@
+1
diff --git a/contrib/bc/tests/bc/stdin2.txt b/contrib/bc/tests/bc/stdin2.txt
new file mode 100644
index 000000000000..f260cfa7dbcf
--- /dev/null
+++ b/contrib/bc/tests/bc/stdin2.txt
@@ -0,0 +1 @@
+for (i = 0; i < 3; ++i) if (2 < 3) 1
diff --git a/contrib/bc/tests/bc/stdin2_results.txt b/contrib/bc/tests/bc/stdin2_results.txt
new file mode 100644
index 000000000000..e8183f05f5db
--- /dev/null
+++ b/contrib/bc/tests/bc/stdin2_results.txt
@@ -0,0 +1,3 @@
+1
+1
+1
diff --git a/contrib/ipfilter/iplang/iplang_y.y b/contrib/ipfilter/iplang/iplang_y.y
index f223b1eb8b32..b4570d390530 100644
--- a/contrib/ipfilter/iplang/iplang_y.y
+++ b/contrib/ipfilter/iplang/iplang_y.y
@@ -30,11 +30,9 @@
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#ifndef linux
# include <netinet/ip_var.h>
# include <net/route.h>
# include <netinet/if_ether.h>
-#endif
#include <netdb.h>
#include <arpa/nameser.h>
#include <arpa/inet.h>
@@ -589,28 +587,6 @@ struct statetoopt tosecopts[] = {
{ 0, 0 }
};
-#ifdef bsdi
-struct ether_addr *
-ether_aton(s)
- char *s;
-{
- static struct ether_addr n;
- u_int i[6];
-
- if (sscanf(s, " %x:%x:%x:%x:%x:%x ", &i[0], &i[1],
- &i[2], &i[3], &i[4], &i[5]) == 6) {
- n.ether_addr_octet[0] = (u_char)i[0];
- n.ether_addr_octet[1] = (u_char)i[1];
- n.ether_addr_octet[2] = (u_char)i[2];
- n.ether_addr_octet[3] = (u_char)i[3];
- n.ether_addr_octet[4] = (u_char)i[4];
- n.ether_addr_octet[5] = (u_char)i[5];
- return &n;
- }
- return NULL;
-}
-#endif
-
struct in_addr getipv4addr(arg)
char *arg;
@@ -645,7 +621,6 @@ struct ether_addr *buf;
{
struct ether_addr *e;
-#if !defined(hpux) && !defined(linux)
e = ether_aton(arg);
if (!e)
fprintf(stderr, "Invalid ethernet address: %s\n", arg);
@@ -657,9 +632,6 @@ struct ether_addr *buf;
sizeof(e->ether_addr_octet));
# endif
return e;
-#else
- return NULL;
-#endif
}
@@ -1584,9 +1556,7 @@ int arg;
void set_icmpmtu(arg)
int arg;
{
-#if BSD >= 199306
icmp->icmp_nextmtu = htons(arg);
-#endif
}
diff --git a/contrib/telnet/telnet/telnet.1 b/contrib/telnet/telnet/telnet.1
index 32190112866b..b7004ee94a5d 100644
--- a/contrib/telnet/telnet/telnet.1
+++ b/contrib/telnet/telnet/telnet.1
@@ -28,7 +28,7 @@
.\" @(#)telnet.1 8.6 (Berkeley) 6/1/94
.\" $FreeBSD$
.\"
-.Dd September 18, 2006
+.Dd August 7, 2020
.Dt TELNET 1
.Os
.Sh NAME
@@ -47,6 +47,7 @@ protocol
.Op Fl l Ar user
.Op Fl n Ar tracefile
.Op Fl s Ar src_addr
+.Op Fl P Ar policy
.Oo
.Ar host
.Op Ar port
@@ -189,6 +190,13 @@ for recording trace information.
See the
.Ic set tracefile
command below.
+.It Fl P Ar policy
+Use IPsec policy specification string
+.Ar policy ,
+for the connections.
+See
+.Xr ipsec_set_policy 3
+for details.
.It Fl r
Specifies a user interface similar to
.Xr rlogin 1 .
diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist
index 80c4b3e47dc3..8bc8c7e96ac3 100644
--- a/etc/mtree/BSD.tests.dist
+++ b/etc/mtree/BSD.tests.dist
@@ -1002,6 +1002,8 @@
..
getconf
..
+ gh-bc
+ ..
grep
..
gzip
diff --git a/lib/Makefile b/lib/Makefile
index 3c29635ffda8..45c10e7e5c57 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -107,6 +107,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \
# libraries, those libraries should be listed as build order dependencies here.
SUBDIR_DEPEND_geom= libufs
+SUBDIR_DEPEND_googletest= libregex
SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd
SUBDIR_DEPEND_libauditdm= libbsm
SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
diff --git a/lib/csu/mips/Makefile b/lib/csu/mips/Makefile
index a0c6cdf0be53..372f98d5b18e 100644
--- a/lib/csu/mips/Makefile
+++ b/lib/csu/mips/Makefile
@@ -2,6 +2,27 @@
.PATH: ${.CURDIR:H}/common
+.include <src.opts.mk>
+
CFLAGS+= -DCRT_IRELOC_SUPPRESS
+.if ${MACHINE_ARCH:Mmips64}
+ELFCLASS= 64
+.else
+ELFCLASS= 32
+.endif
+.if ${MACHINE_ARCH:Mmips*el}
+ENDIAN= l
+.else
+ENDIAN= b
+.endif
+.if ${MACHINE_ARCH:Mmipsn32*}
+SUFFIX= n32
+.else
+SUFFIX=
+.endif
+
+# binutils requires an explicit emulation for ld -r
+LDFLAGS.bfd+= -Wl,-m -Wl,elf${ELFCLASS}${ENDIAN}tsmip${SUFFIX}_fbsd
+
.include <bsd.lib.mk>
diff --git a/lib/googletest/gtest/Makefile b/lib/googletest/gtest/Makefile
index b580c33eb45a..103bf84db5b2 100644
--- a/lib/googletest/gtest/Makefile
+++ b/lib/googletest/gtest/Makefile
@@ -45,7 +45,7 @@ INTERNAL_CUSTOM_INCS+= gtest/internal/custom/gtest.h
SRCS+= gtest-all.cc
-LIBADD+= pthread
+LIBADD+= pthread regex
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
diff --git a/lib/lib80211/lib80211_regdomain.h b/lib/lib80211/lib80211_regdomain.h
index a8a4207c98ac..913dc161cdb0 100644
--- a/lib/lib80211/lib80211_regdomain.h
+++ b/lib/lib80211/lib80211_regdomain.h
@@ -73,10 +73,10 @@ struct regdomain {
netband_head bands_11b; /* 11b operation */
netband_head bands_11g; /* 11g operation */
netband_head bands_11a; /* 11a operation */
- netband_head bands_11ng;/* 11ng operation */
- netband_head bands_11na;/* 11na operation */
- netband_head bands_11ac;/* 11ac 5GHz operation */
- netband_head bands_11acg;/* 11ac 2GHz operation */
+ netband_head bands_11ng; /* 11ng operation */
+ netband_head bands_11na; /* 11na operation */
+ netband_head bands_11ac; /* 11ac 5GHz operation */
+ netband_head bands_11acg; /* 11ac 2GHz operation */
LIST_ENTRY(regdomain) next;
};
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index f86c7b04b92b..779b418e9340 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -120,6 +120,7 @@ SRCS+= __getosreldate.c \
recvmmsg.c \
rewinddir.c \
scandir.c \
+ scandir_b.c \
scandir-compat11.c \
seed48.c \
seekdir.c \
diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map
index f9d4f158ed30..e17d74d1a151 100644
--- a/lib/libc/gen/Symbol.map
+++ b/lib/libc/gen/Symbol.map
@@ -416,7 +416,6 @@ FBSD_1.5 {
readdir;
readdir_r;
scandir;
- scandir_b;
sem_clockwait_np;
setproctitle_fast;
timespec_get;
@@ -424,6 +423,7 @@ FBSD_1.5 {
FBSD_1.6 {
memalign;
+ scandir_b;
sigandset;
sigisemptyset;
sigorset;
diff --git a/lib/libc/gen/directory.3 b/lib/libc/gen/directory.3
index 835236e50066..f517a00386c6 100644
--- a/lib/libc/gen/directory.3
+++ b/lib/libc/gen/directory.3
@@ -28,7 +28,7 @@
.\" @(#)directory.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd April 30, 2019
+.Dd August 1, 2020
.Dt DIRECTORY 3
.Os
.Sh NAME
@@ -242,7 +242,7 @@ returns the integer file descriptor associated with the named
.Em directory stream ,
see
.Xr open 2 .
-.Pp
+.Sh EXAMPLES
Sample code which searches a directory for entry ``name'' is:
.Bd -literal -offset indent
dirp = opendir(".");
@@ -258,6 +258,76 @@ while ((dp = readdir(dirp)) != NULL) {
(void)closedir(dirp);
return (NOT_FOUND);
.Ed
+.Sh ERRORS
+The
+.Fn opendir
+function will fail if:
+.Bl -tag -width Er
+.It Bq Er EACCES
+Search permission is denied for the component of the path prefix of
+.Fa filename
+or read permission is denied for
+.Fa filename .
+.It Bq Er ELOOP
+A loop exists in symbolic links encountered during resolution of the
+.Fa filename
+argument.
+.It Bq Er ENAMETOOLONG
+The length of the
+.Fa filename
+argument exceeds
+.Brq Dv PATH_MAX
+or
+a pathname component is longer than
+.Brq Dv NAME_MAX .
+.It Bq Er ENOENT
+A component of
+.Fa filename
+does not name an existing directory or
+.Fa filename
+is an empty string.
+.It Bq Er ENOTDIR
+A component of
+.Fa filename
+is not a directory.
+.El
+.Pp
+The
+.Fn fdopendir
+function will fail if:
+.Bl -tag -width Er
+.It Bq Er EBADF
+The
+.Fa fd
+argument is not a valid file descriptor open for reading.
+.It Bq Er ENOTDIR
+The descriptor
+.Fa fd
+is not associated with a directory.
+.El
+.Pp
+The
+.Fn readdir
+and
+.Fn readdir_r
+functions may also fail and set
+.Va errno
+for any of the errors specified for the routine
+.Xr getdents 2 .
+.Pp
+The
+.Fn telldir
+function may also fail and set
+.Va errno
+for any of the errors specified for the routine
+.Xr realloc 3 .
+.Pp
+The
+.Fn closedir
+function may also fail and set
+.Va errno
+for any of the errors specified for the routine
+.Xr close 2 .
.Sh SEE ALSO
.Xr close 2 ,
.Xr lseek 2 ,
diff --git a/lib/libc/gen/getpeereid.c b/lib/libc/gen/getpeereid.c
index 530ae0e6100e..86396d359ba3 100644
--- a/lib/libc/gen/getpeereid.c
+++ b/lib/libc/gen/getpeereid.c
@@ -47,7 +47,7 @@ getpeereid(int s, uid_t *euid, gid_t *egid)
int error;
xuclen = sizeof(xuc);
- error = _getsockopt(s, 0, LOCAL_PEERCRED, &xuc, &xuclen);
+ error = _getsockopt(s, SOL_LOCAL, LOCAL_PEERCRED, &xuc, &xuclen);
if (error != 0)
return (error);
if (xuc.cr_version != XUCRED_VERSION) {
diff --git a/lib/libc/gen/scandir-compat11.c b/lib/libc/gen/scandir-compat11.c
index 712d14ee9c04..b1c0ecb83622 100644
--- a/lib/libc/gen/scandir-compat11.c
+++ b/lib/libc/gen/scandir-compat11.c
@@ -49,32 +49,25 @@ __FBSDID("$FreeBSD$");
#include "gen-compat.h"
-#ifdef I_AM_SCANDIR_B
-#include "block_abi.h"
-#define SELECT(x) CALL_BLOCK(select, x)
-#ifndef __BLOCKS__
-void
-qsort_b(void *, size_t, size_t, void*);
-#endif
-#else
+/*
+ * scandir_b@FBSD_1.4 was never exported from libc.so.7 due to a
+ * mistake, so there is no use of exporting it now with some earlier
+ * symbol version. As result, we do not need to implement compat
+ * function freebsd11_scandir_b().
+ */
+
#define SELECT(x) select(x)
-#endif
+
+void qsort_b(void *, size_t, size_t, void *);
static int freebsd11_alphasort_thunk(void *thunk, const void *p1,
const void *p2);
int
-#ifdef I_AM_SCANDIR_B
-freebsd11_scandir_b(const char *dirname, struct freebsd11_dirent ***namelist,
- DECLARE_BLOCK(int, select, const struct freebsd11_dirent *),
- DECLARE_BLOCK(int, dcomp, const struct freebsd11_dirent **,
- const struct freebsd11_dirent **))
-#else
freebsd11_scandir(const char *dirname, struct freebsd11_dirent ***namelist,
int (*select)(const struct freebsd11_dirent *),
int (*dcomp)(const struct freebsd11_dirent **,
const struct freebsd11_dirent **))
-#endif
{
struct freebsd11_dirent *d, *p, **names = NULL;
size_t arraysz, numitems;
@@ -124,13 +117,8 @@ freebsd11_scandir(const char *dirname, struct freebsd11_dirent ***namelist,
}
closedir(dirp);
if (numitems && dcomp != NULL)
-#ifdef I_AM_SCANDIR_B
- qsort_b(names, numitems, sizeof(struct freebsd11_dirent *),
- (void*)dcomp);
-#else
qsort_r(names, numitems, sizeof(struct freebsd11_dirent *),
&dcomp, freebsd11_alphasort_thunk);
-#endif
*namelist = names;
return (numitems);
@@ -168,4 +156,3 @@ freebsd11_alphasort_thunk(void *thunk, const void *p1, const void *p2)
__sym_compat(alphasort, freebsd11_alphasort, FBSD_1.0);
__sym_compat(scandir, freebsd11_scandir, FBSD_1.0);
-__sym_compat(scandir_b, freebsd11_scandir_b, FBSD_1.4);
diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c
index 036a0166d48b..7e5bcce905fb 100644
--- a/lib/libc/gen/scandir.c
+++ b/lib/libc/gen/scandir.c
@@ -50,8 +50,7 @@ __FBSDID("$FreeBSD$");
#include "block_abi.h"
#define SELECT(x) CALL_BLOCK(select, x)
#ifndef __BLOCKS__
-void
-qsort_b(void *, size_t, size_t, void*);
+void qsort_b(void *, size_t, size_t, void *);
#endif
#else
#define SELECT(x) select(x)
@@ -134,6 +133,7 @@ fail:
return (-1);
}
+#ifndef I_AM_SCANDIR_B
/*
* Alphabetic order comparison routine for those who want it.
* POSIX 2008 requires that alphasort() uses strcoll().
@@ -153,3 +153,4 @@ alphasort_thunk(void *thunk, const void *p1, const void *p2)
dc = *(int (**)(const struct dirent **, const struct dirent **))thunk;
return (dc((const struct dirent **)p1, (const struct dirent **)p2));
}
+#endif
diff --git a/lib/libc/gen/setmode.c b/lib/libc/gen/setmode.c
index 05fe58952e9d..66976cdd7bcf 100644
--- a/lib/libc/gen/setmode.c
+++ b/lib/libc/gen/setmode.c
@@ -70,7 +70,7 @@ typedef struct bitcmd {
#define CMD2_OBITS 0x08
#define CMD2_UBITS 0x10
-static mode_t getumask(void);
+static mode_t get_current_umask(void);
static BITCMD *addcmd(BITCMD *, mode_t, mode_t, mode_t, mode_t);
static void compress_mode(BITCMD *);
#ifdef SETMODE_DEBUG
@@ -186,7 +186,7 @@ setmode(const char *p)
* Get a copy of the mask for the permissions that are mask relative.
* Flip the bits, we want what's not set.
*/
- mask = ~getumask();
+ mask = ~get_current_umask();
setlen = SET_LEN + 2;
@@ -343,13 +343,14 @@ out:
}
static mode_t
-getumask(void)
+get_current_umask(void)
{
sigset_t sigset, sigoset;
size_t len;
mode_t mask;
u_short smask;
+#ifdef KERN_PROC_UMASK
/*
* First try requesting the umask without temporarily modifying it.
* Note that this does not work if the sysctl
@@ -359,7 +360,7 @@ getumask(void)
if (sysctl((int[4]){ CTL_KERN, KERN_PROC, KERN_PROC_UMASK, 0 },
4, &smask, &len, NULL, 0) == 0)
return (smask);
-
+#endif
/*
* Since it's possible that the caller is opening files inside a signal
* handler, protect them as best we can.
diff --git a/lib/libc/locale/mbsrtowcs.3 b/lib/libc/locale/mbsrtowcs.3
index eaf9f9093056..fb2076f98cdf 100644
--- a/lib/libc/locale/mbsrtowcs.3
+++ b/lib/libc/locale/mbsrtowcs.3
@@ -23,7 +23,7 @@
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
-.Dd July 21, 2004
+.Dd August 7, 2020
.Dt MBSRTOWCS 3
.Os
.Sh NAME
@@ -98,15 +98,29 @@ except that conversion stops after reading at most
bytes from the buffer pointed to by
.Fa src .
.Sh RETURN VALUES
-The
+If successful, and
+.Fa dst
+is not NULL, the
.Fn mbsrtowcs
and
.Fn mbsnrtowcs
functions return the number of wide characters stored in
the array pointed to by
+.Fa dst .
+.Pp
+If
.Fa dst
-if successful, otherwise it returns
-.Po Vt size_t Pc Ns \-1 .
+was NULL then the functions
+.Fn mbsrtowcs
+and
+.Fn mbsnrtowcs
+return the number of wide characters that would have been stored where
+.Fa dst
+points to an infinitely large array.
+.Pp
+If either one of the functions is not successful then
+.Po Vt size_t Pc Ns \-1
+is returned.
.Sh ERRORS
The
.Fn mbsrtowcs
diff --git a/lib/libc/locale/setlocale.3 b/lib/libc/locale/setlocale.3
index 586d82dd3dc2..bef7b0bdd17c 100644
--- a/lib/libc/locale/setlocale.3
+++ b/lib/libc/locale/setlocale.3
@@ -31,7 +31,7 @@
.\" @(#)setlocale.3 8.1 (Berkeley) 6/9/93
.\" $FreeBSD$
.\"
-.Dd September 9, 2019
+.Dd August 7, 2020
.Dt SETLOCALE 3
.Os
.Sh NAME
@@ -98,6 +98,10 @@ as well as values returned by
Set a locale for formatting dates and times using the
.Fn strftime
function.
+.It Dv LANG
+Sets the generic locale category for native language, local customs
+and coded character set in the absence of more specific locale
+variables.
.El
.Pp
Only three locales are defined by default,
@@ -153,6 +157,25 @@ if the given combination of
and
.Fa locale
makes no sense.
+.Sh EXAMPLES
+The following code illustrates how a program can initialize the
+international environment for one language, while selectively
+modifying the program's locale such that regular expressions and
+string operations can be applied to text recorded in a different
+language:
+.Bd -literal
+ setlocale(LC_ALL, "de");
+ setlocale(LC_COLLATE, "fr");
+.Ed
+.Pp
+When a process is started, its current locale is set to the C or POSIX
+locale.
+An internationalized program that depends on locale data not defined in
+the C or POSIX locale must invoke the setlocale subroutine in the
+following manner before using any of the locale-specific information:
+.Bd -literal
+ setlocale(LC_ALL, "");
+.Ed
.Sh FILES
.Bl -tag -width /usr/share/locale/locale/category -compact
.It Pa $PATH_LOCALE/ Ns Em locale/category
diff --git a/lib/libc/powerpc64/gen/makecontext.c b/lib/libc/powerpc64/gen/makecontext.c
index c21e9140d38f..7663b6f82e7d 100644
--- a/lib/libc/powerpc64/gen/makecontext.c
+++ b/lib/libc/powerpc64/gen/makecontext.c
@@ -102,7 +102,11 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...)
uint64_t *argp;
/* Skip past frame pointer and saved LR */
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
argp = (uint64_t *)sp + 6;
+#else
+ argp = (uint64_t *)sp + 4;
+#endif
for (i = 0; i < stackargs; i++)
*argp++ = va_arg(ap, uint64_t);
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index 28bad13ac365..527d0cd3cb42 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -92,6 +92,7 @@ struct parse {
const char *next; /* next character in RE */
const char *end; /* end of string (-> NUL normally) */
int error; /* has an error been seen? */
+ int gnuext;
sop *strip; /* malloced strip */
sopno ssize; /* malloced strip size (allocated) */
sopno slen; /* malloced strip length (used) */
@@ -131,7 +132,9 @@ static int p_count(struct parse *p);
static void p_bracket(struct parse *p);
static int p_range_cmp(wchar_t c1, wchar_t c2);
static void p_b_term(struct parse *p, cset *cs);
+static int p_b_pseudoclass(struct parse *p, char c);
static void p_b_cclass(struct parse *p, cset *cs);
+static void p_b_cclass_named(struct parse *p, cset *cs, const char[]);
static void p_b_eclass(struct parse *p, cset *cs);
static wint_t p_b_symbol(struct parse *p);
static wint_t p_b_coll_elem(struct parse *p, wint_t endc);
@@ -181,6 +184,7 @@ static char nuls[10]; /* place to point scanner in event of error */
#define SEESPEC(a) (p->bre ? SEETWO('\\', a) : SEE(a))
#define EAT(c) ((SEE(c)) ? (NEXT(), 1) : 0)
#define EATTWO(a, b) ((SEETWO(a, b)) ? (NEXT2(), 1) : 0)
+#define EATSPEC(a) (p->bre ? EATTWO('\\', a) : EAT(a))
#define NEXT() (p->next++)
#define NEXT2() (p->next += 2)
#define NEXTn(n) (p->next += (n))
@@ -270,14 +274,22 @@ regcomp_internal(regex_t * __restrict preg,
p->pbegin[i] = 0;
p->pend[i] = 0;
}
+#ifdef LIBREGEX
+ if (cflags&REG_POSIX) {
+ p->gnuext = false;
+ p->allowbranch = (cflags & REG_EXTENDED) != 0;
+ } else
+ p->gnuext = p->allowbranch = true;
+#else
+ p->gnuext = false;
+ p->allowbranch = (cflags & REG_EXTENDED) != 0;
+#endif
if (cflags & REG_EXTENDED) {
- p->allowbranch = true;
p->bre = false;
p->parse_expr = p_ere_exp;
p->pre_parse = NULL;
p->post_parse = NULL;
} else {
- p->allowbranch = false;
p->bre = true;
p->parse_expr = p_simp_re;
p->pre_parse = p_bre_pre_parse;
@@ -388,6 +400,10 @@ p_ere_exp(struct parse *p, struct branchc *bc)
sopno pos;
int count;
int count2;
+#ifdef LIBREGEX
+ int i;
+ int handled;
+#endif
sopno subno;
int wascaret = 0;
@@ -395,6 +411,9 @@ p_ere_exp(struct parse *p, struct branchc *bc)
assert(MORE()); /* caller should have ensured this */
c = GETNEXT();
+#ifdef LIBREGEX
+ handled = 0;
+#endif
pos = HERE();
switch (c) {
case '(':
@@ -457,6 +476,47 @@ p_ere_exp(struct parse *p, struct branchc *bc)
case '\\':
(void)REQUIRE(MORE(), REG_EESCAPE);
wc = WGETNEXT();
+#ifdef LIBREGEX
+ if (p->gnuext) {
+ handled = 1;
+ switch (wc) {
+ case 'W':
+ case 'w':
+ case 'S':
+ case 's':
+ p_b_pseudoclass(p, wc);
+ break;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ i = wc - '0';
+ assert(i < NPAREN);
+ if (p->pend[i] != 0) {
+ assert(i <= p->g->nsub);
+ EMIT(OBACK_, i);
+ assert(p->pbegin[i] != 0);
+ assert(OP(p->strip[p->pbegin[i]]) == OLPAREN);
+ assert(OP(p->strip[p->pend[i]]) == ORPAREN);
+ (void) dupl(p, p->pbegin[i]+1, p->pend[i]);
+ EMIT(O_BACK, i);
+ } else
+ SETERROR(REG_ESUBREG);
+ p->g->backrefs = 1;
+ break;
+ default:
+ handled = 0;
+ }
+ /* Don't proceed to the POSIX bits if we've already handled it */
+ if (handled)
+ break;
+ }
+#endif
switch (wc) {
case '<':
EMIT(OBOW, 0);
@@ -567,7 +627,7 @@ p_branch_eat_delim(struct parse *p, struct branchc *bc)
(void)bc;
nskip = 0;
- while (EAT('|'))
+ while (EATSPEC('|'))
++nskip;
return (nskip);
}
@@ -619,9 +679,15 @@ static bool
p_branch_empty(struct parse *p, struct branchc *bc)
{
+#if defined(LIBREGEX) && defined(NOTYET)
+ if (bc->outer)
+ p->g->iflags |= EMPTBR;
+ return (true);
+#else
(void)bc;
SETERROR(REG_EMPTY);
return (false);
+#endif
}
/*
@@ -713,7 +779,11 @@ p_re(struct parse *p,
}
if (p->post_parse != NULL)
p->post_parse(p, &bc);
- (void) REQUIRE(HERE() != bc.start, REG_EMPTY);
+ (void) REQUIRE(p->gnuext || HERE() != bc.start, REG_EMPTY);
+#ifdef LIBREGEX
+ if (HERE() == bc.start && !p_branch_empty(p, &bc))
+ break;
+#endif
if (!p->allowbranch)
break;
/*
@@ -740,101 +810,122 @@ static bool /* was the simple RE an unbackslashed $? */
p_simp_re(struct parse *p, struct branchc *bc)
{
int c;
+ int cc; /* convenient/control character */
int count;
int count2;
sopno pos;
+ bool handled;
int i;
wint_t wc;
sopno subno;
# define BACKSL (1<<CHAR_BIT)
pos = HERE(); /* repetition op, if any, covers from here */
+ handled = false;
assert(MORE()); /* caller should have ensured this */
c = GETNEXT();
if (c == '\\') {
(void)REQUIRE(MORE(), REG_EESCAPE);
- c = BACKSL | GETNEXT();
+ cc = GETNEXT();
+ c = BACKSL | cc;
+#ifdef LIBREGEX
+ if (p->gnuext) {
+ handled = true;
+ switch (c) {
+ case BACKSL|'W':
+ case BACKSL|'w':
+ case BACKSL|'S':
+ case BACKSL|'s':
+ p_b_pseudoclass(p, cc);
+ break;
+ default:
+ handled = false;
+ }
+ }
+#endif
}
- switch (c) {
- case '.':
- if (p->g->cflags&REG_NEWLINE)
- nonnewline(p);
- else
- EMIT(OANY, 0);
- break;
- case '[':
- p_bracket(p);
- break;
- case BACKSL|'<':
- EMIT(OBOW, 0);
- break;
- case BACKSL|'>':
- EMIT(OEOW, 0);
- break;
- case BACKSL|'{':
- SETERROR(REG_BADRPT);
- break;
- case BACKSL|'(':
- p->g->nsub++;
- subno = p->g->nsub;
- if (subno < NPAREN)
- p->pbegin[subno] = HERE();
- EMIT(OLPAREN, subno);
- /* the MORE here is an error heuristic */
- if (MORE() && !SEETWO('\\', ')'))
- p_re(p, '\\', ')');
- if (subno < NPAREN) {
- p->pend[subno] = HERE();
- assert(p->pend[subno] != 0);
+ if (!handled) {
+ switch (c) {
+ case '.':
+ if (p->g->cflags&REG_NEWLINE)
+ nonnewline(p);
+ else
+ EMIT(OANY, 0);
+ break;
+ case '[':
+ p_bracket(p);
+ break;
+ case BACKSL|'<':
+ EMIT(OBOW, 0);
+ break;
+ case BACKSL|'>':
+ EMIT(OEOW, 0);
+ break;
+ case BACKSL|'{':
+ SETERROR(REG_BADRPT);
+ break;
+ case BACKSL|'(':
+ p->g->nsub++;
+ subno = p->g->nsub;
+ if (subno < NPAREN)
+ p->pbegin[subno] = HERE();
+ EMIT(OLPAREN, subno);
+ /* the MORE here is an error heuristic */
+ if (MORE() && !SEETWO('\\', ')'))
+ p_re(p, '\\', ')');
+ if (subno < NPAREN) {
+ p->pend[subno] = HERE();
+ assert(p->pend[subno] != 0);
+ }
+ EMIT(ORPAREN, subno);
+ (void)REQUIRE(EATTWO('\\', ')'), REG_EPAREN);
+ break;
+ case BACKSL|')': /* should not get here -- must be user */
+ SETERROR(REG_EPAREN);
+ break;
+ case BACKSL|'1':
+ case BACKSL|'2':
+ case BACKSL|'3':
+ case BACKSL|'4':
+ case BACKSL|'5':
+ case BACKSL|'6':
+ case BACKSL|'7':
+ case BACKSL|'8':
+ case BACKSL|'9':
+ i = (c&~BACKSL) - '0';
+ assert(i < NPAREN);
+ if (p->pend[i] != 0) {
+ assert(i <= p->g->nsub);
+ EMIT(OBACK_, i);
+ assert(p->pbegin[i] != 0);
+ assert(OP(p->strip[p->pbegin[i]]) == OLPAREN);
+ assert(OP(p->strip[p->pend[i]]) == ORPAREN);
+ (void) dupl(p, p->pbegin[i]+1, p->pend[i]);
+ EMIT(O_BACK, i);
+ } else
+ SETERROR(REG_ESUBREG);
+ p->g->backrefs = 1;
+ break;
+ case '*':
+ /*
+ * Ordinary if used as the first character beyond BOL anchor of
+ * a (sub-)expression, counts as a bad repetition operator if it
+ * appears otherwise.
+ */
+ (void)REQUIRE(bc->nchain == 0, REG_BADRPT);
+ /* FALLTHROUGH */
+ default:
+ if (p->error != 0)
+ return (false); /* Definitely not $... */
+ p->next--;
+ wc = WGETNEXT();
+ if ((c & BACKSL) == 0 || may_escape(p, wc))
+ ordinary(p, wc);
+ else
+ SETERROR(REG_EESCAPE);
+ break;
}
- EMIT(ORPAREN, subno);
- (void)REQUIRE(EATTWO('\\', ')'), REG_EPAREN);
- break;
- case BACKSL|')': /* should not get here -- must be user */
- SETERROR(REG_EPAREN);
- break;
- case BACKSL|'1':
- case BACKSL|'2':
- case BACKSL|'3':
- case BACKSL|'4':
- case BACKSL|'5':
- case BACKSL|'6':
- case BACKSL|'7':
- case BACKSL|'8':
- case BACKSL|'9':
- i = (c&~BACKSL) - '0';
- assert(i < NPAREN);
- if (p->pend[i] != 0) {
- assert(i <= p->g->nsub);
- EMIT(OBACK_, i);
- assert(p->pbegin[i] != 0);
- assert(OP(p->strip[p->pbegin[i]]) == OLPAREN);
- assert(OP(p->strip[p->pend[i]]) == ORPAREN);
- (void) dupl(p, p->pbegin[i]+1, p->pend[i]);
- EMIT(O_BACK, i);
- } else
- SETERROR(REG_ESUBREG);
- p->g->backrefs = 1;
- break;
- case '*':
- /*
- * Ordinary if used as the first character beyond BOL anchor of
- * a (sub-)expression, counts as a bad repetition operator if it
- * appears otherwise.
- */
- (void)REQUIRE(bc->nchain == 0, REG_BADRPT);
- /* FALLTHROUGH */
- default:
- if (p->error != 0)
- return (false); /* Definitely not $... */
- p->next--;
- wc = WGETNEXT();
- if ((c & BACKSL) == 0 || may_escape(p, wc))
- ordinary(p, wc);
- else
- SETERROR(REG_EESCAPE);
- break;
}
if (EAT('*')) { /* implemented as +? */
@@ -843,6 +934,14 @@ p_simp_re(struct parse *p, struct branchc *bc)
ASTERN(O_PLUS, pos);
INSERT(OQUEST_, pos);
ASTERN(O_QUEST, pos);
+#ifdef LIBREGEX
+ } else if (p->gnuext && EATTWO('\\', '?')) {
+ INSERT(OQUEST_, pos);
+ ASTERN(O_QUEST, pos);
+ } else if (p->gnuext && EATTWO('\\', '+')) {
+ INSERT(OPLUS_, pos);
+ ASTERN(O_PLUS, pos);
+#endif
} else if (EATTWO('\\', '{')) {
count = p_count(p);
if (EAT(',')) {
@@ -1035,6 +1134,41 @@ p_b_term(struct parse *p, cset *cs)
}
/*
+ - p_b_pseudoclass - parse a pseudo-class (\w, \W, \s, \S)
+ == static int p_b_pseudoclass(struct parse *p, char c)
+ */
+static int
+p_b_pseudoclass(struct parse *p, char c) {
+ cset *cs;
+
+ if ((cs = allocset(p)) == NULL)
+ return(0);
+
+ if (p->g->cflags&REG_ICASE)
+ cs->icase = 1;
+
+ switch (c) {
+ case 'W':
+ cs->invert = 1;
+ /* PASSTHROUGH */
+ case 'w':
+ p_b_cclass_named(p, cs, "alnum");
+ break;
+ case 'S':
+ cs->invert = 1;
+ /* PASSTHROUGH */
+ case 's':
+ p_b_cclass_named(p, cs, "space");
+ break;
+ default:
+ return(0);
+ }
+
+ EMIT(OANYOF, (int)(cs - p->g->sets));
+ return(1);
+}
+
+/*
- p_b_cclass - parse a character-class name and deal with it
== static void p_b_cclass(struct parse *p, cset *cs);
*/
@@ -1043,7 +1177,6 @@ p_b_cclass(struct parse *p, cset *cs)
{
const char *sp = p->next;
size_t len;
- wctype_t wct;
char clname[16];
while (MORE() && isalpha((uch)PEEK()))
@@ -1055,6 +1188,17 @@ p_b_cclass(struct parse *p, cset *cs)
}
memcpy(clname, sp, len);
clname[len] = '\0';
+
+ p_b_cclass_named(p, cs, clname);
+}
+/*
+ - p_b_cclass_named - deal with a named character class
+ == static void p_b_cclass_named(struct parse *p, cset *cs, const char []);
+ */
+static void
+p_b_cclass_named(struct parse *p, cset *cs, const char clname[]) {
+ wctype_t wct;
+
if ((wct = wctype(clname)) == 0) {
SETERROR(REG_ECTYPE);
return;
diff --git a/lib/libc/regex/regex.3 b/lib/libc/regex/regex.3
index 8959272e9891..d22dec1e87f7 100644
--- a/lib/libc/regex/regex.3
+++ b/lib/libc/regex/regex.3
@@ -32,7 +32,7 @@
.\" @(#)regex.3 8.4 (Berkeley) 3/20/94
.\" $FreeBSD$
.\"
-.Dd May 25, 2016
+.Dd April 15, 2017
.Dt REGEX 3
.Os
.Sh NAME
@@ -183,6 +183,17 @@ compatible with but not specified by
.St -p1003.2 ,
and should be used with
caution in software intended to be portable to other systems.
+.It Dv REG_POSIX
+Compile only
+.St -p1003.2
+compliant expressions.
+This flag has no effect unless linking against
+.Nm libregex .
+This is an extension,
+compatible with but not specified by
+.St -p1003.2 ,
+and should be used with
+caution in software intended to be portable to other systems.
.El
.Pp
When successful,
diff --git a/lib/libc/regex/regex2.h b/lib/libc/regex/regex2.h
index a1a37172a55b..d608dc603683 100644
--- a/lib/libc/regex/regex2.h
+++ b/lib/libc/regex/regex2.h
@@ -182,6 +182,7 @@ struct re_guts {
# define USEBOL 01 /* used ^ */
# define USEEOL 02 /* used $ */
# define BAD 04 /* something wrong */
+# define EMPTBR 010 /* empty branch present */
int nbol; /* number of ^ used */
int neol; /* number of $ used */
char *must; /* match must contain this string */
diff --git a/lib/libc/riscv/gen/Makefile.inc b/lib/libc/riscv/gen/Makefile.inc
index 6380db6c265a..f13800829d7f 100644
--- a/lib/libc/riscv/gen/Makefile.inc
+++ b/lib/libc/riscv/gen/Makefile.inc
@@ -3,6 +3,8 @@
SRCS+= _ctx_start.S \
fabs.S \
flt_rounds.c \
+ fpgetmask.c \
+ fpsetmask.c \
infinity.c \
ldexp.c \
makecontext.c \
diff --git a/lib/libc/riscv/gen/fpgetmask.c b/lib/libc/riscv/gen/fpgetmask.c
new file mode 100644
index 000000000000..f461cc2ba10e
--- /dev/null
+++ b/lib/libc/riscv/gen/fpgetmask.c
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2020 Axiado
+ * All rights reserved.
+ *
+ * This software was developed by Kristof Provost under
+ * sponsorship from Axiado.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <ieeefp.h>
+
+fp_except_t
+fpgetmask(void)
+{
+
+ return (0);
+}
diff --git a/lib/libc/riscv/gen/fpsetmask.c b/lib/libc/riscv/gen/fpsetmask.c
new file mode 100644
index 000000000000..6eeac9de8bef
--- /dev/null
+++ b/lib/libc/riscv/gen/fpsetmask.c
@@ -0,0 +1,53 @@
+/*-
+ * Copyright (c) 2020 Axiado
+ * All rights reserved.
+ *
+ * This software was developed by Kristof Provost under
+ * sponsorship from Axiado.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <ieeefp.h>
+
+/**
+ * RISC-V doesn't support floating-point exceptions: RISC-V Instruction Set
+ * Manual: Volume I: User-Level ISA, 11.2 Floating-Point Control and Status
+ * Register: "As allowed by the standard, we do not support traps on
+ * floating-point exceptions in the base ISA, but instead require explicit
+ * checks of the flags in software. We considered adding branches controlled
+ * directly by the contents of the floating-point accrued exception flags, but
+ * ultimately chose to omit these instructions to keep the ISA simple."
+ *
+ * We still need this function, because some applications (notably Perl) call
+ * it, but we cannot provide a meaningful implementation.
+ **/
+fp_except_t
+fpsetmask(fp_except_t mask)
+{
+
+ return (0);
+}
diff --git a/lib/libc/stdio/tmpnam.3 b/lib/libc/stdio/tmpnam.3
index afe54f3b7247..6300a1725eba 100644
--- a/lib/libc/stdio/tmpnam.3
+++ b/lib/libc/stdio/tmpnam.3
@@ -32,7 +32,7 @@
.\" @(#)tmpnam.3 8.2 (Berkeley) 11/17/93
.\" $FreeBSD$
.\"
-.Dd March 18, 2007
+.Dd August 7, 2020
.Dt TMPFILE 3
.Os
.Sh NAME
@@ -156,6 +156,8 @@ on error.
.Bl -tag -width Ds
.It Ev TMPDIR
.Pf [ Fn tempnam
+and
+.Fn tmpfile
only]
If set,
the directory in which the temporary file is stored.
diff --git a/lib/libclang_rt/fuzzer/Makefile b/lib/libclang_rt/fuzzer/Makefile
index eb675063ddfc..91172f4b17c2 100644
--- a/lib/libclang_rt/fuzzer/Makefile
+++ b/lib/libclang_rt/fuzzer/Makefile
@@ -23,4 +23,8 @@ SRCS+= fuzzer/FuzzerUtil.cpp
SRCS+= fuzzer/FuzzerUtilLinux.cpp
SRCS+= fuzzer/FuzzerUtilPosix.cpp
+.PATH: ${CRTSRC}/include/fuzzer
+INCSDIR= ${CLANGDIR}/include/fuzzer
+INCS+= FuzzedDataProvider.h
+
.include <bsd.lib.mk>
diff --git a/lib/libclang_rt/profile/Makefile b/lib/libclang_rt/profile/Makefile
index 7c2fe3c9c133..c41da991a039 100644
--- a/lib/libclang_rt/profile/Makefile
+++ b/lib/libclang_rt/profile/Makefile
@@ -25,4 +25,8 @@ SRCS+= profile/InstrProfilingUtil.c
SRCS+= profile/InstrProfilingValue.c
SRCS+= profile/InstrProfilingWriter.c
+.PATH: ${CRTSRC}/include/profile
+INCSDIR= ${CLANGDIR}/include/profile
+INCS+= InstrProfData.inc
+
.include <bsd.lib.mk>
diff --git a/lib/libclang_rt/xray/Makefile b/lib/libclang_rt/xray/Makefile
index 7289c4a371b9..13e084816a3b 100644
--- a/lib/libclang_rt/xray/Makefile
+++ b/lib/libclang_rt/xray/Makefile
@@ -41,4 +41,10 @@ SRCS+= xray/xray_trampoline_x86_64.S
SRCS+= xray/xray_utils.cpp
SRCS+= xray/xray_x86_64.cpp
+.PATH: ${CRTSRC}/include/xray
+INCSDIR= ${CLANGDIR}/include/xray
+INCS+= xray_interface.h
+INCS+= xray_log_interface.h
+INCS+= xray_records.h
+
.include <bsd.lib.mk>
diff --git a/lib/libdevinfo/Makefile b/lib/libdevinfo/Makefile
index 8b67ab4c372a..7995660fb7fd 100644
--- a/lib/libdevinfo/Makefile
+++ b/lib/libdevinfo/Makefile
@@ -5,6 +5,16 @@ SRCS= devinfo.c
INCS= devinfo.h
MAN= devinfo.3
+MLINKS+=devinfo.3 devinfo_init.3
+MLINKS+=devinfo.3 devinfo_free.3
+MLINKS+=devinfo.3 devinfo_handle_to_device.3
+MLINKS+=devinfo.3 devinfo_handle_to_resource.3
+MLINKS+=devinfo.3 devinfo_handle_to_rman.3
+MLINKS+=devinfo.3 devinfo_foreach_device_child.3
+MLINKS+=devinfo.3 devinfo_foreach_device_resource.3
+MLINKS+=devinfo.3 devinfo_foreach_rman_resource.3
+MLINKS+=devinfo.3 devinfo_foreach_rman.3
+
SHLIB_MAJOR= 6
WARNS?= 3
diff --git a/lib/libdevinfo/devinfo.c b/lib/libdevinfo/devinfo.c
index c4cd8d78ba94..581d3464cd0e 100644
--- a/lib/libdevinfo/devinfo.c
+++ b/lib/libdevinfo/devinfo.c
@@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$");
static int devinfo_init_devices(int generation);
static int devinfo_init_resources(int generation);
+static void devinfo_free_dev(struct devinfo_i_dev *dd);
TAILQ_HEAD(,devinfo_i_dev) devinfo_dev;
TAILQ_HEAD(,devinfo_i_rman) devinfo_rman;
@@ -225,7 +226,7 @@ devinfo_init_devices(int generation)
rlen, sizeof(udev));
return (EINVAL);
}
- if ((dd = malloc(sizeof(*dd))) == NULL)
+ if ((dd = calloc(1, sizeof(*dd))) == NULL)
return(ENOMEM);
dd->dd_dev.dd_handle = udev.dv_handle;
dd->dd_dev.dd_parent = udev.dv_parent;
@@ -242,10 +243,14 @@ devinfo_init_devices(int generation)
dd->dd_location = NULL;
#define UNPACK(x) \
dd->dd_dev.x = dd->x = strdup(walker); \
- if (dd->x == NULL) \
+ if (dd->x == NULL) { \
+ devinfo_free_dev(dd); \
return(ENOMEM); \
- if (walker + strnlen(walker, ep - walker) >= ep) \
+ } \
+ if (walker + strnlen(walker, ep - walker) >= ep) { \
+ devinfo_free_dev(dd); \
return(EINVAL); \
+ } \
walker += strlen(walker) + 1;
UNPACK(dd_name);
@@ -365,6 +370,20 @@ devinfo_init_resources(int generation)
}
/*
+ * Free an individual dev.
+ */
+static void
+devinfo_free_dev(struct devinfo_i_dev *dd)
+{
+ free(dd->dd_name);
+ free(dd->dd_desc);
+ free(dd->dd_drivername);
+ free(dd->dd_pnpinfo);
+ free(dd->dd_location);
+ free(dd);
+}
+
+/*
* Free the list contents.
*/
void
@@ -376,12 +395,7 @@ devinfo_free(void)
while ((dd = TAILQ_FIRST(&devinfo_dev)) != NULL) {
TAILQ_REMOVE(&devinfo_dev, dd, dd_link);
- free(dd->dd_name);
- free(dd->dd_desc);
- free(dd->dd_drivername);
- free(dd->dd_pnpinfo);
- free(dd->dd_location);
- free(dd);
+ devinfo_free_dev(dd);
}
while ((dm = TAILQ_FIRST(&devinfo_rman)) != NULL) {
TAILQ_REMOVE(&devinfo_rman, dm, dm_link);
diff --git a/lib/libifconfig/Makefile b/lib/libifconfig/Makefile
index 8d510c537f82..f7d2dbf1c71d 100644
--- a/lib/libifconfig/Makefile
+++ b/lib/libifconfig/Makefile
@@ -13,15 +13,30 @@ SRCS= libifconfig.c \
libifconfig_inet6.c \
libifconfig_internal.c \
libifconfig_lagg.c \
- libifconfig_media.c
+ libifconfig_media.c \
+ libifconfig_sfp.c
+
+GEN= libifconfig_sfp_tables.h \
+ libifconfig_sfp_tables.c \
+ libifconfig_sfp_tables_internal.h
+
+SRCS+= ${GEN}
+
+.include <src.lua.mk>
+
+.SUFFIXES: .tpl.c .tpl.h
+.tpl.c.c .tpl.h.h: sfp.lua
+ ${LUA} ${.CURDIR}/sfp.lua ${.IMPSRC} >${.TARGET}
+
+CLEANFILES+= ${GEN}
# If libifconfig become public uncomment those two lines
#INCSDIR= ${INCLUDEDIR}
-#INCS= libifconfig.h
+#INCS= libifconfig.h libifconfig_sfp.h libifconfig_sfp_tables.h
#MAN= libifconfig.3
-CFLAGS+= -I${.CURDIR}
+CFLAGS+= -I${.CURDIR} -I${.OBJDIR}
NO_WCAST_ALIGN= yes
.include <bsd.lib.mk>
diff --git a/lib/libifconfig/libifconfig.h b/lib/libifconfig/libifconfig.h
index cd2929f315b4..ca8e8e817dc1 100644
--- a/lib/libifconfig/libifconfig.h
+++ b/lib/libifconfig/libifconfig.h
@@ -28,6 +28,10 @@
#pragma once
+#include <sys/types.h>
+
+#include <net/if.h>
+
#include <netinet/in.h>
#include <netinet6/in6_var.h>
diff --git a/lib/libifconfig/libifconfig_sfp.c b/lib/libifconfig/libifconfig_sfp.c
new file mode 100644
index 000000000000..54877cebfb91
--- /dev/null
+++ b/lib/libifconfig/libifconfig_sfp.c
@@ -0,0 +1,592 @@
+/*-
+ * Copyright (c) 2014, Alexander V. Chernikov
+ * Copyright (c) 2020, Ryan Moeller <freqlabs@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+
+#include <net/if.h>
+#include <net/sff8436.h>
+#include <net/sff8472.h>
+
+#include <math.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <libifconfig.h>
+#include <libifconfig_internal.h>
+#include <libifconfig_sfp.h>
+#include <libifconfig_sfp_tables_internal.h>
+
+#define SFF_8636_EXT_COMPLIANCE 0x80
+
+struct i2c_info {
+ struct ifreq ifr;
+ ifconfig_handle_t *h;
+ int error; /* Store first error */
+ enum sfp_id id; /* Module type */
+};
+
+static uint8_t
+find_zero_bit(const struct sfp_enum_metadata *table, int value, int sz)
+{
+ int v, m;
+
+ for (v = 1, m = 1 << (8 * sz); v < m; v <<= 1) {
+ if ((value & v) == 0)
+ continue;
+ if (find_metadata(table, value & v) != NULL) {
+ return (value & v);
+ }
+ }
+ return (0);
+}
+
+/*
+ * Reads i2c data from opened kernel socket.
+ */
+static int
+read_i2c(struct i2c_info *ii, uint8_t addr, uint8_t off, uint8_t len,
+ uint8_t *buf)
+{
+ struct ifi2creq req;
+ int i, l;
+
+ if (ii->error != 0)
+ return (ii->error);
+
+ ii->ifr.ifr_data = (caddr_t)&req;
+
+ i = 0;
+ l = 0;
+ memset(&req, 0, sizeof(req));
+ req.dev_addr = addr;
+ req.offset = off;
+ req.len = len;
+
+ while (len > 0) {
+ l = MIN(sizeof(req.data), len);
+ req.len = l;
+ if (ifconfig_ioctlwrap(ii->h, AF_LOCAL, SIOCGI2C,
+ &ii->ifr) != 0) {
+ ii->error = errno;
+ return (errno);
+ }
+
+ memcpy(&buf[i], req.data, l);
+ len -= l;
+ i += l;
+ req.offset += l;
+ }
+
+ return (0);
+}
+
+static int
+i2c_info_init(struct i2c_info *ii, ifconfig_handle_t *h, const char *name)
+{
+ uint8_t id_byte;
+
+ memset(ii, 0, sizeof(*ii));
+ strlcpy(ii->ifr.ifr_name, name, sizeof(ii->ifr.ifr_name));
+ ii->h = h;
+
+ /*
+ * Try to read byte 0 from i2c:
+ * Both SFF-8472 and SFF-8436 use it as
+ * 'identification byte'.
+ * Stop reading status on zero as value -
+ * this might happen in case of empty transceiver slot.
+ */
+ id_byte = 0;
+ read_i2c(ii, SFF_8472_BASE, SFF_8472_ID, 1, &id_byte);
+ if (ii->error != 0)
+ return (-1);
+ if (id_byte == 0) {
+ h->error.errtype = OTHER;
+ h->error.errcode = ENOENT;
+ return (-1);
+ }
+ ii->id = id_byte;
+ return (0);
+}
+
+static int
+get_sfp_info(struct i2c_info *ii, struct ifconfig_sfp_info *sfp)
+{
+ uint8_t code;
+
+ read_i2c(ii, SFF_8472_BASE, SFF_8472_ID, 1, &sfp->sfp_id);
+ read_i2c(ii, SFF_8472_BASE, SFF_8472_CONNECTOR, 1, &sfp->sfp_conn);
+
+ /* Use extended compliance code if it's valid */
+ read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS, 1, &sfp->sfp_eth_ext);
+ if (sfp->sfp_eth_ext == 0) {
+ /* Next, check 10G Ethernet/IB CCs */
+ read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 1, &code);
+ sfp->sfp_eth_10g = find_zero_bit(sfp_eth_10g_table, code, 1);
+ if (sfp->sfp_eth_10g == 0) {
+ /* No match. Try Ethernet 1G */
+ read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START + 3,
+ 1, &code);
+ sfp->sfp_eth = find_zero_bit(sfp_eth_table, code, 1);
+ }
+ }
+
+ return (ii->error);
+}
+
+static int
+get_qsfp_info(struct i2c_info *ii, struct ifconfig_sfp_info *sfp)
+{
+ uint8_t code;
+
+ read_i2c(ii, SFF_8436_BASE, SFF_8436_ID, 1, &sfp->sfp_id);
+ read_i2c(ii, SFF_8436_BASE, SFF_8436_CONNECTOR, 1, &sfp->sfp_conn);
+
+ read_i2c(ii, SFF_8436_BASE, SFF_8436_STATUS, 1, &sfp->sfp_rev);
+
+ /* Check for extended specification compliance */
+ read_i2c(ii, SFF_8436_BASE, SFF_8436_CODE_E1040100G, 1, &code);
+ if (code & SFF_8636_EXT_COMPLIANCE) {
+ read_i2c(ii, SFF_8436_BASE, SFF_8436_OPTIONS_START, 1,
+ &sfp->sfp_eth_ext);
+ } else {
+ /* Check 10/40G Ethernet class only */
+ sfp->sfp_eth_1040g =
+ find_zero_bit(sfp_eth_1040g_table, code, 1);
+ }
+
+ return (ii->error);
+}
+
+int
+ifconfig_sfp_get_sfp_info(ifconfig_handle_t *h,
+ const char *name, struct ifconfig_sfp_info *sfp)
+{
+ struct i2c_info ii;
+ char buf[8];
+
+ memset(sfp, 0, sizeof(*sfp));
+
+ if (i2c_info_init(&ii, h, name) != 0)
+ return (-1);
+
+ /* Read bytes 3-10 at once */
+ read_i2c(&ii, SFF_8472_BASE, SFF_8472_TRANS_START, 8, buf);
+ if (ii.error != 0)
+ return (ii.error);
+
+ /* Check 10G ethernet first */
+ sfp->sfp_eth_10g = find_zero_bit(sfp_eth_10g_table, buf[0], 1);
+ if (sfp->sfp_eth_10g == 0) {
+ /* No match. Try 1G */
+ sfp->sfp_eth = find_zero_bit(sfp_eth_table, buf[3], 1);
+ }
+ sfp->sfp_fc_len = find_zero_bit(sfp_fc_len_table, buf[4], 1);
+ sfp->sfp_fc_media = find_zero_bit(sfp_fc_media_table, buf[6], 1);
+ sfp->sfp_fc_speed = find_zero_bit(sfp_fc_speed_table, buf[7], 1);
+ sfp->sfp_cab_tech =
+ find_zero_bit(sfp_cab_tech_table, (buf[4] << 8) | buf[5], 2);
+
+ if (ifconfig_sfp_id_is_qsfp(ii.id))
+ return (get_qsfp_info(&ii, sfp));
+ return (get_sfp_info(&ii, sfp));
+}
+
+static size_t
+channel_count(enum sfp_id id)
+{
+ /* TODO: other ids */
+ switch (id) {
+ case SFP_ID_UNKNOWN:
+ return (0);
+ case SFP_ID_QSFP:
+ case SFP_ID_QSFPPLUS:
+ case SFP_ID_QSFP28:
+ return (4);
+ default:
+ return (1);
+ }
+}
+
+size_t
+ifconfig_sfp_channel_count(const struct ifconfig_sfp_info *sfp)
+{
+ return (channel_count(sfp->sfp_id));
+}
+
+/*
+ * Print SFF-8472/SFF-8436 string to supplied buffer.
+ * All (vendor-specific) strings are padded right with '0x20'.
+ */
+static void
+get_sff_string(struct i2c_info *ii, uint8_t addr, uint8_t off, char *dst)
+{
+ read_i2c(ii, addr, off, SFF_VENDOR_STRING_SIZE, dst);
+ dst += SFF_VENDOR_STRING_SIZE;
+ do { *dst-- = '\0'; } while (*dst == 0x20);
+}
+
+static void
+get_sff_date(struct i2c_info *ii, uint8_t addr, uint8_t off, char *dst)
+{
+ char buf[SFF_VENDOR_DATE_SIZE];
+
+ read_i2c(ii, addr, off, SFF_VENDOR_DATE_SIZE, buf);
+ sprintf(dst, "20%c%c-%c%c-%c%c", buf[0], buf[1], buf[2], buf[3],
+ buf[4], buf[5]);
+}
+
+static int
+get_sfp_vendor_info(struct i2c_info *ii, struct ifconfig_sfp_vendor_info *vi)
+{
+ get_sff_string(ii, SFF_8472_BASE, SFF_8472_VENDOR_START, vi->name);
+ get_sff_string(ii, SFF_8472_BASE, SFF_8472_PN_START, vi->pn);
+ get_sff_string(ii, SFF_8472_BASE, SFF_8472_SN_START, vi->sn);
+ get_sff_date(ii, SFF_8472_BASE, SFF_8472_DATE_START, vi->date);
+ return (ii->error);
+}
+
+static int
+get_qsfp_vendor_info(struct i2c_info *ii, struct ifconfig_sfp_vendor_info *vi)
+{
+ get_sff_string(ii, SFF_8436_BASE, SFF_8436_VENDOR_START, vi->name);
+ get_sff_string(ii, SFF_8436_BASE, SFF_8436_PN_START, vi->pn);
+ get_sff_string(ii, SFF_8436_BASE, SFF_8436_SN_START, vi->sn);
+ get_sff_date(ii, SFF_8436_BASE, SFF_8436_DATE_START, vi->date);
+ return (ii->error);
+}
+
+int
+ifconfig_sfp_get_sfp_vendor_info(ifconfig_handle_t *h,
+ const char *name, struct ifconfig_sfp_vendor_info *vi)
+{
+ struct i2c_info ii;
+
+ memset(vi, 0, sizeof(*vi));
+
+ if (i2c_info_init(&ii, h, name) != 0)
+ return (-1);
+
+ if (ifconfig_sfp_id_is_qsfp(ii.id))
+ return (get_qsfp_vendor_info(&ii, vi));
+ return (get_sfp_vendor_info(&ii, vi));
+}
+
+/*
+ * Converts internal temperature (SFF-8472, SFF-8436)
+ * 16-bit unsigned value to human-readable representation:
+ *
+ * Internally measured Module temperature are represented
+ * as a 16-bit signed twos complement value in increments of
+ * 1/256 degrees Celsius, yielding a total range of 鈥128C to +128C
+ * that is considered valid between 鈥40 and +125C.
+ */
+static double
+get_sff_temp(struct i2c_info *ii, uint8_t addr, uint8_t off)
+{
+ double d;
+ uint8_t buf[2];
+
+ read_i2c(ii, addr, off, 2, buf);
+ d = (double)buf[0];
+ d += (double)buf[1] / 256;
+ return (d);
+}
+
+/*
+ * Retrieves supplied voltage (SFF-8472, SFF-8436).
+ * 16-bit usigned value, treated as range 0..+6.55 Volts
+ */
+static double
+get_sff_voltage(struct i2c_info *ii, uint8_t addr, uint8_t off)
+{
+ double d;
+ uint8_t buf[2];
+
+ read_i2c(ii, addr, off, 2, buf);
+ d = (double)((buf[0] << 8) | buf[1]);
+ return (d / 10000);
+}
+
+/*
+ * The following conversions assume internally-calibrated data.
+ * This is always true for SFF-8346, and explicitly checked for SFF-8472.
+ */
+
+double
+power_mW(uint16_t power)
+{
+ /* Power is specified in units of 0.1 uW. */
+ return (1.0 * power / 10000);
+}
+
+double
+power_dBm(uint16_t power)
+{
+ return (10.0 * log10(power_mW(power)));
+}
+
+double
+bias_mA(uint16_t bias)
+{
+ /* Bias current is specified in units of 2 uA. */
+ return (1.0 * bias / 500);
+}
+
+static uint16_t
+get_sff_channel(struct i2c_info *ii, uint8_t addr, uint8_t off)
+{
+ uint8_t buf[2];
+
+ read_i2c(ii, addr, off, 2, buf);
+ if (ii->error != 0)
+ return (0);
+
+ return ((buf[0] << 8) + buf[1]);
+}
+
+static int
+get_sfp_status(struct i2c_info *ii, struct ifconfig_sfp_status *ss)
+{
+ uint8_t diag_type, flags;
+
+ /* Read diagnostic monitoring type */
+ read_i2c(ii, SFF_8472_BASE, SFF_8472_DIAG_TYPE, 1, (caddr_t)&diag_type);
+ if (ii->error != 0)
+ return (-1);
+
+ /*
+ * Read monitoring data IFF it is supplied AND is
+ * internally calibrated
+ */
+ flags = SFF_8472_DDM_DONE | SFF_8472_DDM_INTERNAL;
+ if ((diag_type & flags) != flags) {
+ ii->h->error.errtype = OTHER;
+ ii->h->error.errcode = ENXIO;
+ return (-1);
+ }
+
+ ss->temp = get_sff_temp(ii, SFF_8472_DIAG, SFF_8472_TEMP);
+ ss->voltage = get_sff_voltage(ii, SFF_8472_DIAG, SFF_8472_VCC);
+ ss->channel = calloc(channel_count(ii->id), sizeof(*ss->channel));
+ if (ss->channel == NULL) {
+ ii->h->error.errtype = OTHER;
+ ii->h->error.errcode = ENOMEM;
+ return (-1);
+ }
+ ss->channel[0].rx = get_sff_channel(ii, SFF_8472_DIAG, SFF_8472_RX_POWER);
+ ss->channel[0].tx = get_sff_channel(ii, SFF_8472_DIAG, SFF_8472_TX_BIAS);
+ return (ii->error);
+}
+
+static uint32_t
+get_qsfp_bitrate(struct i2c_info *ii)
+{
+ uint8_t code;
+ uint32_t rate;
+
+ code = 0;
+ read_i2c(ii, SFF_8436_BASE, SFF_8436_BITRATE, 1, &code);
+ rate = code * 100;
+ if (code == 0xFF) {
+ read_i2c(ii, SFF_8436_BASE, SFF_8636_BITRATE, 1, &code);
+ rate = code * 250;
+ }
+
+ return (rate);
+}
+
+static int
+get_qsfp_status(struct i2c_info *ii, struct ifconfig_sfp_status *ss)
+{
+ size_t channels;
+
+ ss->temp = get_sff_temp(ii, SFF_8436_BASE, SFF_8436_TEMP);
+ ss->voltage = get_sff_voltage(ii, SFF_8436_BASE, SFF_8436_VCC);
+ channels = channel_count(ii->id);
+ ss->channel = calloc(channels, sizeof(*ss->channel));
+ if (ss->channel == NULL) {
+ ii->h->error.errtype = OTHER;
+ ii->h->error.errcode = ENOMEM;
+ return (-1);
+ }
+ for (size_t chan = 0; chan < channels; ++chan) {
+ uint8_t rxoffs = SFF_8436_RX_CH1_MSB + chan * sizeof(uint16_t);
+ uint8_t txoffs = SFF_8436_TX_CH1_MSB + chan * sizeof(uint16_t);
+ ss->channel[chan].rx =
+ get_sff_channel(ii, SFF_8436_BASE, rxoffs);
+ ss->channel[chan].tx =
+ get_sff_channel(ii, SFF_8436_BASE, txoffs);
+ }
+ ss->bitrate = get_qsfp_bitrate(ii);
+ return (ii->error);
+}
+
+int
+ifconfig_sfp_get_sfp_status(ifconfig_handle_t *h, const char *name,
+ struct ifconfig_sfp_status *ss)
+{
+ struct i2c_info ii;
+
+ memset(ss, 0, sizeof(*ss));
+
+ if (i2c_info_init(&ii, h, name) != 0)
+ return (-1);
+
+ if (ifconfig_sfp_id_is_qsfp(ii.id))
+ return (get_qsfp_status(&ii, ss));
+ return (get_sfp_status(&ii, ss));
+}
+
+void
+ifconfig_sfp_free_sfp_status(struct ifconfig_sfp_status *ss)
+{
+ if (ss != NULL)
+ free(ss->channel);
+}
+
+static const char *
+sfp_id_string_alt(uint8_t value)
+{
+ const char *id;
+
+ if (value <= SFF_8024_ID_LAST)
+ id = sff_8024_id[value];
+ else if (value > 0x80)
+ id = "Vendor specific";
+ else
+ id = "Reserved";
+
+ return (id);
+}
+
+static const char *
+sfp_conn_string_alt(uint8_t value)
+{
+ const char *conn;
+
+ if (value >= 0x0D && value <= 0x1F)
+ conn = "Unallocated";
+ else if (value >= 0x24 && value <= 0x7F)
+ conn = "Unallocated";
+ else
+ conn = "Vendor specific";
+
+ return (conn);
+}
+
+void
+ifconfig_sfp_get_sfp_info_strings(const struct ifconfig_sfp_info *sfp,
+ struct ifconfig_sfp_info_strings *strings)
+{
+ get_sfp_info_strings(sfp, strings);
+ if (strings->sfp_id == NULL)
+ strings->sfp_id = sfp_id_string_alt(sfp->sfp_id);
+ if (strings->sfp_conn == NULL)
+ strings->sfp_conn = sfp_conn_string_alt(sfp->sfp_conn);
+ if (strings->sfp_rev == NULL)
+ strings->sfp_rev = "Unallocated";
+}
+
+const char *
+ifconfig_sfp_physical_spec(const struct ifconfig_sfp_info *sfp,
+ const struct ifconfig_sfp_info_strings *strings)
+{
+ switch (sfp->sfp_id) {
+ case SFP_ID_UNKNOWN:
+ break;
+ case SFP_ID_QSFP:
+ case SFP_ID_QSFPPLUS:
+ case SFP_ID_QSFP28:
+ if (sfp->sfp_eth_1040g & SFP_ETH_1040G_EXTENDED)
+ return (strings->sfp_eth_ext);
+ else if (sfp->sfp_eth_1040g)
+ return (strings->sfp_eth_1040g);
+ break;
+ default:
+ if (sfp->sfp_eth_ext)
+ return (strings->sfp_eth_ext);
+ else if (sfp->sfp_eth_10g)
+ return (strings->sfp_eth_10g);
+ else if (sfp->sfp_eth)
+ return (strings->sfp_eth);
+ break;
+ }
+ return ("Unknown");
+}
+
+int
+ifconfig_sfp_get_sfp_dump(ifconfig_handle_t *h, const char *name,
+ struct ifconfig_sfp_dump *dump)
+{
+ struct i2c_info ii;
+ uint8_t *buf = dump->data;
+
+ memset(dump->data, 0, sizeof(dump->data));
+
+ if (i2c_info_init(&ii, h, name) != 0)
+ return (-1);
+
+ if (ifconfig_sfp_id_is_qsfp(ii.id)) {
+ read_i2c(&ii, SFF_8436_BASE, QSFP_DUMP0_START, QSFP_DUMP0_SIZE,
+ buf + QSFP_DUMP0_START);
+ read_i2c(&ii, SFF_8436_BASE, QSFP_DUMP1_START, QSFP_DUMP1_SIZE,
+ buf + QSFP_DUMP1_START);
+ } else {
+ read_i2c(&ii, SFF_8472_BASE, SFP_DUMP_START, SFP_DUMP_SIZE,
+ buf + SFP_DUMP_START);
+ }
+
+ return (ii.error != 0 ? -1 : 0);
+}
+
+size_t
+ifconfig_sfp_dump_region_count(const struct ifconfig_sfp_dump *dp)
+{
+ uint8_t id_byte = dp->data[0];
+
+ switch ((enum sfp_id)id_byte) {
+ case SFP_ID_UNKNOWN:
+ return (0);
+ case SFP_ID_QSFP:
+ case SFP_ID_QSFPPLUS:
+ case SFP_ID_QSFP28:
+ return (2);
+ default:
+ return (1);
+ }
+}
diff --git a/lib/libifconfig/libifconfig_sfp.h b/lib/libifconfig/libifconfig_sfp.h
new file mode 100644
index 000000000000..e64666b7bd76
--- /dev/null
+++ b/lib/libifconfig/libifconfig_sfp.h
@@ -0,0 +1,219 @@
+/*-
+ * Copyright (c) 2014, Alexander V. Chernikov
+ * Copyright (c) 2020, Ryan Moeller <freqlabs@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#pragma once
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#include <libifconfig.h>
+#include <libifconfig_sfp_tables.h>
+
+/** SFP module information in raw numeric form
+ * These are static properties of the hardware.
+ */
+struct ifconfig_sfp_info;
+
+/** SFP module information formatted as strings
+ * These are static strings that do not need to be freed.
+ */
+struct ifconfig_sfp_info_strings;
+
+#define SFF_VENDOR_STRING_SIZE 16 /**< max chars in a vendor string */
+#define SFF_VENDOR_DATE_SIZE 6 /**< chars in a vendor date code */
+
+/** SFP module vendor info strings */
+struct ifconfig_sfp_vendor_info {
+ char name[SFF_VENDOR_STRING_SIZE + 1]; /**< vendor name */
+ char pn[SFF_VENDOR_STRING_SIZE + 1]; /**< vendor part number */
+ char sn[SFF_VENDOR_STRING_SIZE + 1]; /**< vendor serial number */
+ char date[SFF_VENDOR_DATE_SIZE + 5]; /**< formatted vendor date */
+};
+
+/** SFP module status
+ * These are dynamic properties of the hardware.
+ */
+struct ifconfig_sfp_status {
+ double temp; /**< module temperature in degrees C,
+ valid range -40.0 to 125.0 */
+ double voltage; /**< module voltage in volts */
+ struct sfp_channel {
+ uint16_t rx; /**< channel receive power, LSB 0.1uW */
+ uint16_t tx; /**< channel transmit bias current, LSB 2uA */
+ } *channel; /**< array of channel rx/tx status */
+ uint32_t bitrate; /**< link bitrate,
+ only present for QSFP modules,
+ zero for SFP modules */
+};
+
+#define SFF_DUMP_SIZE 256 /**< size of the memory dump buffer */
+
+#define SFP_DUMP_START 0 /**< start address of an SFP module dump */
+#define SFP_DUMP_SIZE 128 /**< bytes in an SFP module dump */
+
+#define QSFP_DUMP0_START 0 /**< start address of the first region
+ in a QSFP module dump */
+#define QSFP_DUMP0_SIZE 82 /**< bytes in the first region
+ in a QSFP module dump */
+#define QSFP_DUMP1_START 128 /**< start address of the second region
+ in a QSFP module dump */
+#define QSFP_DUMP1_SIZE 128 /**< bytes in the second region
+ in a QSFP module dump */
+
+/** SFP module I2C memory dump
+ * SFP modules have one region, QSFP modules have two regions.
+ */
+struct ifconfig_sfp_dump {
+ uint8_t data[SFF_DUMP_SIZE]; /**< memory dump data */
+};
+
+/** Get information about the static properties of an SFP/QSFP module
+ * The information is returned in numeric form.
+ * @see ifconfig_sfp_get_sfp_info_strings to get corresponding strings.
+ * @param h An open ifconfig state handle
+ * @param name The name of an interface
+ * @param sfp Pointer to an object to fill, will be zeroed by this function
+ * @return 0 if successful, -1 with error info set in the handle otherwise
+ */
+int ifconfig_sfp_get_sfp_info(ifconfig_handle_t *h, const char *name,
+ struct ifconfig_sfp_info *sfp);
+
+/** Get the number of channels present on the given module
+ * @param sfp Pointer to a filled SFP module info object
+ * @return The number of channels or 0 if unknown
+ */
+size_t ifconfig_sfp_channel_count(const struct ifconfig_sfp_info *sfp);
+
+/** Is the given module ID a QSFP
+ * NB: This convenience function is implemented in the header to keep the
+ * classification criteria visible to the user.
+ * @param id The sfp_id field of a SFP module info object
+ * @return A bool true if QSFP-type sfp_id otherwise false
+ */
+static inline bool
+ifconfig_sfp_id_is_qsfp(enum sfp_id id)
+{
+ switch (id) {
+ case SFP_ID_QSFP:
+ case SFP_ID_QSFPPLUS:
+ case SFP_ID_QSFP28:
+ return (true);
+ default:
+ return (false);
+ }
+}
+
+/** Get string descriptions of the given SFP/QSFP module info
+ * The strings are static and do not need to be freed.
+ * @see ifconfig_sfp_get_sfp_info to obtain the input info.
+ * @param sfp Pointer to a filled SFP module info object
+ * @param strings Pointer to an object to be filled with pointers to
+ * static strings describing the given info
+ */
+void ifconfig_sfp_get_sfp_info_strings(const struct ifconfig_sfp_info *sfp,
+ struct ifconfig_sfp_info_strings *strings);
+
+/** Get a string describing the given SFP/QSFP module's physical layer spec
+ * The correct field in ifconfig_sfp_info varies depending on the module. This
+ * function chooses the appropriate string based on the provided module info.
+ * The string returned is static and does not need to be freed.
+ * @param sfp Pointer to a filled SFP module info object
+ * @param strings Pointer to a filled SFP module strings object
+ * @return Pointer to a static string describing the module's spec
+ */
+const char *ifconfig_sfp_physical_spec(const struct ifconfig_sfp_info *sfp,
+ const struct ifconfig_sfp_info_strings *strings);
+
+/** Get the vendor info strings from an SFP/QSFP module
+ * @param h An open ifconfig state handle
+ * @param name The name of an interface
+ * @param vi Pointer to an object to be filled with the vendor info strings,
+ * will be zeroed by this function
+ * @return 0 if successful, -1 with error info set in the handle otherwise
+ */
+int ifconfig_sfp_get_sfp_vendor_info(ifconfig_handle_t *h, const char *name,
+ struct ifconfig_sfp_vendor_info *vi);
+
+/** Get the status of an SFP/QSFP module's dynamic properties
+ * @see ifconfig_sfp_free_sfp_status to free the allocations
+ * @param h An open ifconfig state handle
+ * @param name The name of an interface
+ * @param ss Pointer to an object to be filled with the module's status
+ * @return 0 if successful, -1 with error info set in the handle otherwise
+ * where the errcode `ENXIO` indicates an SFP module that is not
+ * calibrated or does not provide diagnostic status measurements
+ */
+int ifconfig_sfp_get_sfp_status(ifconfig_handle_t *h, const char *name,
+ struct ifconfig_sfp_status *ss);
+
+/** Free the memory allocations in an ifconfig_sfp_status struct
+ * @param ss Pointer to an object whose internal allocations are to be freed
+ * if not NULL
+ */
+void ifconfig_sfp_free_sfp_status(struct ifconfig_sfp_status *ss);
+
+/** Dump the I2C memory of an SFP/QSFP module
+ * SFP modules have one memory region dumped, QSFP modules have two.
+ * @param h An open ifconfig state handle
+ * @param name The name of an interface
+ * @param buf Pointer to a dump data buffer object
+ * @return 0 if successful, -1 with error info set in the handle otherwise
+ */
+int ifconfig_sfp_get_sfp_dump(ifconfig_handle_t *h, const char *name,
+ struct ifconfig_sfp_dump *buf);
+
+/** Get the number of I2C memory dump regions present in the given dump
+ * @param dp Pointer to a filled dump data buffer object
+ * @return The number of regions or 0 if unknown
+ */
+size_t ifconfig_sfp_dump_region_count(const struct ifconfig_sfp_dump *dp);
+
+/** Convert channel power to milliwatts power
+ * This is provided as a convenience for displaying channel power levels.
+ * @see (struct ifconfig_sfp_status).channel
+ * @param power Power in 0.1 mW units
+ * @return Power in milliwatts (mW)
+ */
+double power_mW(uint16_t power);
+
+/** Convert channel power to decibel-milliwats power level
+ * This is provided as a convenience for displaying channel power levels.
+ * @see (struct ifconfig_sfp_status).channel
+ * @param power Power in 0.1 mW units
+ * @return Power level in decibel-milliwatts (dBm)
+ */
+
+double power_dBm(uint16_t power);
+
+/** Convert channel bias current to milliamps
+ * This is provided as a convenience for displaying channel bias currents.
+ * @see (struct ifconfig_sfp_status).channel
+ * @param bias Bias current in 2 mA units
+ * @return Bias current in milliamps (mA)
+ */
+double bias_mA(uint16_t bias);
diff --git a/lib/libifconfig/libifconfig_sfp_tables.tpl.c b/lib/libifconfig/libifconfig_sfp_tables.tpl.c
new file mode 100644
index 000000000000..1397e7d19618
--- /dev/null
+++ b/lib/libifconfig/libifconfig_sfp_tables.tpl.c
@@ -0,0 +1,124 @@
+/*-
+ * Copyright (c) 2020, Ryan Moeller <freqlabs@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+{# THIS IS A TEMPLATE PROCESSED BY lib/libifconfig/sfp.lua #}
+
+#include <libifconfig_sfp_tables.h>
+#include <libifconfig_sfp_tables_internal.h>
+
+struct sfp_enum_metadata {
+ int value; /* numeric discriminant value */
+ const char *symbol; /* symbolic name */
+ const char *description; /* brief description */
+ const char *display; /* shortened display name */
+};
+
+const struct sfp_enum_metadata *
+find_metadata(const struct sfp_enum_metadata *table, int value)
+{
+ while (table->value != value && table->symbol != NULL)
+ ++table;
+ return (table->symbol != NULL ? table : NULL);
+}
+
+{%
+for _, ent in ipairs(enums) do
+ if type(ent) == "string" then
+%}
+/*
+ * {*ent*}
+ */
+
+{%
+ else
+ local enum = ent
+ local name = "sfp_"..enum.name
+ local sym, desc, disp
+%}
+static const struct sfp_enum_metadata {*name*}_table_[] = {
+{%
+ for _, item in ipairs(enum.values) do
+ _, sym, desc, disp = table.unpack(item)
+ local symbol = string.upper(name).."_"..sym
+%}
+ {
+ .value = {*symbol*},
+ .symbol = "{*symbol*}",
+ .description = "{*desc*}",
+{%
+ if disp then
+%}
+ .display = "{*disp*}",
+{%
+ end
+%}
+ },
+{%
+ end
+%}
+ {0}
+};
+const struct sfp_enum_metadata *{*name*}_table = {*name*}_table_;
+
+const char *
+ifconfig_{*name*}_symbol(enum {*name*} v)
+{
+ const struct sfp_enum_metadata *metadata;
+
+ if ((metadata = find_metadata({*name*}_table, v)) == NULL)
+ return (NULL);
+ return (metadata->symbol);
+}
+
+const char *
+ifconfig_{*name*}_description(enum {*name*} v)
+{
+ const struct sfp_enum_metadata *metadata;
+
+ if ((metadata = find_metadata({*name*}_table, v)) == NULL)
+ return (NULL);
+ return (metadata->description);
+}
+
+{%
+ if disp then
+%}
+const char *
+ifconfig_{*name*}_display(enum {*name*} v)
+{
+ const struct sfp_enum_metadata *metadata;
+
+ if ((metadata = find_metadata({*name*}_table, v)) == NULL)
+ return (NULL);
+ return (metadata->display);
+}
+
+{%
+ end
+ end
+end
+%}
diff --git a/lib/libifconfig/libifconfig_sfp_tables.tpl.h b/lib/libifconfig/libifconfig_sfp_tables.tpl.h
new file mode 100644
index 000000000000..7e7c45351756
--- /dev/null
+++ b/lib/libifconfig/libifconfig_sfp_tables.tpl.h
@@ -0,0 +1,130 @@
+/*-
+ * Copyright (c) 2020, Ryan Moeller <freqlabs@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+{# THIS IS A TEMPLATE PROCESSED BY lib/libifconfig/sfp.lua #}
+
+#pragma once
+
+#include <stdint.h>
+
+{%
+for _, ent in ipairs(enums) do
+ if type(ent) == "string" then
+%}
+/*
+ * {*ent*}
+ */
+
+{%
+ else
+ local enum = ent
+ local name = "sfp_"..enum.name
+ local num, sym, desc, disp
+%}
+/** {*enum.description*} */
+enum {*name*} {
+{%
+ for _, item in ipairs(enum.values) do
+ val, sym, desc, disp = table.unpack(item)
+ local symbol = string.upper(name).."_"..sym
+%}
+ {*symbol*} = {*val*}, /**< {*desc*} */
+{%
+ end
+%}
+};
+
+/** Get the symbolic name of a given {*name*} value */
+const char *ifconfig_{*name*}_symbol(enum {*name*});
+
+/** Get a brief description of a given {*name*} value */
+const char *ifconfig_{*name*}_description(enum {*name*});
+
+{%
+ if disp then
+%}
+/** Get a shortened user-friendly display name for a given {*name*} value */
+const char *ifconfig_{*name*}_display(enum {*name*});
+
+{%
+ end
+ end
+end
+%}
+/*
+ * Descriptions of each enum
+ */
+
+{%
+for _, ent in ipairs(enums) do
+ if type(ent) == "table" then
+ local enum = ent
+ local name = "sfp_"..enum.name
+%}
+/** Get a brief description of the {*name*} enum */
+static inline const char *
+ifconfig_enum_{*name*}_description(void)
+{
+ return ("{*enum.description*}");
+}
+
+{%
+ end
+end
+%}
+/*
+ * Info struct definitions
+ */
+
+struct ifconfig_sfp_info {
+{%
+for _, ent in ipairs(enums) do
+ if type(ent) == "table" then
+ local enum = ent
+ local name = "sfp_"..enum.name
+ local t = string.format("uint%d_t", enum.bits)
+%}
+ {*t*} {*name*}; /**< {*enum.description*} */
+{%
+ end
+end
+%}
+};
+
+struct ifconfig_sfp_info_strings {
+{%
+for _, ent in ipairs(enums) do
+ if type(ent) == "table" then
+ local enum = ent
+ local name = "sfp_"..enum.name
+%}
+ const char *{*name*}; /**< {*enum.description*} */
+{%
+ end
+end
+%}
+};
diff --git a/lib/libifconfig/libifconfig_sfp_tables_internal.tpl.h b/lib/libifconfig/libifconfig_sfp_tables_internal.tpl.h
new file mode 100644
index 000000000000..a242d498ef0c
--- /dev/null
+++ b/lib/libifconfig/libifconfig_sfp_tables_internal.tpl.h
@@ -0,0 +1,66 @@
+/*-
+ * Copyright (c) 2020, Ryan Moeller <freqlabs@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+{# THIS IS A TEMPLATE PROCESSED BY lib/libifconfig/sfp.lua #}
+
+#pragma once
+
+#include <libifconfig_sfp.h>
+#include <libifconfig_sfp_tables.h>
+
+struct sfp_enum_metadata;
+const struct sfp_enum_metadata *find_metadata(const struct sfp_enum_metadata *,
+ int);
+
+{%
+for _, ent in ipairs(enums) do
+ if type(ent) == "table" then
+ local enum = ent
+ local name = "sfp_"..enum.name
+%}
+extern const struct sfp_enum_metadata *{*name*}_table;
+{%
+ end
+end
+%}
+
+static inline void
+get_sfp_info_strings(const struct ifconfig_sfp_info *sfp,
+ struct ifconfig_sfp_info_strings *strings)
+{
+{%
+for _, ent in ipairs(enums) do
+ if type(ent) == "table" then
+ local enum = ent
+ local name = "sfp_"..enum.name
+%}
+ strings->{*name*} = ifconfig_{*name*}_description(sfp->{*name*});
+{%
+ end
+end
+%}
+}
diff --git a/lib/libifconfig/sfp.lua b/lib/libifconfig/sfp.lua
new file mode 100644
index 000000000000..dc471cad5677
--- /dev/null
+++ b/lib/libifconfig/sfp.lua
@@ -0,0 +1,367 @@
+#!/usr/libexec/flua
+-- ex: sw=4 et:
+--[[
+/*-
+ * Copyright (c) 2014, Alexander V. Chernikov
+ * Copyright (c) 2020, Ryan Moeller <freqlabs@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+]]
+
+-- Try to put the template.lua library in the package search path.
+package.path = (os.getenv("SRCTOP") or "/usr/src").."/tools/lua/?.lua"
+
+-- Render the template named by the first argument to this script.
+require("template").render(arg[1], { -- This table is the template's context.
+
+-- The table `enums' is accessible in the template. It is a list of strings
+-- and tables that describe the various enum types we are generating and the
+-- ancillary metadata for generating other related code.
+enums = {
+
+ -- Strings at this level are rendered as block comments for convenience.
+ "SFF-8024 Rev. 4.6 Table 4-1: Indentifier Values",
+
+ -- This table describes an enum type, in this case enum sfp_id:
+ {
+ name = "id", -- The template prepends the sfp_ prefix to our name.
+ description = "Transceiver identifier",
+
+ -- What width int is needed to store this type:
+ bits = 8, -- This could be inferred by the values below...
+
+ -- The values, symbols, display names, and descriptions of this enum:
+ values = {
+ -- The prefix SFP_ID_ is prepended to the symbolic names.
+ -- Only this enum has shortened names for the values, though they
+ -- could be added to the other enums.
+
+ -- value, symbolic name, description, shortened name
+ {0x00, "UNKNOWN", "Unknown or unspecified", "Unknown"},
+ {0x01, "GBIC", "GBIC", "GBIC"},
+ {0x02, "SFF", "Module soldered to motherboard (ex: SFF)",
+ "SFF"},
+ {0x03, "SFP", "SFP or SFP+", "SFP/SFP+/SFP28"},
+ {0x04, "XBI", "300 pin XBI", "XBI"},
+ {0x05, "XENPAK", "Xenpak", "Xenpak"},
+ {0x06, "XFP", "XFP", "XFP"},
+ {0x07, "XFF", "XFF", "XFF"},
+ {0x08, "XFPE", "XFP-E", "XFP-E"},
+ {0x09, "XPAK", "XPAK", "XPAK"},
+ {0x0A, "X2", "X2", "X2"},
+ {0x0B, "DWDM_SFP", "DWDM-SFP/SFP+", "DWDM-SFP/SFP+"},
+ {0x0C, "QSFP", "QSFP", "QSFP"},
+ {0x0D, "QSFPPLUS", "QSFP+ or later", "QSFP+"},
+ {0x0E, "CXP", "CXP", "CXP"},
+ {0x0F, "HD4X", "Shielded Mini Multilane HD 4X", "HD4X"},
+ {0x10, "HD8X", "Shielded Mini Multilane HD 8X", "HD8X"},
+ {0x11, "QSFP28", "QSFP28 or later", "QSFP28"},
+ {0x12, "CXP2", "CXP2 (aka CXP28)", "CXP2"},
+ {0x13, "CDFP", "CDFP (Style 1/Style 2)", "CDFP"},
+ {0x14, "SMM4", "Shielded Mini Multilane HD 4X fanout",
+ "SMM4"},
+ {0x15, "SMM8", "Shielded Mini Multilane HD 8X fanout",
+ "SMM8"},
+ {0x16, "CDFP3", "CDFP (Style 3)", "CDFP3"},
+ {0x17, "MICROQSFP", "microQSFP", "microQSFP"},
+ {0x18, "QSFP_DD", "QSFP-DD 8X pluggable transceiver", "QSFP-DD"},
+ {0x19, "QSFP8X", "QSFP 8X pluggable transceiver", "QSFP8X"},
+ {0x1A, "SFP_DD", "SFP-DD 2X pluggable transceiver", "SFP-DD"},
+ {0x1B, "DSFP", "DSFP Dual SFP pluggable transceiver", "DSFP"},
+ {0x1C, "X4ML", "x4 MiniLink/OcuLink", "x4MiniLink/OcuLink"},
+ {0x1D, "X8ML", "x8 MiniLink", "x8MiniLink"},
+ {0x1E, "QSFP_CMIS",
+ "QSFP+ or later w/Common Management Interface Specification",
+ "QSFP+(CMIS)"},
+ },
+ },
+
+ "SFF-8024 Rev. 4.6 Table 4-3: Connector Types",
+ {
+ name = "conn",
+ description = "Connector type",
+ bits = 8,
+ values = {
+ {0x00, "UNKNOWN", "Unknown"},
+ {0x01, "SC", "SC"},
+ {0x02, "FC_1_COPPER", "Fibre Channel Style 1 copper"},
+ {0x03, "FC_2_COPPER", "Fibre Channel Style 2 copper"},
+ {0x04, "BNC_TNC", "BNC/TNC"},
+ {0x05, "FC_COAX", "Fibre Channel coaxial"},
+ {0x06, "FIBER_JACK", "Fiber Jack"},
+ {0x07, "LC", "LC"},
+ {0x08, "MT_RJ", "MT-RJ"},
+ {0x09, "MU", "MU"},
+ {0x0A, "SG", "SG"},
+ {0x0B, "OPTICAL_PIGTAIL", "Optical pigtail"},
+ {0x0C, "MPO_1X12_POPTIC", "MPO 1x12 Parallel Optic"},
+ {0x0D, "MPO_2X16_POPTIC", "MPO 2x16 Parallel Optic"},
+ {0x20, "HSSDC_II", "HSSDC II"},
+ {0x21, "COPPER_PIGTAIL", "Copper pigtail"},
+ {0x22, "RJ45", "RJ45"},
+ {0x23, "NONE", "No separable connector"},
+ {0x24, "MXC_2X16", "MXC 2x16"},
+ {0x25, "CS_OPTICAL", "CS optical connector"},
+ {0x26, "MINI_CS_OPTICAL", "Mini CS optical connector"},
+ {0x27, "MPO_2X12_POPTIC", "MPO 2x12 Parallel Optic"},
+ {0x28, "MPO_1X16_POPTIC", "MPO 1x16 Parallel Optic"},
+ },
+ },
+ "SFF-8472 Rev. 11.4 table 3.5: Transceiver codes",
+ "10G Ethernet/IB compliance codes, byte 3",
+ {
+ name = "eth_10g",
+ description = "10G Ethernet/IB compliance",
+ bits = 8,
+ values = {
+ {0x80, "10G_BASE_ER", "10G Base-ER"},
+ {0x40, "10G_BASE_LRM", "10G Base-LRM"},
+ {0x20, "10G_BASE_LR", "10G Base-LR"},
+ {0x10, "10G_BASE_SR", "10G Base-SR"},
+ {0x08, "1X_SX", "1X SX"},
+ {0x04, "1X_LX", "1X LX"},
+ {0x02, "1X_COPPER_ACTIVE", "1X Copper Active"},
+ {0x01, "1X_COPPER_PASSIVE", "1X Copper Passive"},
+ },
+ },
+ "Ethernet compliance codes, byte 6",
+ {
+ name = "eth",
+ description = "Ethernet compliance",
+ bits = 8,
+ values = {
+ {0x80, "BASE_PX", "BASE-PX"},
+ {0x40, "BASE_BX10", "BASE-BX10"},
+ {0x20, "100BASE_FX", "100BASE-FX"},
+ {0x10, "100BASE_LX_LX10", "100BASE-LX/LX10"},
+ {0x08, "1000BASE_T", "1000BASE-T"},
+ {0x04, "1000BASE_CX", "1000BASE-CX"},
+ {0x02, "1000BASE_LX", "1000BASE-LX"},
+ {0x01, "1000BASE_SX", "1000BASE-SX"},
+ },
+ },
+ "FC link length, byte 7",
+ {
+ name = "fc_len",
+ description = "Fibre Channel link length",
+ bits = 8,
+ values = {
+ {0x80, "VERY_LONG", "very long distance"},
+ {0x40, "SHORT", "short distance"},
+ {0x20, "INTERMEDIATE", "intermediate distance"},
+ {0x10, "LONG", "long distance"},
+ {0x08, "MEDIUM", "medium distance"},
+ },
+ },
+ "Channel/Cable technology, byte 7-8",
+ {
+ name = "cab_tech",
+ description = "Channel/cable technology",
+ bits = 16,
+ values = {
+ {0x0400, "SA", "Shortwave laser (SA)"},
+ {0x0200, "LC", "Longwave laser (LC)"},
+ {0x0100, "EL_INTER", "Electrical inter-enclosure (EL)"},
+ {0x0080, "EL_INTRA", "Electrical intra-enclosure (EL)"},
+ {0x0040, "SN", "Shortwave laser (SN)"},
+ {0x0020, "SL", "Shortwave laser (SL)"},
+ {0x0010, "LL", "Longwave laser (LL)"},
+ {0x0008, "ACTIVE", "Active Cable"},
+ {0x0004, "PASSIVE", "Passive Cable"},
+ },
+ },
+ "FC Transmission media, byte 9",
+ {
+ name = "fc_media",
+ description = "Fibre Channel transmission media",
+ bits = 8,
+ values = {
+ {0x80, "TW", "Twin Axial Pair (TW)"},
+ {0x40, "TP", "Twisted Pair (TP)"},
+ {0x20, "MI", "Miniature Coax (MI)"},
+ {0x10, "TV", "Video Coax (TV)"},
+ {0x08, "M6", "Miltimode 62.5um (M6)"},
+ {0x04, "M5", "Multimode 50um (M5)"},
+ {0x02, "RESERVED", "Reserved"},
+ {0x01, "SM", "Single Mode (SM)"},
+ },
+ },
+ "FC Speed, byte 10",
+ {
+ name = "fc_speed",
+ description = "Fibre Channel speed",
+ bits = 8,
+ values = {
+ {0x80, "1200", "1200 MBytes/sec"},
+ {0x40, "800", "800 MBytes/sec"},
+ {0x20, "1600", "1600 MBytes/sec"},
+ {0x10, "400", "400 MBytes/sec"},
+ {0x08, "3200", "3200 MBytes/sec"},
+ {0x04, "200", "200 MBytes/sec"},
+ {0x01, "100", "100 MBytes/sec"},
+ },
+ },
+ "SFF-8436 Rev. 4.8 table 33: Specification compliance",
+ "10/40G Ethernet compliance codes, byte 128 + 3",
+ {
+ name = "eth_1040g",
+ description = "10/40G Ethernet compliance",
+ bits = 8,
+ values = {
+ {0x80, "EXTENDED", "Extended"},
+ {0x40, "10GBASE_LRM", "10GBASE-LRM"},
+ {0x20, "10GBASE_LR", "10GBASE-LR"},
+ {0x10, "10GBASE_SR", "10GBASE-SR"},
+ {0x08, "40GBASE_CR4", "40GBASE-CR4"},
+ {0x04, "40GBASE_SR4", "40GBASE-SR4"},
+ {0x02, "40GBASE_LR4", "40GBASE-LR4"},
+ {0x01, "40G_ACTIVE", "40G Active Cable"},
+ },
+ },
+ "SFF-8024 Rev. 4.6 table 4-4: Extended Specification Compliance",
+ {
+ name = "eth_ext",
+ description = "Extended specification compliance",
+ bits = 8,
+ values = {
+ {0xFF, "RESERVED_FF", "Reserved"},
+ {0x55, "128GFC_LW", "128GFC LW"},
+ {0x54, "128GFC_SW", "128GFC SW"},
+ {0x53, "128GFC_EA", "128GFC EA"},
+ {0x52, "64GFC_LW", "64GFC LW"},
+ {0x51, "64GFC_SW", "64GFC SW"},
+ {0x50, "64GFC_EA", "64GFC EA"},
+ {0x4F, "RESERVED_4F", "Reserved"},
+ {0x4E, "RESERVED_4E", "Reserved"},
+ {0x4D, "RESERVED_4D", "Reserved"},
+ {0x4C, "RESERVED_4C", "Reserved"},
+ {0x4B, "RESERVED_4B", "Reserved"},
+ {0x4A, "RESERVED_4A", "Reserved"},
+ {0x49, "RESERVED_49", "Reserved"},
+ {0x48, "RESERVED_48", "Reserved"},
+ {0x47, "RESERVED_47", "Reserved"},
+ {0x46, "200GBASE_LR4", "200GBASE-LR4"},
+ {0x45, "50GBASE_LR", "50GBASE-LR"},
+ {0x44, "200G_1550NM_PSM4", "200G 1550nm PSM4"},
+ {0x43, "200GBASE_FR4", "200GBASE-FR4"},
+ {0x42, "50GBASE_FR_200GBASE_DR4", "50GBASE-FR or 200GBASE-DR4"},
+ {0x41, "50GBASE_SR_100GBASE_SR2_200GBASE_SR4",
+ "50GBASE-SR/100GBASE-SR2/200GBASE-SR4"},
+ {0x40, "50GBASE_CR_100GBASE_CR2_200GBASE_CR4",
+ "50GBASE-CR/100GBASE-CR2/200GBASE-CR4"},
+ {0x3F, "RESERVED_3F", "Reserved"},
+ {0x3E, "RESERVED_3E", "Reserved"},
+ {0x3D, "RESERVED_3D", "Reserved"},
+ {0x3C, "RESERVED_3C", "Reserved"},
+ {0x3B, "RESERVED_3B", "Reserved"},
+ {0x3A, "RESERVED_3A", "Reserved"},
+ {0x39, "RESERVED_39", "Reserved"},
+ {0x38, "RESERVED_38", "Reserved"},
+ {0x37, "RESERVED_37", "Reserved"},
+ {0x36, "RESERVED_36", "Reserved"},
+ {0x35, "RESERVED_35", "Reserved"},
+ {0x34, "RESERVED_34", "Reserved"},
+ {0x33, "50_100_200GAUI_AOC_HI_BER",
+ "50GAUI/100GAUI-2/200GAUI-4 AOC (BER <2.6e-4)"},
+ {0x32, "50_100_200GAUI_ACC_HI_BER",
+ "50GAUI/100GAUI-2/200GAUI-4 ACC (BER <2.6e-4)"},
+ {0x31, "50_100_200GAUI_AOC_LO_BER",
+ "50GAUI/100GAUI-2/200GAUI-4 AOC (BER <1e-6)"},
+ {0x30, "50_100_200GAUI_ACC_LO_BER",
+ "50GAUI/100GAUI-2/200GAUI-4 ACC (BER <1e-6)"},
+ {0x2F, "RESERVED_2F", "Reserved"},
+ {0x2E, "RESERVED_2E", "Reserved"},
+ {0x2D, "RESERVED_2D", "Reserved"},
+ {0x2C, "RESERVED_2C", "Reserved"},
+ {0x2B, "RESERVED_2B", "Reserved"},
+ {0x2A, "RESERVED_2A", "Reserved"},
+ {0x29, "RESERVED_29", "Reserved"},
+ {0x28, "RESERVED_28", "Reserved"},
+ {0x27, "100G_LR", "100G-LR"},
+ {0x26, "100G_FR", "100G-FR"},
+ {0x25, "100GBASE_DR", "100GBASE-DR"},
+ {0x24, "4WDM_40_MSA", "4WDM-40 MSA"},
+ {0x23, "4WDM_20_MSA", "4WDM-20 MSA"},
+ {0x22, "4WDM_10_MSA", "4WDM-10 MSA"},
+ {0x21, "100G_PAM4_BIDI", "100G PAM4 BiDi"},
+ {0x20, "100G_SWDM4", "100G SWDM4"},
+ {0x1F, "40G_SWDM4", "40G SWDM4"},
+ {0x1E, "2_5GBASE_T", "2.5GBASE-T"},
+ {0x1D, "5GBASE_T", "5GBASE-T"},
+ {0x1C, "10GBASE_T_SR", "10GBASE-T Short Reach"},
+ {0x1B, "100G_1550NM_WDM", "100G 1550nm WDM"},
+ {0x1A, "100GE_DWDM2", "100GE-DWDM2"},
+ {0x19, "100G_25GAUI_C2M_ACC", "100G ACC or 25GAUI C2M ACC"},
+ {0x18, "100G_25GAUI_C2M_AOC", "100G AOC or 25GAUI C2M AOC"},
+ {0x17, "100G_CLR4", "100G CLR4"},
+ {0x16, "10GBASE_T_SFI",
+ "10GBASE-T with SFI electrical interface"},
+ {0x15, "G959_1_P1L1_2D2", "G959.1 profile P1L1-2D2"},
+ {0x14, "G959_1_P1S1_2D2", "G959.1 profile P1S1-2D2"},
+ {0x13, "G959_1_P1I1_2D1", "G959.1 profile P1I1-2D1"},
+ {0x12, "40G_PSM4", "40G PSM4 Parallel SMF"},
+ {0x11, "4X_10GBASE_SR", "4 x 10GBASE-SR"},
+ {0x10, "40GBASE_ER4", "40GBASE-ER4"},
+ {0x0F, "RESERVED_0F", "Reserved"},
+ {0x0E, "RESERVED_0E", "Reserved"},
+ {0x0D, "CA_25G_N", "25GBASE-CR CA-25G-N"},
+ {0x0C, "CA_25G_S", "25GBASE-CR CA-25G-S"},
+ {0x0B, "CA_L", "100GBASE-CR4 or 25GBASE-CR CA-L"},
+ {0x0A, "RESERVED_0A", "Reserved"},
+ {0x09, "OBSOLETE", "Obsolete"},
+ {0x08, "100G_25GAUI_C2M_ACC_1",
+ "100G ACC (Active Copper Cable"},
+ {0x07, "100G_PSM4_P_SMF", "100G PSM4 Parallel SMF"},
+ {0x06, "100G_CWDM4", "100G CWDM4"},
+ {0x05, "100GBASE_SR10", "100GBASE-SR10"},
+ {0x04, "100GBASE_ER4_25GBASE_ER", "100GBASE-ER4 or 25GBASE-ER"},
+ {0x03, "100GBASE_LR4_25GBASE_LR", "100GBASE-LR4 or 25GBASE-LR"},
+ {0x02, "100GBASE_SR4_25GBASE_SR", "100GBASE-SR4 or 25GBASE-SR"},
+ {0x01, "100G_25GAUI_C2M_AOC_1",
+ "100G AOC (Active Optical Cable"},
+ {0x00, "UNSPECIFIED", "Unspecified"},
+ },
+ },
+ "SFF-8636 Rev. 2.9 table 6.3: Revision compliance",
+ {
+ name = "rev",
+ description = "Revision compliance",
+ bits = 8,
+ values = {
+ {0x1, "SFF_8436_REV_LE_4_8", "SFF-8436 rev <=4.8"},
+ {0x2, "SFF_8436_REV_LE_4_8_ALT", "SFF-8436 rev <=4.8"},
+ {0x3, "SFF_8636_REV_LE_1_3", "SFF-8636 rev <=1.3"},
+ {0x4, "SFF_8636_REV_LE_1_4", "SFF-8636 rev <=1.4"},
+ {0x5, "SFF_8636_REV_LE_1_5", "SFF-8636 rev <=1.5"},
+ {0x6, "SFF_8636_REV_LE_2_0", "SFF-8636 rev <=2.0"},
+ {0x7, "SFF_8636_REV_LE_2_7", "SFF-8636 rev <=2.7"},
+ {0x8, "SFF_8363_REV_GE_2_8", "SFF-8636 rev >=2.8"},
+ {0x0, "UNSPECIFIED", "Unspecified"},
+ },
+ },
+}
+
+-- Nothing else in this context.
+})
diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c
index 6e39373c1cb4..7d435cab0ff0 100644
--- a/lib/libpmc/libpmc.c
+++ b/lib/libpmc/libpmc.c
@@ -176,6 +176,11 @@ static const struct pmc_event_descr cortex_a57_event_table[] =
__PMC_EV_ALIAS_ARMV8_CORTEX_A57()
};
+static const struct pmc_event_descr cortex_a76_event_table[] =
+{
+ __PMC_EV_ALIAS_ARMV8_CORTEX_A76()
+};
+
/*
* PMC_MDEP_TABLE(NAME, PRIMARYCLASS, ADDITIONAL_CLASSES...)
*
@@ -193,6 +198,7 @@ PMC_MDEP_TABLE(cortex_a8, ARMV7, PMC_CLASS_SOFT, PMC_CLASS_ARMV7);
PMC_MDEP_TABLE(cortex_a9, ARMV7, PMC_CLASS_SOFT, PMC_CLASS_ARMV7);
PMC_MDEP_TABLE(cortex_a53, ARMV8, PMC_CLASS_SOFT, PMC_CLASS_ARMV8);
PMC_MDEP_TABLE(cortex_a57, ARMV8, PMC_CLASS_SOFT, PMC_CLASS_ARMV8);
+PMC_MDEP_TABLE(cortex_a76, ARMV8, PMC_CLASS_SOFT, PMC_CLASS_ARMV8);
PMC_MDEP_TABLE(mips24k, MIPS24K, PMC_CLASS_SOFT, PMC_CLASS_MIPS24K);
PMC_MDEP_TABLE(mips74k, MIPS74K, PMC_CLASS_SOFT, PMC_CLASS_MIPS74K);
PMC_MDEP_TABLE(octeon, OCTEON, PMC_CLASS_SOFT, PMC_CLASS_OCTEON);
@@ -235,6 +241,7 @@ PMC_CLASS_TABLE_DESC(cortex_a9, ARMV7, cortex_a9, armv7);
#if defined(__aarch64__)
PMC_CLASS_TABLE_DESC(cortex_a53, ARMV8, cortex_a53, arm64);
PMC_CLASS_TABLE_DESC(cortex_a57, ARMV8, cortex_a57, arm64);
+PMC_CLASS_TABLE_DESC(cortex_a76, ARMV8, cortex_a76, arm64);
#endif
#if defined(__mips__)
PMC_CLASS_TABLE_DESC(beri, BERI, beri, mips);
@@ -817,6 +824,9 @@ static struct pmc_event_alias cortex_a53_aliases[] = {
static struct pmc_event_alias cortex_a57_aliases[] = {
EV_ALIAS(NULL, NULL)
};
+static struct pmc_event_alias cortex_a76_aliases[] = {
+ EV_ALIAS(NULL, NULL)
+};
static int
arm64_allocate_pmc(enum pmc_event pe, char *ctrspec __unused,
struct pmc_op_pmcallocate *pmc_config __unused)
@@ -1273,6 +1283,10 @@ pmc_event_names_of_class(enum pmc_class cl, const char ***eventnames,
ev = cortex_a57_event_table;
count = PMC_EVENT_TABLE_SIZE(cortex_a57);
break;
+ case PMC_CPU_ARMV8_CORTEX_A76:
+ ev = cortex_a76_event_table;
+ count = PMC_EVENT_TABLE_SIZE(cortex_a76);
+ break;
}
break;
case PMC_CLASS_BERI:
@@ -1518,6 +1532,10 @@ pmc_init(void)
PMC_MDEP_INIT(cortex_a57);
pmc_class_table[n] = &cortex_a57_class_table_descr;
break;
+ case PMC_CPU_ARMV8_CORTEX_A76:
+ PMC_MDEP_INIT(cortex_a76);
+ pmc_class_table[n] = &cortex_a76_class_table_descr;
+ break;
#endif
#if defined(__mips__)
case PMC_CPU_MIPS_BERI:
@@ -1658,6 +1676,10 @@ _pmc_name_of_event(enum pmc_event pe, enum pmc_cputype cpu)
ev = cortex_a57_event_table;
evfence = cortex_a57_event_table + PMC_EVENT_TABLE_SIZE(cortex_a57);
break;
+ case PMC_CPU_ARMV8_CORTEX_A76:
+ ev = cortex_a76_event_table;
+ evfence = cortex_a76_event_table + PMC_EVENT_TABLE_SIZE(cortex_a76);
+ break;
default: /* Unknown CPU type. */
break;
}
diff --git a/lib/libpmcstat/libpmcstat.h b/lib/libpmcstat/libpmcstat.h
index 3f5f2689f6b3..8e8d94b116d8 100644
--- a/lib/libpmcstat/libpmcstat.h
+++ b/lib/libpmcstat/libpmcstat.h
@@ -107,8 +107,9 @@ struct pmcstat_args {
#define FLAGS_HAS_CPUMASK 0x00040000 /* -c */
#define FLAG_HAS_DURATION 0x00080000 /* -l secs */
#define FLAG_DO_WIDE_GPROF_HC 0x00100000 /* -e */
-#define FLAG_SKIP_TOP_FN_RES 0x00200000 /* -I */
+#define FLAG_SKIP_TOP_FN_RES 0x00200000 /* -A */
#define FLAG_FILTER_THREAD_ID 0x00400000 /* -L */
+#define FLAG_SHOW_OFFSET 0x00800000 /* -I */
int pa_required; /* required features */
int pa_pplugin; /* pre-processing plugin */
diff --git a/lib/libregex/tests/gnuext.in b/lib/libregex/tests/gnuext.in
index 86afe499f50a..7d9e4823a67f 100644
--- a/lib/libregex/tests/gnuext.in
+++ b/lib/libregex/tests/gnuext.in
@@ -17,14 +17,16 @@ a\|b\|c b abc a
\s\+ b aSNTb SNT
# Word boundaries (\b, \B, \<, \>, \`, \')
# (is/not boundary, start/end word, start/end subject string)
-\babc\b & <abc> abc
+# Most of these are disabled for the moment, and will be re-enabled as
+# we become feature complete.
+#\babc\b & <abc> abc
\<abc\> & <abc> abc
-\Babc\B & abc
-\B[abc]\B & <abc> b
-\B[abc]+ - <abc> bc
-\B[abc]\+ b <abc> bc
-\`abc\' & abc abc
-\`.+\' - abNc abNc
-\`.\+\' b abNc abNc
-(\`a) - Na
-(a\') - aN
+#\Babc\B & abc
+#\B[abc]\B & <abc> b
+#\B[abc]+ - <abc> bc
+#\B[abc]\+ b <abc> bc
+#\`abc\' & abc abc
+#\`.+\' - abNc abNc
+#\`.\+\' b abNc abNc
+#(\`a) - Na
+#(a\') - aN
diff --git a/lib/libregex/tests/libregex_test.sh b/lib/libregex/tests/libregex_test.sh
index 9e41db67e10b..5e4e49c3ad38 100755
--- a/lib/libregex/tests/libregex_test.sh
+++ b/lib/libregex/tests/libregex_test.sh
@@ -30,10 +30,6 @@ check()
{
local dataname="${1}"; shift
- if [ "${dataname}" == "gnuext" ]; then
- atf_expect_fail "GNU extensions are not currently implemented"
- fi
-
prog="$(atf_get_srcdir)/h_regex"
data="$(atf_get_srcdir)/data/${dataname}.in"
diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile
index 5b61df983ce9..efa38691115e 100644
--- a/lib/ncurses/ncurses/Makefile
+++ b/lib/ncurses/ncurses/Makefile
@@ -345,7 +345,7 @@ codes.c: MKcodes.awk
${AWK} -f ${NCURSES_DIR}/ncurses/tinfo/MKcodes.awk bigstrings=${USE_BIG_STRINGS} ${NCURSES_DIR}/include/Caps > codes.c
lib_gen.c: MKlib_gen.sh curses.h ncurses_dll.h
- LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CPP:N${CCACHE_BIN}} ${CPPFLAGS}" \
+ LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CPP:N${CCACHE_BIN}} ${CFLAGS}" \
"${AWK}" generated < curses.h >$@
lib_keyname.c: keys.list MKkeyname.awk
diff --git a/libexec/rc/rc.d/ipfilter b/libexec/rc/rc.d/ipfilter
index 6a430b55d897..fe328308e622 100755
--- a/libexec/rc/rc.d/ipfilter
+++ b/libexec/rc/rc.d/ipfilter
@@ -5,6 +5,7 @@
# PROVIDE: ipfilter
# REQUIRE: FILESYSTEMS
+# BEFORE: ipmon ipnat netif netwait securelevel
# KEYWORD: nojailvnet
. /etc/rc.subr
diff --git a/libexec/rc/rc.d/ipmon b/libexec/rc/rc.d/ipmon
index a742daa363d5..56b64f8c8271 100755
--- a/libexec/rc/rc.d/ipmon
+++ b/libexec/rc/rc.d/ipmon
@@ -4,7 +4,7 @@
#
# PROVIDE: ipmon
-# REQUIRE: FILESYSTEMS hostname sysctl ipfilter
+# REQUIRE: FILESYSTEMS hostname sysctl
# BEFORE: SERVERS
# KEYWORD: nojailvnet
diff --git a/libexec/rc/rc.d/ipnat b/libexec/rc/rc.d/ipnat
index bff94154dc65..d4fa6b65dff4 100755
--- a/libexec/rc/rc.d/ipnat
+++ b/libexec/rc/rc.d/ipnat
@@ -4,7 +4,6 @@
#
# PROVIDE: ipnat
-# REQUIRE: ipfilter
# KEYWORD: nojailvnet
. /etc/rc.subr
diff --git a/libexec/rc/rc.d/netif b/libexec/rc/rc.d/netif
index a1543e63e704..eb1efc4d6274 100755
--- a/libexec/rc/rc.d/netif
+++ b/libexec/rc/rc.d/netif
@@ -27,7 +27,7 @@
# PROVIDE: netif
# REQUIRE: FILESYSTEMS iovctl serial sppp sysctl
-# REQUIRE: hostid ipfilter ipfs
+# REQUIRE: hostid ipfs
# KEYWORD: nojailvnet
. /etc/rc.subr
diff --git a/libexec/rc/rc.d/netwait b/libexec/rc/rc.d/netwait
index ab80cec50576..92f124cd4f27 100755
--- a/libexec/rc/rc.d/netwait
+++ b/libexec/rc/rc.d/netwait
@@ -3,7 +3,7 @@
# $FreeBSD$
#
# PROVIDE: netwait
-# REQUIRE: devd ipfilter ipfw pf routing
+# REQUIRE: devd ipfw pf routing
# KEYWORD: nojail
#
# The netwait script helps handle two situations:
diff --git a/libexec/rc/rc.d/securelevel b/libexec/rc/rc.d/securelevel
index c42a03534675..24dbf269df3f 100755
--- a/libexec/rc/rc.d/securelevel
+++ b/libexec/rc/rc.d/securelevel
@@ -4,7 +4,7 @@
#
# PROVIDE: securelevel
-# REQUIRE: adjkerntz ipfw ipfilter pf
+# REQUIRE: adjkerntz ipfw pf
. /etc/rc.subr
diff --git a/release/arm64/RPI3.conf b/release/arm64/RPI3.conf
index 58b983ea86ff..f8da393cb9dd 100644
--- a/release/arm64/RPI3.conf
+++ b/release/arm64/RPI3.conf
@@ -4,7 +4,7 @@
#
DTB_DIR="/usr/local/share/rpi-firmware"
-DTB="bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb bcm2711-rpi-4-b.dtb"
+DTB="bcm2709-rpi-2-b.dtb bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb bcm2711-rpi-4-b.dtb"
EMBEDDED_TARGET_ARCH="aarch64"
EMBEDDED_TARGET="arm64"
EMBEDDEDBUILD=1
diff --git a/release/packages/binutils.ucl b/release/packages/binutils.ucl
index fcf05b313b38..ec246dfacd75 100644
--- a/release/packages/binutils.ucl
+++ b/release/packages/binutils.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
licenselogic = "single"
licenses = [ GPLv2 ]
diff --git a/release/packages/caroot.ucl b/release/packages/caroot.ucl
index f0d1730f9976..bc298efcabf4 100644
--- a/release/packages/caroot.ucl
+++ b/release/packages/caroot.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = %PKG_MAINTAINER%
+www = "%PKG_WWW%"
prefix = "/"
licenselogic = "single"
licenses = [ BSD2CLAUSE ]
diff --git a/release/packages/clang.ucl b/release/packages/clang.ucl
index 3f8820abcbdf..0642f21d1daa 100644
--- a/release/packages/clang.ucl
+++ b/release/packages/clang.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
licenselogic = "single"
licenses = [ NCSA ]
diff --git a/release/packages/gdb.ucl b/release/packages/gdb.ucl
index fcf05b313b38..ec246dfacd75 100644
--- a/release/packages/gdb.ucl
+++ b/release/packages/gdb.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
licenselogic = "single"
licenses = [ GPLv2 ]
diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh
index 99bf150b3276..b3d76eb4019d 100755
--- a/release/packages/generate-ucl.sh
+++ b/release/packages/generate-ucl.sh
@@ -97,6 +97,8 @@ main() {
outname="${outname%%_*}"
+ pkgdeps="$(echo ${pkgdeps} | tr '_' '-')"
+
desc="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESC)"
comment="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_COMMENT)"
@@ -144,6 +146,9 @@ EOF
-e "s/%COMMENT%/${comment}/" \
-e "s/%DESC%/${desc}/" \
-e "s/%CAP_MKDB_ENDIAN%/${cap_arg}/g" \
+ -e "s/%PKG_NAME_PREFIX%/${PKG_NAME_PREFIX}/" \
+ -e "s|%PKG_WWW%|${PKG_WWW}|" \
+ -e "s/%PKG_MAINTAINER%/${PKG_MAINTAINER}/" \
${uclfile}
return 0
}
diff --git a/release/packages/groff.ucl b/release/packages/groff.ucl
index fcf05b313b38..ec246dfacd75 100644
--- a/release/packages/groff.ucl
+++ b/release/packages/groff.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
licenselogic = "single"
licenses = [ GPLv2 ]
diff --git a/release/packages/jail.ucl b/release/packages/jail.ucl
index fcb9a567125b..8448a15ebf7b 100644
--- a/release/packages/jail.ucl
+++ b/release/packages/jail.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
vital = true
licenselogic = "single"
diff --git a/release/packages/kernel.ucl b/release/packages/kernel.ucl
index f9ee3643e1d1..b7317cae507c 100644
--- a/release/packages/kernel.ucl
+++ b/release/packages/kernel.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
-comment = "%COMMENT% %VCS_REVISION%"
+comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
licenselogic = "single"
licenses = [ BSD2CLAUSE ]
diff --git a/release/packages/lld.ucl b/release/packages/lld.ucl
index 3f8820abcbdf..0642f21d1daa 100644
--- a/release/packages/lld.ucl
+++ b/release/packages/lld.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
licenselogic = "single"
licenses = [ NCSA ]
diff --git a/release/packages/lldb.ucl b/release/packages/lldb.ucl
index 3f8820abcbdf..0642f21d1daa 100644
--- a/release/packages/lldb.ucl
+++ b/release/packages/lldb.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
licenselogic = "single"
licenses = [ NCSA ]
diff --git a/release/packages/runtime.ucl b/release/packages/runtime.ucl
index 1d6f6c3ded29..6b51c830ab5c 100644
--- a/release/packages/runtime.ucl
+++ b/release/packages/runtime.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
-comment = "%COMMENT% %VCS_REVISION%"
+comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
vital = true
licenselogic = "single"
diff --git a/release/packages/ssh.ucl b/release/packages/ssh.ucl
index faf264e00f10..415094e9d69f 100644
--- a/release/packages/ssh.ucl
+++ b/release/packages/ssh.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
licenselogic = "single"
licenses = [ ISCL ]
diff --git a/release/packages/svn.ucl b/release/packages/svn.ucl
index 5211101e9e8c..f80da47be55b 100644
--- a/release/packages/svn.ucl
+++ b/release/packages/svn.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
licenselogic = "single"
licenses = [ APACHE20 ]
diff --git a/release/packages/template.ucl b/release/packages/template.ucl
index 38844f0f0898..f7cea7af8893 100644
--- a/release/packages/template.ucl
+++ b/release/packages/template.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
licenselogic = "single"
licenses = [ BSD2CLAUSE ]
diff --git a/release/packages/unbound.ucl b/release/packages/unbound.ucl
index 1ba9560abf12..d250e76752f9 100644
--- a/release/packages/unbound.ucl
+++ b/release/packages/unbound.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
licenselogic = "single"
licenses = [ BSD4CLAUSE ]
diff --git a/release/packages/utilities.ucl b/release/packages/utilities.ucl
index 936b46e4cb4c..ab5725d1c1d8 100644
--- a/release/packages/utilities.ucl
+++ b/release/packages/utilities.ucl
@@ -2,13 +2,13 @@
# $FreeBSD$
#
-name = "FreeBSD-%PKGNAME%"
+name = "%PKG_NAME_PREFIX%-%PKGNAME%"
origin = "base"
version = "%VERSION%"
comment = "%COMMENT% %VCS_REVISION%"
categories = [ base ]
-maintainer = "re@FreeBSD.org"
-www = "https://www.FreeBSD.org"
+maintainer = "%PKG_MAINTAINER%"
+www = "%PKG_WWW%"
prefix = "/"
vital = true
licenselogic = "single"
diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile
index 9681ebaddfa3..66aa7f188ec1 100644
--- a/rescue/rescue/Makefile
+++ b/rescue/rescue/Makefile
@@ -224,6 +224,9 @@ CRUNCH_ALIAS_chown= chgrp
##################################################################
CRUNCH_LIBS+= -lm
+CRUNCH_LIBS+= ${OBJTOP}/lib/libifconfig/libifconfig.a
+CRUNCH_BUILDOPTS+= CRUNCH_CFLAGS+=-I${OBJTOP}/lib/libifconfig
+
.if ${MK_ISCSI} != "no"
CRUNCH_PROGS_usr.bin+= iscsictl
CRUNCH_PROGS_usr.sbin+= iscsid
diff --git a/sbin/ifconfig/Makefile b/sbin/ifconfig/Makefile
index b6c9ffabb0e4..39050b3a4dc6 100644
--- a/sbin/ifconfig/Makefile
+++ b/sbin/ifconfig/Makefile
@@ -37,7 +37,8 @@ SRCS+= ifgif.c # GIF reversed header workaround
SRCS+= ifipsec.c # IPsec VTI
SRCS+= sfp.c # SFP/SFP+ information
-LIBADD+= m
+LIBADD+= ifconfig m util
+CFLAGS+= -I${SRCTOP}/lib/libifconfig -I${OBJTOP}/lib/libifconfig
.if ${MK_WIRELESS_SUPPORT} != "no"
SRCS+= ifieee80211.c # SIOC[GS]IEEE80211 support
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index d63c9710d8bf..88d905698c17 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -4779,6 +4779,23 @@ getid(int s, int ix, void *data, size_t len, int *plen, int mesh)
return 0;
}
+static int
+getdevicename(int s, void *data, size_t len, int *plen)
+{
+ struct ieee80211req ireq;
+
+ (void) memset(&ireq, 0, sizeof(ireq));
+ (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name));
+ ireq.i_type = IEEE80211_IOC_IC_NAME;
+ ireq.i_val = -1;
+ ireq.i_data = data;
+ ireq.i_len = len;
+ if (ioctl(s, SIOCG80211, &ireq) < 0)
+ return (-1);
+ *plen = ireq.i_len;
+ return (0);
+}
+
static void
ieee80211_status(int s)
{
@@ -5503,6 +5520,12 @@ end:
}
LINE_BREAK();
+
+ if (getdevicename(s, data, sizeof(data), &len) < 0)
+ return;
+ LINE_CHECK("parent interface: %s", data);
+
+ LINE_BREAK();
}
static int
diff --git a/sbin/ifconfig/sfp.c b/sbin/ifconfig/sfp.c
index 49608bdbb576..b7bdc74d42e8 100644
--- a/sbin/ifconfig/sfp.c
+++ b/sbin/ifconfig/sfp.c
@@ -41,946 +41,102 @@ static const char rcsid[] =
#include <err.h>
#include <errno.h>
#include <fcntl.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "ifconfig.h"
-
-struct i2c_info {
- int fd; /* fd to issue SIOCGI2C */
- int error; /* Store first error */
- int qsfp; /* True if transceiver is QSFP */
- int do_diag; /* True if we need to request DDM */
- struct ifreq *ifr; /* Pointer to pre-filled ifreq */
-};
-
-static int read_i2c(struct i2c_info *ii, uint8_t addr, uint8_t off,
- uint8_t len, uint8_t *buf);
-static void dump_i2c_data(struct i2c_info *ii, uint8_t addr, uint8_t off,
- uint8_t len);
-
-struct _nv {
- int v;
- const char *n;
-};
-
-const char *find_value(struct _nv *x, int value);
-const char *find_zero_bit(struct _nv *x, int value, int sz);
-
-/* SFF-8024 Rev. 4.6 Table 4-3: Connector Types */
-static struct _nv conn[] = {
- { 0x00, "Unknown" },
- { 0x01, "SC" },
- { 0x02, "Fibre Channel Style 1 copper" },
- { 0x03, "Fibre Channel Style 2 copper" },
- { 0x04, "BNC/TNC" },
- { 0x05, "Fibre Channel coaxial" },
- { 0x06, "Fiber Jack" },
- { 0x07, "LC" },
- { 0x08, "MT-RJ" },
- { 0x09, "MU" },
- { 0x0A, "SG" },
- { 0x0B, "Optical pigtail" },
- { 0x0C, "MPO 1x12 Parallel Optic" },
- { 0x0D, "MPO 2x16 Parallel Optic" },
- { 0x20, "HSSDC II" },
- { 0x21, "Copper pigtail" },
- { 0x22, "RJ45" },
- { 0x23, "No separable connector" },
- { 0x24, "MXC 2x16" },
- { 0x25, "CS optical connector" },
- { 0x26, "Mini CS optical connector" },
- { 0x27, "MPO 2x12 Parallel Optic" },
- { 0x28, "MPO 1x16 Parallel Optic" },
- { 0, NULL }
-};
-
-/* SFF-8472 Rev. 11.4 table 3.5: Transceiver codes */
-/* 10G Ethernet/IB compliance codes, byte 3 */
-static struct _nv eth_10g[] = {
- { 0x80, "10G Base-ER" },
- { 0x40, "10G Base-LRM" },
- { 0x20, "10G Base-LR" },
- { 0x10, "10G Base-SR" },
- { 0x08, "1X SX" },
- { 0x04, "1X LX" },
- { 0x02, "1X Copper Active" },
- { 0x01, "1X Copper Passive" },
- { 0, NULL }
-};
-
-/* Ethernet compliance codes, byte 6 */
-static struct _nv eth_compat[] = {
- { 0x80, "BASE-PX" },
- { 0x40, "BASE-BX10" },
- { 0x20, "100BASE-FX" },
- { 0x10, "100BASE-LX/LX10" },
- { 0x08, "1000BASE-T" },
- { 0x04, "1000BASE-CX" },
- { 0x02, "1000BASE-LX" },
- { 0x01, "1000BASE-SX" },
- { 0, NULL }
-};
-
-/* FC link length, byte 7 */
-static struct _nv fc_len[] = {
- { 0x80, "very long distance" },
- { 0x40, "short distance" },
- { 0x20, "intermediate distance" },
- { 0x10, "long distance" },
- { 0x08, "medium distance" },
- { 0, NULL }
-};
-
-/* Channel/Cable technology, byte 7-8 */
-static struct _nv cab_tech[] = {
- { 0x0400, "Shortwave laser (SA)" },
- { 0x0200, "Longwave laser (LC)" },
- { 0x0100, "Electrical inter-enclosure (EL)" },
- { 0x80, "Electrical intra-enclosure (EL)" },
- { 0x40, "Shortwave laser (SN)" },
- { 0x20, "Shortwave laser (SL)" },
- { 0x10, "Longwave laser (LL)" },
- { 0x08, "Active Cable" },
- { 0x04, "Passive Cable" },
- { 0, NULL }
-};
-
-/* FC Transmission media, byte 9 */
-static struct _nv fc_media[] = {
- { 0x80, "Twin Axial Pair" },
- { 0x40, "Twisted Pair" },
- { 0x20, "Miniature Coax" },
- { 0x10, "Viao Coax" },
- { 0x08, "Miltimode, 62.5um" },
- { 0x04, "Multimode, 50um" },
- { 0x02, "" },
- { 0x01, "Single Mode" },
- { 0, NULL }
-};
-
-/* FC Speed, byte 10 */
-static struct _nv fc_speed[] = {
- { 0x80, "1200 MBytes/sec" },
- { 0x40, "800 MBytes/sec" },
- { 0x20, "1600 MBytes/sec" },
- { 0x10, "400 MBytes/sec" },
- { 0x08, "3200 MBytes/sec" },
- { 0x04, "200 MBytes/sec" },
- { 0x01, "100 MBytes/sec" },
- { 0, NULL }
-};
-
-/* SFF-8436 Rev. 4.8 table 33: Specification compliance */
-
-/* 10/40G Ethernet compliance codes, byte 128 + 3 */
-static struct _nv eth_1040g[] = {
- { 0x80, "Extended" },
- { 0x40, "10GBASE-LRM" },
- { 0x20, "10GBASE-LR" },
- { 0x10, "10GBASE-SR" },
- { 0x08, "40GBASE-CR4" },
- { 0x04, "40GBASE-SR4" },
- { 0x02, "40GBASE-LR4" },
- { 0x01, "40G Active Cable" },
- { 0, NULL }
-};
-#define SFF_8636_EXT_COMPLIANCE 0x80
-
-/* SFF-8024 Rev. 4.6 table 4-4: Extended Specification Compliance */
-static struct _nv eth_extended_comp[] = {
- { 0xFF, "Reserved" },
- { 0x55, "128GFC LW" },
- { 0x54, "128GFC SW" },
- { 0x53, "128GFC EA" },
- { 0x52, "64GFC LW" },
- { 0x51, "64GFC SW" },
- { 0x50, "64GFC EA" },
- { 0x4F, "Reserved" },
- { 0x4E, "Reserved" },
- { 0x4D, "Reserved" },
- { 0x4C, "Reserved" },
- { 0x4B, "Reserved" },
- { 0x4A, "Reserved" },
- { 0x49, "Reserved" },
- { 0x48, "Reserved" },
- { 0x47, "Reserved" },
- { 0x46, "200GBASE-LR4" },
- { 0x45, "50GBASE-LR" },
- { 0x44, "200G 1550nm PSM4" },
- { 0x43, "200GBASE-FR4" },
- { 0x42, "50GBASE-FR or 200GBASE-DR4" },
- { 0x41, "50GBASE-SR/100GBASE-SR2/200GBASE-SR4" },
- { 0x40, "50GBASE-CR/100GBASE-CR2/200GBASE-CR4" },
- { 0x3F, "Reserved" },
- { 0x3E, "Reserved" },
- { 0x3D, "Reserved" },
- { 0x3C, "Reserved" },
- { 0x3B, "Reserved" },
- { 0x3A, "Reserved" },
- { 0x39, "Reserved" },
- { 0x38, "Reserved" },
- { 0x37, "Reserved" },
- { 0x36, "Reserved" },
- { 0x35, "Reserved" },
- { 0x34, "Reserved" },
- { 0x33, "50GAUI/100GAUI-2/200GAUI-4 AOC (BER <2.6e-4)" },
- { 0x32, "50GAUI/100GAUI-2/200GAUI-4 ACC (BER <2.6e-4)" },
- { 0x31, "50GAUI/100GAUI-2/200GAUI-4 AOC (BER <1e-6)" },
- { 0x30, "50GAUI/100GAUI-2/200GAUI-4 ACC (BER <1e-6)" },
- { 0x2F, "Reserved" },
- { 0x2E, "Reserved" },
- { 0x2D, "Reserved" },
- { 0x2C, "Reserved" },
- { 0x2B, "Reserved" },
- { 0x2A, "Reserved" },
- { 0x29, "Reserved" },
- { 0x28, "Reserved" },
- { 0x27, "100G-LR" },
- { 0x26, "100G-FR" },
- { 0x25, "100GBASE-DR" },
- { 0x24, "4WDM-40 MSA" },
- { 0x23, "4WDM-20 MSA" },
- { 0x22, "4WDM-10 MSA" },
- { 0x21, "100G PAM4 BiDi" },
- { 0x20, "100G SWDM4" },
- { 0x1F, "40G SWDM4" },
- { 0x1E, "2.5GBASE-T" },
- { 0x1D, "5GBASE-T" },
- { 0x1C, "10GBASE-T Short Reach" },
- { 0x1B, "100G 1550nm WDM" },
- { 0x1A, "100GE-DWDM2" },
- { 0x19, "100G ACC or 25GAUI C2M ACC" },
- { 0x18, "100G AOC or 25GAUI C2M AOC" },
- { 0x17, "100G CLR4" },
- { 0x16, "10GBASE-T with SFI electrical interface" },
- { 0x15, "G959.1 profile P1L1-2D2" },
- { 0x14, "G959.1 profile P1S1-2D2" },
- { 0x13, "G959.1 profile P1I1-2D1" },
- { 0x12, "40G PSM4 Parallel SMF" },
- { 0x11, "4 x 10GBASE-SR" },
- { 0x10, "40GBASE-ER4" },
- { 0x0F, "Reserved" },
- { 0x0E, "Reserved" },
- { 0x0D, "25GBASE-CR CA-25G-N" },
- { 0x0C, "25GBASE-CR CA-25G-S" },
- { 0x0B, "100GBASE-CR4 or 25GBASE-CR CA-L" },
- { 0x0A, "Reserved" },
- { 0x09, "Obsolete" },
- { 0x08, "100G ACC (Active Copper Cable) or 25GAUI C2M ACC" },
- { 0x07, "100G PSM4 Parallel SMF" },
- { 0x06, "100G CWDM4" },
- { 0x05, "100GBASE-SR10" },
- { 0x04, "100GBASE-ER4 or 25GBASE-ER" },
- { 0x03, "100GBASE-LR4 or 25GBASE-LR" },
- { 0x02, "100GBASE-SR4 or 25GBASE-SR" },
- { 0x01, "100G AOC (Active Optical Cable) or 25GAUI C2M AOC" },
- { 0x00, "Unspecified" }
-};
-
-/* SFF-8636 Rev. 2.9 table 6.3: Revision compliance */
-static struct _nv rev_compl[] = {
- { 0x1, "SFF-8436 rev <=4.8" },
- { 0x2, "SFF-8436 rev <=4.8" },
- { 0x3, "SFF-8636 rev <=1.3" },
- { 0x4, "SFF-8636 rev <=1.4" },
- { 0x5, "SFF-8636 rev <=1.5" },
- { 0x6, "SFF-8636 rev <=2.0" },
- { 0x7, "SFF-8636 rev <=2.7" },
- { 0x8, "SFF-8636 rev >=2.8" },
- { 0x0, "Unspecified" }
-};
-
-const char *
-find_value(struct _nv *x, int value)
-{
- for (; x->n != NULL; x++)
- if (x->v == value)
- return (x->n);
- return (NULL);
-}
-
-const char *
-find_zero_bit(struct _nv *x, int value, int sz)
-{
- int v, m;
- const char *s;
-
- v = 1;
- for (v = 1, m = 1 << (8 * sz); v < m; v *= 2) {
- if ((value & v) == 0)
- continue;
- if ((s = find_value(x, value & v)) != NULL) {
- value &= ~v;
- return (s);
- }
- }
-
- return (NULL);
-}
-
-static void
-convert_sff_identifier(char *buf, size_t size, uint8_t value)
-{
- const char *x;
-
- x = NULL;
- if (value <= SFF_8024_ID_LAST)
- x = sff_8024_id[value];
- else {
- if (value > 0x80)
- x = "Vendor specific";
- else
- x = "Reserved";
- }
-
- snprintf(buf, size, "%s", x);
-}
-
-static void
-convert_sff_connector(char *buf, size_t size, uint8_t value)
-{
- const char *x;
-
- if ((x = find_value(conn, value)) == NULL) {
- if (value >= 0x0D && value <= 0x1F)
- x = "Unallocated";
- else if (value >= 0x24 && value <= 0x7F)
- x = "Unallocated";
- else
- x = "Vendor specific";
- }
-
- snprintf(buf, size, "%s", x);
-}
-
-static void
-convert_sff_rev_compliance(char *buf, size_t size, uint8_t value)
-{
- const char *x;
-
- if (value > 0x07)
- x = "Unallocated";
- else
- x = find_value(rev_compl, value);
-
- snprintf(buf, size, "%s", x);
-}
-
-static void
-get_sfp_identifier(struct i2c_info *ii, char *buf, size_t size)
-{
- uint8_t data;
-
- read_i2c(ii, SFF_8472_BASE, SFF_8472_ID, 1, &data);
- convert_sff_identifier(buf, size, data);
-}
-
-static void
-get_sfp_connector(struct i2c_info *ii, char *buf, size_t size)
-{
- uint8_t data;
-
- read_i2c(ii, SFF_8472_BASE, SFF_8472_CONNECTOR, 1, &data);
- convert_sff_connector(buf, size, data);
-}
-
-static void
-get_qsfp_identifier(struct i2c_info *ii, char *buf, size_t size)
-{
- uint8_t data;
-
- read_i2c(ii, SFF_8436_BASE, SFF_8436_ID, 1, &data);
- convert_sff_identifier(buf, size, data);
-}
-
-static void
-get_qsfp_connector(struct i2c_info *ii, char *buf, size_t size)
-{
- uint8_t data;
-
- read_i2c(ii, SFF_8436_BASE, SFF_8436_CONNECTOR, 1, &data);
- convert_sff_connector(buf, size, data);
-}
-
-static void
-printf_sfp_transceiver_descr(struct i2c_info *ii, char *buf, size_t size)
-{
- char xbuf[12];
- const char *tech_class, *tech_len, *tech_tech, *tech_media, *tech_speed;
-
- tech_class = NULL;
- tech_len = NULL;
- tech_tech = NULL;
- tech_media = NULL;
- tech_speed = NULL;
-
- /* Read bytes 3-10 at once */
- read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 8, &xbuf[3]);
-
- /* Check 10G ethernet first */
- tech_class = find_zero_bit(eth_10g, xbuf[3], 1);
- if (tech_class == NULL) {
- /* No match. Try 1G */
- tech_class = find_zero_bit(eth_compat, xbuf[6], 1);
- }
-
- tech_len = find_zero_bit(fc_len, xbuf[7], 1);
- tech_tech = find_zero_bit(cab_tech, xbuf[7] << 8 | xbuf[8], 2);
- tech_media = find_zero_bit(fc_media, xbuf[9], 1);
- tech_speed = find_zero_bit(fc_speed, xbuf[10], 1);
-
- printf("Class: %s\n", tech_class);
- printf("Length: %s\n", tech_len);
- printf("Tech: %s\n", tech_tech);
- printf("Media: %s\n", tech_media);
- printf("Speed: %s\n", tech_speed);
-}
-
-static void
-get_sfp_transceiver_class(struct i2c_info *ii, char *buf, size_t size)
-{
- const char *tech_class;
- uint8_t code;
-
- /* Use extended compliance code if it's valid */
- read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS, 1, &code);
- if (code != 0)
- tech_class = find_value(eth_extended_comp, code);
- else {
- /* Next, check 10G Ethernet/IB CCs */
- read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 1, &code);
- tech_class = find_zero_bit(eth_10g, code, 1);
- if (tech_class == NULL) {
- /* No match. Try Ethernet 1G */
- read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START + 3,
- 1, (caddr_t)&code);
- tech_class = find_zero_bit(eth_compat, code, 1);
- }
- }
-
- if (tech_class == NULL)
- tech_class = "Unknown";
-
- snprintf(buf, size, "%s", tech_class);
-}
-
-static void
-get_qsfp_transceiver_class(struct i2c_info *ii, char *buf, size_t size)
-{
- const char *tech_class;
- uint8_t code;
-
- read_i2c(ii, SFF_8436_BASE, SFF_8436_CODE_E1040100G, 1, &code);
-
- /* Check for extended specification compliance */
- if (code & SFF_8636_EXT_COMPLIANCE) {
- read_i2c(ii, SFF_8436_BASE, SFF_8436_OPTIONS_START, 1, &code);
- tech_class = find_value(eth_extended_comp, code);
- } else
- /* Check 10/40G Ethernet class only */
- tech_class = find_zero_bit(eth_1040g, code, 1);
-
- if (tech_class == NULL)
- tech_class = "Unknown";
-
- snprintf(buf, size, "%s", tech_class);
-}
-
-/*
- * Print SFF-8472/SFF-8436 string to supplied buffer.
- * All (vendor-specific) strings are padded right with '0x20'.
- */
-static void
-convert_sff_name(char *buf, size_t size, char *xbuf)
-{
- char *p;
-
- for (p = &xbuf[16]; *(p - 1) == 0x20; p--)
- ;
- *p = '\0';
- snprintf(buf, size, "%s", xbuf);
-}
-
-static void
-convert_sff_date(char *buf, size_t size, char *xbuf)
-{
-
- snprintf(buf, size, "20%c%c-%c%c-%c%c", xbuf[0], xbuf[1],
- xbuf[2], xbuf[3], xbuf[4], xbuf[5]);
-}
-
-static void
-get_sfp_vendor_name(struct i2c_info *ii, char *buf, size_t size)
-{
- char xbuf[17];
+#include <libutil.h>
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8472_BASE, SFF_8472_VENDOR_START, 16, (uint8_t *)xbuf);
- convert_sff_name(buf, size, xbuf);
-}
+#include <libifconfig.h>
+#include <libifconfig_sfp.h>
-static void
-get_sfp_vendor_pn(struct i2c_info *ii, char *buf, size_t size)
-{
- char xbuf[17];
-
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8472_BASE, SFF_8472_PN_START, 16, (uint8_t *)xbuf);
- convert_sff_name(buf, size, xbuf);
-}
-
-static void
-get_sfp_vendor_sn(struct i2c_info *ii, char *buf, size_t size)
-{
- char xbuf[17];
-
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8472_BASE, SFF_8472_SN_START, 16, (uint8_t *)xbuf);
- convert_sff_name(buf, size, xbuf);
-}
+#include "ifconfig.h"
-static void
-get_sfp_vendor_date(struct i2c_info *ii, char *buf, size_t size)
+void
+sfp_status(int s, struct ifreq *ifr, int verbose)
{
- char xbuf[6];
+ struct ifconfig_sfp_info info;
+ struct ifconfig_sfp_info_strings strings;
+ struct ifconfig_sfp_vendor_info vendor_info;
+ struct ifconfig_sfp_status status;
+ ifconfig_handle_t *lifh;
+ const char *name;
+ size_t channel_count;
- memset(xbuf, 0, sizeof(xbuf));
- /* Date code, see Table 3.8 for description */
- read_i2c(ii, SFF_8472_BASE, SFF_8472_DATE_START, 6, (uint8_t *)xbuf);
- convert_sff_date(buf, size, xbuf);
-}
-
-static void
-get_qsfp_vendor_name(struct i2c_info *ii, char *buf, size_t size)
-{
- char xbuf[17];
+ lifh = ifconfig_open();
+ if (lifh == NULL)
+ return;
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8436_BASE, SFF_8436_VENDOR_START, 16, (uint8_t *)xbuf);
- convert_sff_name(buf, size, xbuf);
-}
+ name = ifr->ifr_name;
-static void
-get_qsfp_vendor_pn(struct i2c_info *ii, char *buf, size_t size)
-{
- char xbuf[17];
+ if (ifconfig_sfp_get_sfp_info(lifh, name, &info) == -1)
+ goto close;
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8436_BASE, SFF_8436_PN_START, 16, (uint8_t *)xbuf);
- convert_sff_name(buf, size, xbuf);
-}
+ ifconfig_sfp_get_sfp_info_strings(&info, &strings);
-static void
-get_qsfp_vendor_sn(struct i2c_info *ii, char *buf, size_t size)
-{
- char xbuf[17];
+ printf("\tplugged: %s %s (%s)\n",
+ ifconfig_sfp_id_display(info.sfp_id),
+ ifconfig_sfp_physical_spec(&info, &strings),
+ strings.sfp_conn);
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8436_BASE, SFF_8436_SN_START, 16, (uint8_t *)xbuf);
- convert_sff_name(buf, size, xbuf);
-}
+ if (ifconfig_sfp_get_sfp_vendor_info(lifh, name, &vendor_info) == -1)
+ goto close;
-static void
-get_qsfp_vendor_date(struct i2c_info *ii, char *buf, size_t size)
-{
- char xbuf[6];
+ printf("\tvendor: %s PN: %s SN: %s DATE: %s\n",
+ vendor_info.name, vendor_info.pn, vendor_info.sn, vendor_info.date);
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8436_BASE, SFF_8436_DATE_START, 6, (uint8_t *)xbuf);
- convert_sff_date(buf, size, xbuf);
-}
-
-static void
-print_sfp_vendor(struct i2c_info *ii, char *buf, size_t size)
-{
- char xbuf[80];
-
- memset(xbuf, 0, sizeof(xbuf));
- if (ii->qsfp != 0) {
- get_qsfp_vendor_name(ii, xbuf, 20);
- get_qsfp_vendor_pn(ii, &xbuf[20], 20);
- get_qsfp_vendor_sn(ii, &xbuf[40], 20);
- get_qsfp_vendor_date(ii, &xbuf[60], 20);
+ if (ifconfig_sfp_id_is_qsfp(info.sfp_id)) {
+ if (verbose > 1)
+ printf("\tcompliance level: %s\n", strings.sfp_rev);
} else {
- get_sfp_vendor_name(ii, xbuf, 20);
- get_sfp_vendor_pn(ii, &xbuf[20], 20);
- get_sfp_vendor_sn(ii, &xbuf[40], 20);
- get_sfp_vendor_date(ii, &xbuf[60], 20);
- }
-
- snprintf(buf, size, "vendor: %s PN: %s SN: %s DATE: %s",
- xbuf, &xbuf[20], &xbuf[40], &xbuf[60]);
-}
-
-/*
- * Converts internal templerature (SFF-8472, SFF-8436)
- * 16-bit unsigned value to human-readable representation:
- *
- * Internally measured Module temperature are represented
- * as a 16-bit signed twos complement value in increments of
- * 1/256 degrees Celsius, yielding a total range of 鈥128C to +128C
- * that is considered valid between 鈥40 and +125C.
- *
- */
-static void
-convert_sff_temp(char *buf, size_t size, uint8_t *xbuf)
-{
- double d;
-
- d = (double)xbuf[0];
- d += (double)xbuf[1] / 256;
-
- snprintf(buf, size, "%.2f C", d);
-}
-
-/*
- * Retrieves supplied voltage (SFF-8472, SFF-8436).
- * 16-bit usigned value, treated as range 0..+6.55 Volts
- */
-static void
-convert_sff_voltage(char *buf, size_t size, uint8_t *xbuf)
-{
- double d;
-
- d = (double)((xbuf[0] << 8) | xbuf[1]);
- snprintf(buf, size, "%.2f Volts", d / 10000);
-}
-
-/*
- * Converts value in @xbuf to both milliwats and dBm
- * human representation.
- */
-static void
-convert_sff_power(struct i2c_info *ii, char *buf, size_t size, uint8_t *xbuf)
-{
- uint16_t mW;
- double dbm;
-
- mW = (xbuf[0] << 8) + xbuf[1];
-
- /* Convert mw to dbm */
- dbm = 10.0 * log10(1.0 * mW / 10000);
-
- /*
- * Assume internally-calibrated data.
- * This is always true for SFF-8346, and explicitly
- * checked for SFF-8472.
- */
-
- /* Table 3.9, bit 5 is set, internally calibrated */
- snprintf(buf, size, "%d.%02d mW (%.2f dBm)",
- mW / 10000, (mW % 10000) / 100, dbm);
-}
-
-static void
-get_sfp_temp(struct i2c_info *ii, char *buf, size_t size)
-{
- uint8_t xbuf[2];
-
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8472_DIAG, SFF_8472_TEMP, 2, xbuf);
- convert_sff_temp(buf, size, xbuf);
-}
-
-static void
-get_sfp_voltage(struct i2c_info *ii, char *buf, size_t size)
-{
- uint8_t xbuf[2];
-
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8472_DIAG, SFF_8472_VCC, 2, xbuf);
- convert_sff_voltage(buf, size, xbuf);
-}
-
-static int
-get_qsfp_temp(struct i2c_info *ii, char *buf, size_t size)
-{
- uint8_t xbuf[2];
-
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8436_BASE, SFF_8436_TEMP, 2, xbuf);
- if ((xbuf[0] == 0xFF && xbuf[1] == 0xFF) || (xbuf[0] == 0 && xbuf[1] == 0))
- return (-1);
- convert_sff_temp(buf, size, xbuf);
- return (0);
-}
-
-static void
-get_qsfp_voltage(struct i2c_info *ii, char *buf, size_t size)
-{
- uint8_t xbuf[2];
-
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8436_BASE, SFF_8436_VCC, 2, xbuf);
- convert_sff_voltage(buf, size, xbuf);
-}
-
-static void
-get_sfp_rx_power(struct i2c_info *ii, char *buf, size_t size)
-{
- uint8_t xbuf[2];
-
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8472_DIAG, SFF_8472_RX_POWER, 2, xbuf);
- convert_sff_power(ii, buf, size, xbuf);
-}
-
-static void
-get_sfp_tx_power(struct i2c_info *ii, char *buf, size_t size)
-{
- uint8_t xbuf[2];
-
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8472_DIAG, SFF_8472_TX_POWER, 2, xbuf);
- convert_sff_power(ii, buf, size, xbuf);
-}
-
-static void
-get_qsfp_rx_power(struct i2c_info *ii, char *buf, size_t size, int chan)
-{
- uint8_t xbuf[2];
-
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8436_BASE, SFF_8436_RX_CH1_MSB + (chan-1)*2, 2, xbuf);
- convert_sff_power(ii, buf, size, xbuf);
-}
-
-static void
-get_qsfp_tx_power(struct i2c_info *ii, char *buf, size_t size, int chan)
-{
- uint8_t xbuf[2];
-
- memset(xbuf, 0, sizeof(xbuf));
- read_i2c(ii, SFF_8436_BASE, SFF_8436_TX_CH1_MSB + (chan-1)*2, 2, xbuf);
- convert_sff_power(ii, buf, size, xbuf);
-}
-
-static void
-get_qsfp_rev_compliance(struct i2c_info *ii, char *buf, size_t size)
-{
- uint8_t xbuf;
-
- xbuf = 0;
- read_i2c(ii, SFF_8436_BASE, SFF_8436_STATUS, 1, &xbuf);
- convert_sff_rev_compliance(buf, size, xbuf);
-}
-
-static uint32_t
-get_qsfp_br(struct i2c_info *ii)
-{
- uint8_t xbuf;
- uint32_t rate;
-
- xbuf = 0;
- read_i2c(ii, SFF_8436_BASE, SFF_8436_BITRATE, 1, &xbuf);
- rate = xbuf * 100;
- if (xbuf == 0xFF) {
- read_i2c(ii, SFF_8436_BASE, SFF_8636_BITRATE, 1, &xbuf);
- rate = xbuf * 250;
- }
-
- return (rate);
-}
-
-/*
- * Reads i2c data from opened kernel socket.
- */
-static int
-read_i2c(struct i2c_info *ii, uint8_t addr, uint8_t off, uint8_t len,
- uint8_t *buf)
-{
- struct ifi2creq req;
- int i, l;
-
- if (ii->error != 0)
- return (ii->error);
-
- ii->ifr->ifr_data = (caddr_t)&req;
-
- i = 0;
- l = 0;
- memset(&req, 0, sizeof(req));
- req.dev_addr = addr;
- req.offset = off;
- req.len = len;
-
- while (len > 0) {
- l = MIN(sizeof(req.data), len);
- req.len = l;
- if (ioctl(ii->fd, SIOCGI2C, ii->ifr) != 0) {
- ii->error = errno;
- return (errno);
+ if (verbose > 5) {
+ printf("Class: %s\n",
+ ifconfig_sfp_physical_spec(&info, &strings));
+ printf("Length: %s\n", strings.sfp_fc_len);
+ printf("Tech: %s\n", strings.sfp_cab_tech);
+ printf("Media: %s\n", strings.sfp_fc_media);
+ printf("Speed: %s\n", strings.sfp_fc_speed);
}
-
- memcpy(&buf[i], req.data, l);
- len -= l;
- i += l;
- req.offset += l;
}
- return (0);
-}
-
-static void
-dump_i2c_data(struct i2c_info *ii, uint8_t addr, uint8_t off, uint8_t len)
-{
- unsigned char buf[16];
- int i, read;
-
- while (len > 0) {
- memset(buf, 0, sizeof(buf));
- read = MIN(sizeof(buf), len);
- read_i2c(ii, addr, off, read, buf);
- if (ii->error != 0) {
- fprintf(stderr, "Error reading i2c info\n");
- return;
+ if (ifconfig_sfp_get_sfp_status(lifh, name, &status) == 0) {
+ if (ifconfig_sfp_id_is_qsfp(info.sfp_id) && verbose > 1)
+ printf("\tnominal bitrate: %u Mbps\n", status.bitrate);
+ printf("\tmodule temperature: %.2f C voltage: %.2f Volts\n",
+ status.temp, status.voltage);
+ channel_count = ifconfig_sfp_channel_count(&info);
+ for (size_t chan = 0; chan < channel_count; ++chan) {
+ uint16_t rx = status.channel[chan].rx;
+ uint16_t tx = status.channel[chan].tx;
+ printf("\tlane %zu: "
+ "RX power: %.2f mW (%.2f dBm) TX bias: %.2f mA\n",
+ chan + 1, power_mW(rx), power_dBm(rx), bias_mA(tx));
}
-
- printf("\t");
- for (i = 0; i < read; i++)
- printf("%02X ", buf[i]);
- printf("\n");
- len -= read;
- off += read;
- }
-}
-
-static void
-print_qsfp_status(struct i2c_info *ii, int verbose)
-{
- char buf[80], buf2[40], buf3[40];
- uint32_t bitrate;
- int i;
-
- ii->qsfp = 1;
-
- /* Transceiver type */
- get_qsfp_identifier(ii, buf, sizeof(buf));
- get_qsfp_transceiver_class(ii, buf2, sizeof(buf2));
- get_qsfp_connector(ii, buf3, sizeof(buf3));
- if (ii->error == 0)
- printf("\tplugged: %s %s (%s)\n", buf, buf2, buf3);
- print_sfp_vendor(ii, buf, sizeof(buf));
- if (ii->error == 0)
- printf("\t%s\n", buf);
-
- if (verbose > 1) {
- get_qsfp_rev_compliance(ii, buf, sizeof(buf));
- if (ii->error == 0)
- printf("\tcompliance level: %s\n", buf);
-
- bitrate = get_qsfp_br(ii);
- if (ii->error == 0 && bitrate > 0)
- printf("\tnominal bitrate: %u Mbps\n", bitrate);
- }
-
- /*
- * The standards in this area are not clear when the
- * additional measurements are present or not. Use a valid
- * temperature reading as an indicator for the presence of
- * voltage and TX/RX power measurements.
- */
- if (get_qsfp_temp(ii, buf, sizeof(buf)) == 0) {
- get_qsfp_voltage(ii, buf2, sizeof(buf2));
- printf("\tmodule temperature: %s voltage: %s\n", buf, buf2);
- for (i = 1; i <= 4; i++) {
- get_qsfp_rx_power(ii, buf, sizeof(buf), i);
- get_qsfp_tx_power(ii, buf2, sizeof(buf2), i);
- printf("\tlane %d: RX: %s TX: %s\n", i, buf, buf2);
- }
- }
-
- if (verbose > 2) {
- printf("\n\tSFF8436 DUMP (0xA0 128..255 range):\n");
- dump_i2c_data(ii, SFF_8436_BASE, 128, 128);
- printf("\n\tSFF8436 DUMP (0xA0 0..81 range):\n");
- dump_i2c_data(ii, SFF_8436_BASE, 0, 82);
- }
-}
-
-static void
-print_sfp_status(struct i2c_info *ii, int verbose)
-{
- char buf[80], buf2[40], buf3[40];
- uint8_t diag_type, flags;
-
- /* Read diagnostic monitoring type */
- read_i2c(ii, SFF_8472_BASE, SFF_8472_DIAG_TYPE, 1, (caddr_t)&diag_type);
- if (ii->error != 0)
- return;
-
- /*
- * Read monitoring data IFF it is supplied AND is
- * internally calibrated
- */
- flags = SFF_8472_DDM_DONE | SFF_8472_DDM_INTERNAL;
- if ((diag_type & flags) == flags)
- ii->do_diag = 1;
-
- /* Transceiver type */
- get_sfp_identifier(ii, buf, sizeof(buf));
- get_sfp_transceiver_class(ii, buf2, sizeof(buf2));
- get_sfp_connector(ii, buf3, sizeof(buf3));
- if (ii->error == 0)
- printf("\tplugged: %s %s (%s)\n", buf, buf2, buf3);
- print_sfp_vendor(ii, buf, sizeof(buf));
- if (ii->error == 0)
- printf("\t%s\n", buf);
-
- if (verbose > 5)
- printf_sfp_transceiver_descr(ii, buf, sizeof(buf));
- /*
- * Request current measurements iff they are provided:
- */
- if (ii->do_diag != 0) {
- get_sfp_temp(ii, buf, sizeof(buf));
- get_sfp_voltage(ii, buf2, sizeof(buf2));
- printf("\tmodule temperature: %s Voltage: %s\n", buf, buf2);
- get_sfp_rx_power(ii, buf, sizeof(buf));
- get_sfp_tx_power(ii, buf2, sizeof(buf2));
- printf("\tRX: %s TX: %s\n", buf, buf2);
+ ifconfig_sfp_free_sfp_status(&status);
}
if (verbose > 2) {
- printf("\n\tSFF8472 DUMP (0xA0 0..127 range):\n");
- dump_i2c_data(ii, SFF_8472_BASE, 0, 128);
+ struct ifconfig_sfp_dump dump;
+
+ if (ifconfig_sfp_get_sfp_dump(lifh, name, &dump) == -1)
+ goto close;
+
+ if (ifconfig_sfp_id_is_qsfp(info.sfp_id)) {
+ printf("\n\tSFF8436 DUMP (0xA0 128..255 range):\n");
+ hexdump(dump.data + QSFP_DUMP1_START, QSFP_DUMP1_SIZE,
+ "\t", HD_OMIT_COUNT | HD_OMIT_CHARS);
+ printf("\n\tSFF8436 DUMP (0xA0 0..81 range):\n");
+ hexdump(dump.data + QSFP_DUMP0_START, QSFP_DUMP0_SIZE,
+ "\t", HD_OMIT_COUNT | HD_OMIT_CHARS);
+ } else {
+ printf("\n\tSFF8472 DUMP (0xA0 0..127 range):\n");
+ hexdump(dump.data + SFP_DUMP_START, SFP_DUMP_SIZE,
+ "\t", HD_OMIT_COUNT | HD_OMIT_CHARS);
+ }
}
-}
-
-void
-sfp_status(int s, struct ifreq *ifr, int verbose)
-{
- struct i2c_info ii;
- uint8_t id_byte;
- /* Prepare necessary into pass to i2c reader */
- memset(&ii, 0, sizeof(ii));
- ii.fd = s;
- ii.ifr = ifr;
-
- /*
- * Try to read byte 0 from i2c:
- * Both SFF-8472 and SFF-8436 use it as
- * 'identification byte'.
- * Stop reading status on zero as value -
- * this might happen in case of empty transceiver slot.
- */
- id_byte = 0;
- read_i2c(&ii, SFF_8472_BASE, SFF_8472_ID, 1, (caddr_t)&id_byte);
- if (ii.error != 0 || id_byte == 0)
- return;
-
- switch (id_byte) {
- case SFF_8024_ID_QSFP:
- case SFF_8024_ID_QSFPPLUS:
- case SFF_8024_ID_QSFP28:
- print_qsfp_status(&ii, verbose);
- break;
- default:
- print_sfp_status(&ii, verbose);
- }
+close:
+ ifconfig_close(lifh);
}
-
diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8
index ea35a2767845..58bc3662fcc7 100644
--- a/sbin/ipfw/ipfw.8
+++ b/sbin/ipfw/ipfw.8
@@ -1,7 +1,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 21, 2019
+.Dd August 10, 2020
.Dt IPFW 8
.Os
.Sh NAME
@@ -600,7 +600,7 @@ See Section
By name or address
.It Misc. IP header fields
Version, type of service, datagram length, identification,
-fragment flag (non-zero IP offset),
+fragmentation flags,
Time To Live
.It IP options
.It IPv6 Extension headers
@@ -1602,12 +1602,29 @@ Matches IPv6 packets containing any of the flow labels given in
.Ar labels .
.Ar labels
is a comma separated list of numeric flow labels.
-.It Cm frag
-Matches packets that are fragments and not the first
-fragment of an IP datagram.
-Note that these packets will not have
-the next protocol header (e.g.\& TCP, UDP) so options that look into
-these headers cannot match.
+.It Cm frag Ar spec
+Matches IPv4 packets whose
+.Cm ip_off
+field contains the comma separated list of IPv4 fragmentation
+options specified in
+.Ar spec .
+The recognized options are:
+.Cm df
+.Pq Dv don't fragment ,
+.Cm mf
+.Pq Dv more fragments ,
+.Cm rf
+.Pq Dv reserved fragment bit
+.Cm offset
+.Pq Dv non-zero fragment offset .
+The absence of a particular options may be denoted
+with a
+.Ql \&! .
+.Pp
+Empty list of options defaults to matching on non-zero fragment offset.
+Such rule would match all not the first fragment datagrams,
+both IPv4 and IPv6.
+This is a backward compatibility with older rulesets.
.It Cm gid Ar group
Matches all TCP or UDP packets sent by or received for a
.Ar group .
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index d4c81d5e4d66..830b35d2f723 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -168,6 +168,14 @@ static struct _s_x f_iptos[] = {
{ NULL, 0 }
};
+static struct _s_x f_ipoff[] = {
+ { "rf", IP_RF >> 8 },
+ { "df", IP_DF >> 8 },
+ { "mf", IP_MF >> 8 },
+ { "offset", 0x1 },
+ { NULL, 0}
+};
+
struct _s_x f_ipdscp[] = {
{ "af11", IPTOS_DSCP_AF11 >> 2 }, /* 001010 */
{ "af12", IPTOS_DSCP_AF12 >> 2 }, /* 001100 */
@@ -1531,7 +1539,7 @@ print_instruction(struct buf_pr *bp, const struct format_opts *fo,
IPPROTO_ETHERTYPE, cmd->opcode);
break;
case O_FRAG:
- bprintf(bp, " frag");
+ print_flags(bp, "frag", cmd, f_ipoff);
break;
case O_FIB:
bprintf(bp, " fib %u", cmd->arg1);
@@ -4553,7 +4561,15 @@ read_options:
break;
case TOK_FRAG:
- fill_cmd(cmd, O_FRAG, 0, 0);
+ fill_flags_cmd(cmd, O_FRAG, f_ipoff, *av);
+ /*
+ * Compatibility: no argument after "frag"
+ * keyword equals to "frag offset".
+ */
+ if (cmd->arg1 == 0)
+ cmd->arg1 = 0x1;
+ else
+ av++;
break;
case TOK_LAYER2:
diff --git a/sbin/ipfw/nat64clat.c b/sbin/ipfw/nat64clat.c
index 081d199bd59d..962fe7064f8d 100644
--- a/sbin/ipfw/nat64clat.c
+++ b/sbin/ipfw/nat64clat.c
@@ -303,6 +303,9 @@ nat64clat_config(const char *name, uint8_t set, int ac, char **av)
if ((p = strchr(*av, '/')) != NULL)
*p++ = '\0';
+ else
+ errx(EX_USAGE,
+ "Prefix length required: %s", *av);
if (inet_pton(AF_INET6, *av, &prefix) != 1)
errx(EX_USAGE,
"Bad prefix: %s", *av);
diff --git a/sbin/ipfw/nat64stl.c b/sbin/ipfw/nat64stl.c
index 44e0cbafbf3e..e82ec202b5c6 100644
--- a/sbin/ipfw/nat64stl.c
+++ b/sbin/ipfw/nat64stl.c
@@ -249,6 +249,9 @@ nat64stl_create(const char *name, uint8_t set, int ac, char *av[])
NEED1("IPv6 prefix6 required");
if ((p = strchr(*av, '/')) != NULL)
*p++ = '\0';
+ else
+ errx(EX_USAGE,
+ "Prefix length required: %s", *av);
if (inet_pton(AF_INET6, *av, &cfg->prefix6) != 1)
errx(EX_USAGE,
"Bad prefix: %s", *av);
diff --git a/sbin/iscontrol/Makefile b/sbin/iscontrol/Makefile
index 07dcbfec9f1c..613444a468f4 100644
--- a/sbin/iscontrol/Makefile
+++ b/sbin/iscontrol/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-PACKAGE=iscsi_legacy
+PACKAGE=iscsilegacy
SRCS= iscontrol.c pdu.c fsm.c config.c login.c auth_subr.c misc.c
PROG= iscontrol
LIBADD= cam md
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c
index 938a220b41c3..e9424c4eb413 100644
--- a/sbin/mount/mount.c
+++ b/sbin/mount/mount.c
@@ -697,9 +697,9 @@ prmount(struct statfs *sfp)
(uintmax_t)sfp->f_syncreads,
(uintmax_t)sfp->f_asyncreads);
if (sfp->f_fsid.val[0] != 0 || sfp->f_fsid.val[1] != 0) {
- printf(", fsid ");
+ (void)printf(", fsid ");
for (i = 0; i < sizeof(sfp->f_fsid); i++)
- printf("%02x", ((u_char *)&sfp->f_fsid)[i]);
+ (void)printf("%02x", ((u_char *)&sfp->f_fsid)[i]);
}
}
(void)printf(")\n");
diff --git a/sbin/route/tests/basic.sh b/sbin/route/tests/basic.sh
index 6141097a09ec..370a96a25892 100644
--- a/sbin/route/tests/basic.sh
+++ b/sbin/route/tests/basic.sh
@@ -34,7 +34,7 @@ basic_v4_head()
{
atf_set descr 'add/change/delete route test for v4'
atf_set require.user root
- atf_set require.progs jq
+ atf_set require.progs jail jq
}
basic_v4_body()
@@ -79,7 +79,7 @@ basic_v6_head()
{
atf_set descr 'add/change/delete route test for v6'
atf_set require.user root
- atf_set require.progs jq
+ atf_set require.progs jail jq
}
basic_v6_body()
diff --git a/share/dtrace/mbuf.d b/share/dtrace/mbuf.d
index b172daeb413a..0e2f47495472 100644
--- a/share/dtrace/mbuf.d
+++ b/share/dtrace/mbuf.d
@@ -53,37 +53,41 @@ inline int M_MCAST = 0x00000020; /* send/received as link-level multicast */
inline int M_PROMISC = 0x00000040; /* packet was not for us */
#pragma D binding "1.6.3" M_VLANTAG
inline int M_VLANTAG = 0x00000080; /* ether_vtag is valid */
-#pragma D binding "1.6.3" M_UNUSED_8
-inline int M_UNUSED_8 = 0x00000100; /* --available-- */
+#pragma D binding "1.13" M_EXTPG
+inline int M_EXTPG = 0x00000100; /* has array of unmapped pages and TLS */
#pragma D binding "1.6.3" M_NOFREE
inline int M_NOFREE = 0x00000200; /* do not free mbuf, embedded in cluster */
+#pragma D binding "1.13" M_TSTMP
+inline int M_TSTMP = 0x00000400; /* rcv_tstmp field is valid */
+#pragma D binding "1.13" M_TSTMP_HPREC
+inline int M_TSTMP_HPREC = 0x00000800; /* rcv_tstmp is high-prec */
+#pragma D binding "1.13" M_TSTMP_LRO
+inline int M_TSTMP_LRO = 0x00001000; /* Time LRO pushed in pkt is valid */
+
+#pragma D binding "1.13" M_PROTO1
+inline int M_PROTO1 = 0x00002000; /* protocol-specific */
+#pragma D binding "1.13" M_PROTO2
+inline int M_PROTO2 = 0x00004000; /* protocol-specific */
+#pragma D binding "1.13" M_PROTO3
+inline int M_PROTO3 = 0x00008000; /* protocol-specific */
+#pragma D binding "1.13" M_PROTO4
+inline int M_PROTO4 = 0x00010000; /* protocol-specific */
+#pragma D binding "1.13" M_PROTO5
+inline int M_PROTO5 = 0x00020000; /* protocol-specific */
+#pragma D binding "1.13" M_PROTO6
+inline int M_PROTO6 = 0x00040000; /* protocol-specific */
+#pragma D binding "1.13" M_PROTO7
+inline int M_PROTO7 = 0x00080000; /* protocol-specific */
+#pragma D binding "1.13" M_PROTO8
+inline int M_PROTO8 = 0x00100000; /* protocol-specific */
+#pragma D binding "1.13" M_PROTO9
+inline int M_PROTO9 = 0x00200000; /* protocol-specific */
+#pragma D binding "1.13" M_PROTO10
+inline int M_PROTO10 = 0x00400000; /* protocol-specific */
+#pragma D binding "1.13" M_PROTO11
+inline int M_PROTO11 = 0x00800000; /* protocol-specific */
-#pragma D binding "1.6.3" M_PROTO1
-inline int M_PROTO1 = 0x00001000; /* protocol-specific */
-#pragma D binding "1.6.3" M_PROTO2
-inline int M_PROTO2 = 0x00002000; /* protocol-specific */
-#pragma D binding "1.6.3" M_PROTO3
-inline int M_PROTO3 = 0x00004000; /* protocol-specific */
-#pragma D binding "1.6.3" M_PROTO4
-inline int M_PROTO4 = 0x00008000; /* protocol-specific */
-#pragma D binding "1.6.3" M_PROTO5
-inline int M_PROTO5 = 0x00010000; /* protocol-specific */
-#pragma D binding "1.6.3" M_PROTO6
-inline int M_PROTO6 = 0x00020000; /* protocol-specific */
-#pragma D binding "1.6.3" M_PROTO7
-inline int M_PROTO7 = 0x00040000; /* protocol-specific */
-#pragma D binding "1.6.3" M_PROTO8
-inline int M_PROTO8 = 0x00080000; /* protocol-specific */
-#pragma D binding "1.6.3" M_PROTO9
-inline int M_PROTO9 = 0x00100000; /* protocol-specific */
-#pragma D binding "1.6.3" M_PROTO10
-inline int M_PROTO10 = 0x00200000; /* protocol-specific */
-#pragma D binding "1.6.3" M_PROTO11
-inline int M_PROTO11 = 0x00400000; /* protocol-specific */
-#pragma D binding "1.6.3" M_PROTO12
-inline int M_PROTO12 = 0x00800000; /* protocol-specific */
-
-#pragma D binding "1.6.3" mbufflags_string
+#pragma D binding "1.13" mbufflags_string
inline string mbufflags_string[uint32_t flags] =
flags & M_EXT ? "M_EXT" :
flags & M_PKTHDR ? "M_PKTHDR" :
@@ -93,8 +97,11 @@ inline string mbufflags_string[uint32_t flags] =
flags & M_MCAST ? "M_MCAST" :
flags & M_PROMISC ? "M_PROMISC" :
flags & M_VLANTAG ? "M_VLANTAG" :
- flags & M_UNUSED_8 ? "M_UNUSED_8" :
- flags & M_NOFREE ? "M_NOFREE" :
+ flags & M_EXTPG ? "M_EXTPG" :
+ flags & M_NOFREE ? "M_NOFREE" :
+ flags & M_TSTMP ? "M_TSTMP" :
+ flags & M_TSTMP_HPREC ? "M_TSTMP_HPREC" :
+ flags & M_TSTMP_LRO ? "M_TSTMP_LRO" :
flags & M_PROTO1 ? "M_PROTO1" :
flags & M_PROTO2 ? "M_PROTO2" :
flags & M_PROTO3 ? "M_PROTO3" :
@@ -106,7 +113,6 @@ inline string mbufflags_string[uint32_t flags] =
flags & M_PROTO9 ? "M_PROTO9" :
flags & M_PROTO10 ? "M_PROTO10" :
flags & M_PROTO11 ? "M_PROTO11" :
- flags & M_PROTO12 ? "M_PROTO12" :
"none" ;
typedef struct mbufinfo {
diff --git a/share/examples/etc/make.conf b/share/examples/etc/make.conf
index 37b3b774c8d2..a7afe4d8b6eb 100644
--- a/share/examples/etc/make.conf
+++ b/share/examples/etc/make.conf
@@ -239,13 +239,11 @@
#
# with SASLv1:
# SENDMAIL_CFLAGS=-I/usr/local/include/sasl1 -DSASL
-# SENDMAIL_LDFLAGS=-L/usr/local/lib
-# SENDMAIL_LDADD=-lsasl
+# SENDMAIL_LDADD=/usr/local/lib/libsasl.so
#
# with SASLv2:
# SENDMAIL_CFLAGS=-I/usr/local/include -DSASL=2
-# SENDMAIL_LDFLAGS=-L/usr/local/lib
-# SENDMAIL_LDADD=-lsasl2
+# SENDMAIL_LDADD=/usr/local/lib/libsasl2.so
#
# Note: If you are using Cyrus SASL with other applications which require
# access to the sasldb file, you should add the following to your
diff --git a/share/examples/ipfilter/Makefile b/share/examples/ipfilter/Makefile
index e2d2e02897a5..18c8ac734406 100644
--- a/share/examples/ipfilter/Makefile
+++ b/share/examples/ipfilter/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-PACKAGE=examples
+PACKAGE=ipf
FILES= README
# dist sample files
diff --git a/share/examples/smbfs/Makefile b/share/examples/smbfs/Makefile
index e8e5f1cc0d32..a653507f54b0 100644
--- a/share/examples/smbfs/Makefile
+++ b/share/examples/smbfs/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-PACKAGE=examples
+PACKAGE=utilities
FILESDIR= ${SHAREDIR}/examples/smbfs
FILES= dot.nsmbrc
diff --git a/share/examples/smbfs/print/Makefile b/share/examples/smbfs/print/Makefile
index 410e9526593f..0c080c0861b3 100644
--- a/share/examples/smbfs/print/Makefile
+++ b/share/examples/smbfs/print/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-PACKAGE=examples
+PACKAGE=utilities
FILESDIR= ${SHAREDIR}/examples/smbfs/print
FILES= lj6l ljspool printcap.sample tolj
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index 9049f3feb5e3..95ed799361f2 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -113,6 +113,7 @@ MAN= aac.4 \
cloudabi.4 \
cmx.4 \
${_coretemp.4} \
+ cp2112.4 \
${_cpuctl.4} \
cpufreq.4 \
crypto.4 \
@@ -171,6 +172,7 @@ MAN= aac.4 \
gif.4 \
gpio.4 \
gpioiic.4 \
+ gpiokeys.4 \
gpioled.4 \
gpioths.4 \
gre.4 \
diff --git a/share/man/man4/cp2112.4 b/share/man/man4/cp2112.4
new file mode 100644
index 000000000000..39ac8dba114e
--- /dev/null
+++ b/share/man/man4/cp2112.4
@@ -0,0 +1,87 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+.\"
+.\" Copyright (c) 2020 Andriy Gapon <avg@FreeBSD.org>
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd August 12, 2020
+.Dt CP2112 4
+.Os
+.Sh NAME
+.Nm cp2112
+.Nd driver for a USB GPIO and I2C peripheral device
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device cp2112"
+.Cd "device usb"
+.Cd "device gpio"
+.Cd "device iicbus"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+cp2112_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for Silicon Labs CP2112 device.
+The device has 8 general purpose I/O pins and an I2C controller that supports
+a subset of the I2C protocol.
+.Pp
+All pins support both input and output modes.
+An output pin can be configured either for open-drain or push-pull operation.
+Pins 0, 1 and 7 support special functions: I2C transmit indication,
+I2C receive indication and clock output respectively.
+At the moment the
+.Nm
+driver does not provide a way to enable and configure the special functions.
+.Pp
+The I2C controller supports read transactions with up to 512 bytes of data,
+write transactions with up to 61 bytes of data and a write followed by
+the repeated start followed by a read transactions where the write can be
+up to 16 bytes and the read can be up to 512 bytes.
+Zero length transfers are not supported.
+The
+.Nm
+driver creates a
+.Xr gpio 4
+and
+.Xr iicbus 4
+child buses to expose the respective functions.
+.Sh SEE ALSO
+.Xr gpio 4 ,
+.Xr iicbus 4 ,
+.Xr usb 4
+.Sh HISTORY
+The
+.Nm
+driver and this manual page was written by
+.An Andriy Gapon Aq Mt avg@FreeBSD.org .
diff --git a/share/man/man4/gpiokeys.4 b/share/man/man4/gpiokeys.4
new file mode 100644
index 000000000000..5af11cedb7e0
--- /dev/null
+++ b/share/man/man4/gpiokeys.4
@@ -0,0 +1,152 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+.\"
+.\" Copyright (c) 2020 Andriy Gapon <avg@FreeBSD.org>
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd August 5, 2020
+.Dt GPIOKEYS 4
+.Os
+.Sh NAME
+.Nm gpiokeys
+.Nd GPIO keys device driver
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "options FDT"
+.Cd "device gpio"
+.Cd "device gpiokeys"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+gpiokeys_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides a way to represent a set of general purpose inputs as a
+.Xr keyboard 4
+device.
+At the moment the driver supports only
+.Xr FDT 4
+based systems.
+The DTS determines what pins are mapped to buttons and what key codes are
+generated for each virtual button.
+The
+.Xr keyboard 4
+device can be used from userland to monitor for input changes.
+.Pp
+On an
+.Xr FDT 4
+based system
+the DTS part for a
+.Nm
+device usually looks like:
+.Bd -literal
+/ {
+
+ ...
+
+ gpio_keys {
+ compatible = "gpio-keys";
+
+ btn1 {
+ label = "button1";
+ linux,code = <KEY_1>;
+ gpios = <&gpio 0 3 GPIO_ACTIVE_LOW>
+ };
+
+ btn2 {
+ label = "button2";
+ linux,code = <KEY_2>;
+ gpios = <&gpio 0 4 GPIO_ACTIVE_LOW>
+ };
+ };
+};
+.Ed
+.Pp
+For more details about the
+.Va gpios
+property, please consult
+.Pa /usr/src/sys/dts/bindings-gpio.txt .
+.Pp
+The
+.Nm
+driver supports two properties for specifying a key code.
+.Pp
+The property
+.Va freebsd,code
+specifies a
+.Fx
+native scancode compatible with
+.Xr kbdmap 5
+keyboard maps.
+.Pp
+The property
+.Va linux,code
+specifies an evdev scancode.
+That scancode is internally translated to a native scancode.
+Note that not all evdev scancodes have corresponding native scancodes.
+If a scancode cannot be translated, then a diagnostic message is printed
+and the input is ignored.
+.Pp
+The property
+.Va label
+is a descriptive name of a button.
+It is used for diagnostic messages only.
+This property is optional.
+If not set, the node name is used in its place.
+.Pp
+The property
+.Va autorepeat
+determines whether autorepeat is enabled for a button.
+.Pp
+The property
+.Va debounce-interval
+defines debouncing interval time in milliseconds.
+If not specified the interval defaults to 5.
+.Sh SEE ALSO
+.Xr fdt 4 ,
+.Xr gpio 4 ,
+.Xr keyboard 4 ,
+.Xr kbdmap 5
+.Sh HISTORY
+The
+.Nm
+manual page first appeared in
+.Fx 12.2 .
+.Sh AUTHORS
+The
+.Nm
+driver was written by
+.An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org .
+This
+manual page was written by
+.An Andriy Gapon Aq Mt avg@FreeBSD.org .
diff --git a/share/man/man4/net80211.4 b/share/man/man4/net80211.4
index 650bbf48272a..629e84c35566 100644
--- a/share/man/man4/net80211.4
+++ b/share/man/man4/net80211.4
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 10, 2009
+.Dd August 7, 2020
.Dt NET80211 4
.Os
.Sh NAME
@@ -393,6 +393,16 @@ Valid values are:
and
.Dv IEEE80211_HWMP_ROOTMODE_RANN
(send broadcast Root Announcement (RANN) frames).
+.It Dv IEEE80211_IOC_IC_NAME
+Return the underlying hardware
+.Xr device 9
+name in the buffer pointed to by
+.Va i_data
+and the name length including terminating NUL character in
+.Va i_len .
+If the buffer length is too small to hold the full name
+.Er EINVAL
+will be returned.
.It Dv IEEE80211_IOC_INACTIVITY
Return whether or not the system handles inactivity processing in
.Va i_val .
diff --git a/share/man/man4/unix.4 b/share/man/man4/unix.4
index 8832e5eff870..569e6dd25208 100644
--- a/share/man/man4/unix.4
+++ b/share/man/man4/unix.4
@@ -28,7 +28,7 @@
.\" @(#)unix.4 8.1 (Berkeley) 6/9/93
.\" $FreeBSD$
.\"
-.Dd August 19, 2018
+.Dd August 3, 2020
.Dt UNIX 4
.Os
.Sh NAME
@@ -195,7 +195,9 @@ The sending process could have exited and its process ID already been
reused for a new process.
.Sh SOCKET OPTIONS
.Tn UNIX
-domain sockets support a number of socket options which can be set with
+domain sockets support a number of socket options for the options level
+.Dv SOL_LOCAL ,
+which can be set with
.Xr setsockopt 2
and tested with
.Xr getsockopt 2 :
diff --git a/share/man/man5/core.5 b/share/man/man5/core.5
index c7449637b910..500da31a310c 100644
--- a/share/man/man5/core.5
+++ b/share/man/man5/core.5
@@ -28,7 +28,7 @@
.\" @(#)core.5 8.3 (Berkeley) 12/11/93
.\" $FreeBSD$
.\"
-.Dd February 13, 2018
+.Dd August 2, 2020
.Dt CORE 5
.Os
.Sh NAME
@@ -171,4 +171,4 @@ command can be used:
A
.Nm
file format appeared in
-.At v6 .
+.At v1 .
diff --git a/share/man/man7/build.7 b/share/man/man7/build.7
index 73d09a403428..3f3af710d97d 100644
--- a/share/man/man7/build.7
+++ b/share/man/man7/build.7
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 3, 2020
+.Dd August 5, 2020
.Dt BUILD 7
.Os
.Sh NAME
@@ -41,10 +41,8 @@ and
.Pa /usr/ports .
These directories may be initially empty or non-existent until updated with
.Xr svn 1
-or
-.Xr svnlite 1
-or
-.Xr portsnap 8 .
+(or
+.Xr svnlite 1 ) .
Directory
.Pa /usr/src
contains the
@@ -852,7 +850,6 @@ manpage first appeared in
.Xr tests 7 ,
.Xr config 8 ,
.Xr mergemaster 8 ,
-.Xr portsnap 8 ,
.Xr reboot 8 ,
.Xr shutdown 8
.Sh AUTHORS
diff --git a/share/man/man7/environ.7 b/share/man/man7/environ.7
index 2d22afbad90a..9a77100ff6d3 100644
--- a/share/man/man7/environ.7
+++ b/share/man/man7/environ.7
@@ -28,7 +28,7 @@
.\" @(#)environ.7 8.3 (Berkeley) 4/19/94
.\" $FreeBSD$
.\"
-.Dd February 14, 2020
+.Dd August 5, 2020
.Dt ENVIRON 7
.Os
.Sh NAME
@@ -37,21 +37,59 @@
.Sh SYNOPSIS
.Ar extern char **environ ;
.Sh DESCRIPTION
-An array of strings called the
+An array of strings, called the
.Ar environment
-is made available by
+is made available to each process by
.Xr execve 2
when a process begins.
By convention these strings have the form
-.Dq Ar name=value .
-The following names are used by various commands:
-.Bl -tag -width LC_MONETARY
+.Va name Ns No = Ns Ar value ,
+and are referred to as
+.Dq environment variables .
+A process can query, update, and delete these strings using the
+.Xr getenv 3 ,
+.Xr setenv 3 ,
+and
+.Xr unsetenv 3
+functions, respectively.
+The shells also provide commands to manipulate the environment;
+they are described in the respective shell manual pages.
+.Pp
+What follows is a list of environment variables typically
+seen on a
+.Ux
+system.
+It includes only those variables that a user can expect to see during their
+day-to-day use of the system, and is far from complete.
+Environment variables specific to a particular program or library function
+are documented in the
+.Sx ENVIRONMENT
+section of the appropriate manual page.
+.Sh ENVIRONMENT
+.Bl -tag -width LD_LIBRARY_PATH
.It Ev BLOCKSIZE
-The size of the block units used by several commands, most notably
+The size of the block units used by several disk-related commands,
+most notably
.Xr df 1 ,
.Xr du 1
and
.Xr ls 1 .
+.Ev BLOCKSIZE
+may be specified in units of a byte by specifying a number,
+in units of a kilobyte by specifying a number followed by
+.Ql K
+or
+.Ql k ,
+in units of a megabyte by specifying a number followed by
+.Ql M
+or
+.Ql m ,
+and in units of a gigabyte by specifying a number followed
+by
+.Ql G
+or
+.Ql g .
+Sizes less than 512 bytes or greater than a gigabyte are ignored.
This variable is processed by the
.Xr getbsize 3
function.
@@ -117,6 +155,10 @@ used by
.Xr mail 1 ,
.Xr sh 1 ,
and many other mail clients.
+.It Ev MANPATH
+The sequence of directories, separated by colons, searched by
+.Xr man 1
+when looking for manual pages.
.It Ev NLSPATH
List of directories to be searched for the message catalog referred to by
.Ev LC_MESSAGES .
@@ -139,6 +181,9 @@ etc, when looking for an executable file.
.Ev PATH
is set to ``/usr/bin:/bin'' initially by
.Xr login 1 .
+.It Ev POSIXLY_CORRECT
+When set to any value, this environment variable modifies the behaviour
+of certain commands to (mostly) execute in a strictly POSIX-compliant manner.
.It Ev PRINTER
The name of the default printer to be used by
.Xr lpr 1 ,
@@ -178,7 +223,7 @@ no
is equivalent to a
.Ev TERMPATH
of
-.Dq Pa $HOME/.termcap:/etc/termcap .
+.Pa $HOME/.termcap:/etc/termcap .
.Ev TERMPATH
is ignored if
.Ev TERMCAP
@@ -186,22 +231,27 @@ contains a full pathname.
.It Ev TMPDIR
The directory in which to store temporary files.
Most applications use either
-.Dq /tmp
+.Pa /tmp
or
-.Dq /var/tmp .
+.Pa /var/tmp .
Setting this variable will make them use another directory.
.It Ev TZ
The timezone to use when displaying dates.
The normal format is a pathname relative to
-.Dq Pa /usr/share/zoneinfo .
+.Pa /usr/share/zoneinfo .
For example, the command
-.Dq env TZ=America/Los_Angeles date
+.Pp
+.Dl env TZ=America/Los_Angeles date
+.Pp
displays the current time in California.
See
.Xr tzset 3
for more information.
.It Ev USER
The login name of the user.
+It is recommended that portable applications use
+.Ev LOGNAME
+instead.
.El
.Pp
Further names may be placed in the environment by the
diff --git a/share/man/man7/ports.7 b/share/man/man7/ports.7
index eb65d117bded..3a9fe60aa018 100644
--- a/share/man/man7/ports.7
+++ b/share/man/man7/ports.7
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 17, 2020
+.Dd August 3, 2020
.Dt PORTS 7
.Os
.Sh NAME
@@ -70,9 +70,7 @@ branch contains all the latest changes, while the
branches only provide critical fixes.
The
.Em head
-branch can be installed or updated using either
-.Xr portsnap 8 ,
-or from Subversion repository at:
+branch can be installed or updated from the Subversion repository located at:
.Pp
.Lk https://svn.FreeBSD.org/ports/head
.Pp
@@ -626,8 +624,7 @@ is going to be built with Python 3.7 support.)
.Xr make 1 ,
.Xr make.conf 5 ,
.Xr development 7 ,
-.Xr pkg 7 ,
-.Xr portsnap 8
+.Xr pkg 7
.Pp
Additional developer documentation:
.Bl -dash -width "" -offset indent
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index ee065b020999..33e162d5fae0 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1378,7 +1378,6 @@ MLINKS+=make_dev.9 destroy_dev.9 \
make_dev.9 make_dev_s.9
MLINKS+=malloc.9 free.9 \
malloc.9 malloc_domainset.9 \
- malloc.9 free_domain.9 \
malloc.9 mallocarray.9 \
malloc.9 MALLOC_DECLARE.9 \
malloc.9 MALLOC_DEFINE.9 \
@@ -2309,7 +2308,8 @@ MLINKS+=vm_page_insert.9 vm_page_remove.9
MLINKS+=vm_page_wire.9 vm_page_unwire.9
MLINKS+=VOP_ACCESS.9 VOP_ACCESSX.9
MLINKS+=VOP_ATTRIB.9 VOP_GETATTR.9 \
- VOP_ATTRIB.9 VOP_SETATTR.9
+ VOP_ATTRIB.9 VOP_SETATTR.9 \
+ VOP_ATTRIB.9 VOP_STAT.9
MLINKS+=VOP_CREATE.9 VOP_MKDIR.9 \
VOP_CREATE.9 VOP_MKNOD.9 \
VOP_CREATE.9 VOP_SYMLINK.9
@@ -2343,7 +2343,6 @@ MLINKS+=zone.9 uma.9 \
zone.9 uma_zdestroy.9 \
zone.9 uma_zfree.9 \
zone.9 uma_zfree_arg.9 \
- zone.9 uma_zfree_domain.9 \
zone.9 uma_zfree_pcpu.9 \
zone.9 uma_zfree_pcpu_arg.9 \
zone.9 uma_zone_get_cur.9 \
diff --git a/share/man/man9/VOP_ATTRIB.9 b/share/man/man9/VOP_ATTRIB.9
index e48e4eb9a254..45f1e2f1652a 100644
--- a/share/man/man9/VOP_ATTRIB.9
+++ b/share/man/man9/VOP_ATTRIB.9
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 29, 2008
+.Dd August 8, 2020
.Dt VOP_ATTRIB 9
.Os
.Sh NAME
@@ -42,19 +42,49 @@
.Fn VOP_GETATTR "struct vnode *vp" "struct vattr *vap" "struct ucred *cred"
.Ft int
.Fn VOP_SETATTR "struct vnode *vp" "struct vattr *vap" "struct ucred *cred"
+.Ft int
+.Fn VOP_STAT "struct vnode *vp" "struct stat *sb" "struct ucred *active_cred" \
+"struct ucred *file_cred" "struct thread *td"
.Sh DESCRIPTION
These entry points manipulate various attributes of a file or directory,
including file permissions, owner, group, size,
access time and modification time.
.Pp
-The arguments are:
+.Fn VOP_STAT
+returns data in a format suitable for the
+.Xr stat 2
+system call and by default is implemented as a wrapper around
+.Fn VOP_GETATTR .
+Filesystems may want to implement their own variant for performance reasons.
+.Pp
+For
+.Fn VOP_GETATTR
+and
+.Fn VOP_SETATTR
+the arguments are:
.Bl -tag -width cred
.It Fa vp
The vnode of the file.
.It Fa vap
The attributes of the file.
.It Fa cred
-The user credentials of the calling process.
+The user credentials of the calling thread.
+.El
+.Pp
+For
+.Fn VOP_STAT
+the arguments are:
+.Bl -tag -width active_cred
+.It Fa vp
+The vnode of the file.
+.It Fa sb
+The attributes of the file.
+.It Fa active_cred
+The user credentials of the calling thread.
+.It Fa file_cred
+The credentials installed on the file description pointing to the vnode or NOCRED.