Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Dec 2017 12:51:26 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r327341 - in projects/clang600-import: . bin/pax bin/sh bin/sh/tests/builtins contrib/elftoolchain/readelf etc etc/devd etc/mail lib/libc/include lib/libc/locale lib/libc/mips lib/libc/...
Message-ID:  <201712291251.vBTCpQsa011082@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Fri Dec 29 12:51:26 2017
New Revision: 327341
URL: https://svnweb.freebsd.org/changeset/base/327341

Log:
  Merge ^/head r327169 through r327340.

Added:
  projects/clang600-import/.gitattributes
     - copied unchanged from r327340, head/.gitattributes
  projects/clang600-import/.gitignore
     - copied unchanged from r327340, head/.gitignore
  projects/clang600-import/share/man/man4/aw_gpio.4
     - copied unchanged from r327340, head/share/man/man4/aw_gpio.4
  projects/clang600-import/share/man/man4/aw_mmc.4
     - copied unchanged from r327340, head/share/man/man4/aw_mmc.4
  projects/clang600-import/share/man/man4/aw_rtc.4
     - copied unchanged from r327340, head/share/man/man4/aw_rtc.4
  projects/clang600-import/sys/arm/allwinner/aw_gpio.c
     - copied unchanged from r327340, head/sys/arm/allwinner/aw_gpio.c
  projects/clang600-import/sys/arm/allwinner/aw_mmc.c
     - copied unchanged from r327340, head/sys/arm/allwinner/aw_mmc.c
  projects/clang600-import/sys/arm/allwinner/aw_mmc.h
     - copied unchanged from r327340, head/sys/arm/allwinner/aw_mmc.h
  projects/clang600-import/sys/sys/_stdarg.h
     - copied unchanged from r327340, head/sys/sys/_stdarg.h
  projects/clang600-import/usr.sbin/devmatch/
     - copied from r327340, head/usr.sbin/devmatch/
Deleted:
  projects/clang600-import/sys/arm/allwinner/a10_gpio.c
  projects/clang600-import/sys/arm/allwinner/a10_mmc.c
  projects/clang600-import/sys/arm/allwinner/a10_mmc.h
  projects/clang600-import/sys/arm/allwinner/aw_console.c
  projects/clang600-import/sys/powerpc/ofw/ofwmagic.S
Modified:
  projects/clang600-import/UPDATING
  projects/clang600-import/bin/pax/buf_subs.c
  projects/clang600-import/bin/sh/eval.c
  projects/clang600-import/bin/sh/jobs.c
  projects/clang600-import/bin/sh/tests/builtins/var-assign.0
  projects/clang600-import/contrib/elftoolchain/readelf/readelf.c
  projects/clang600-import/etc/devd/hyperv.conf
  projects/clang600-import/etc/mail/mailer.conf
  projects/clang600-import/etc/portsnap.conf
  projects/clang600-import/etc/rc.initdiskless
  projects/clang600-import/etc/rc.subr
  projects/clang600-import/lib/libc/include/reentrant.h
  projects/clang600-import/lib/libc/locale/euc.c
  projects/clang600-import/lib/libc/mips/SYS.h
  projects/clang600-import/lib/libc/sparc64/fpu/fpu_reg.h
  projects/clang600-import/lib/libc/stdio/fflush.3
  projects/clang600-import/lib/libc/sys/kqueue.2
  projects/clang600-import/lib/libc/sys/sendfile.2
  projects/clang600-import/lib/libcam/camlib.h
  projects/clang600-import/lib/libedit/map.c
  projects/clang600-import/lib/libedit/refresh.c
  projects/clang600-import/lib/libefivar/uefi-dputil.c
  projects/clang600-import/lib/libopenbsd/imsg_init.3
  projects/clang600-import/lib/libufs/type.c
  projects/clang600-import/lib/libutil/humanize_number.3
  projects/clang600-import/lib/libutil/humanize_number.c
  projects/clang600-import/lib/libutil/pty.c
  projects/clang600-import/lib/libutil/tests/humanize_number_test.c
  projects/clang600-import/lib/msun/src/catrig.c
  projects/clang600-import/libexec/dma/dmagent/mailer.conf
  projects/clang600-import/libexec/rpc.sprayd/rpc.sprayd.8
  projects/clang600-import/libexec/rpc.sprayd/sprayd.c
  projects/clang600-import/sbin/ccdconfig/ccdconfig.8
  projects/clang600-import/sbin/ccdconfig/ccdconfig.c
  projects/clang600-import/sbin/ccdconfig/pathnames.h
  projects/clang600-import/sbin/devfs/rule.c
  projects/clang600-import/sbin/dump/dump.h
  projects/clang600-import/sbin/dump/main.c
  projects/clang600-import/sbin/dump/tape.c
  projects/clang600-import/sbin/dump/traverse.c
  projects/clang600-import/sbin/fsdb/fsdb.c
  projects/clang600-import/sbin/ipfw/ipfw.8
  projects/clang600-import/sbin/newfs_msdos/mkfs_msdos.c
  projects/clang600-import/sbin/pfctl/pfctl.c
  projects/clang600-import/sbin/routed/main.c
  projects/clang600-import/share/man/man4/Makefile
  projects/clang600-import/share/man/man4/ip.4
  projects/clang600-import/share/man/man4/lm75.4
  projects/clang600-import/share/man/man4/md.4
  projects/clang600-import/share/man/man4/nand.4
  projects/clang600-import/share/man/man5/mailer.conf.5
  projects/clang600-import/share/man/man5/rc.conf.5
  projects/clang600-import/share/man/man9/iflibdd.9
  projects/clang600-import/share/man/man9/iflibtxrx.9
  projects/clang600-import/share/man/man9/uio.9
  projects/clang600-import/share/misc/bsd-family-tree
  projects/clang600-import/share/misc/pci_vendors
  projects/clang600-import/stand/fdt/fdt_loader_cmd.c
  projects/clang600-import/stand/fdt/fdt_overlay.c
  projects/clang600-import/sys/amd64/amd64/support.S
  projects/clang600-import/sys/arm/allwinner/a10/a10_intc.c
  projects/clang600-import/sys/arm/allwinner/allwinner_pinctrl.h
  projects/clang600-import/sys/arm/allwinner/aw_mp.c
  projects/clang600-import/sys/arm/allwinner/aw_mp.h
  projects/clang600-import/sys/arm/allwinner/aw_wdog.c
  projects/clang600-import/sys/arm/allwinner/axp81x.c
  projects/clang600-import/sys/arm/allwinner/clk/aw_pll.c
  projects/clang600-import/sys/arm/allwinner/files.allwinner
  projects/clang600-import/sys/arm/allwinner/if_awg.c
  projects/clang600-import/sys/arm/arm/genassym.c
  projects/clang600-import/sys/arm/arm/gic.c
  projects/clang600-import/sys/arm/arm/locore-v6.S
  projects/clang600-import/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c
  projects/clang600-import/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
  projects/clang600-import/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
  projects/clang600-import/sys/arm/freescale/imx/files.imx6
  projects/clang600-import/sys/arm/include/stdarg.h
  projects/clang600-import/sys/arm/xscale/ixp425/ixdp425_pci.c
  projects/clang600-import/sys/arm/xscale/ixp425/ixdp425reg.h
  projects/clang600-import/sys/arm/xscale/ixp425/ixp425.c
  projects/clang600-import/sys/arm/xscale/ixp425/ixp425_npe.c
  projects/clang600-import/sys/arm/xscale/ixp425/ixp425_npereg.h
  projects/clang600-import/sys/arm/xscale/ixp425/ixp425_pci.c
  projects/clang600-import/sys/arm/xscale/ixp425/ixp425_pci_space.c
  projects/clang600-import/sys/arm/xscale/ixp425/ixp425_space.c
  projects/clang600-import/sys/arm/xscale/ixp425/ixp425_timer.c
  projects/clang600-import/sys/arm/xscale/ixp425/ixp425reg.h
  projects/clang600-import/sys/arm/xscale/ixp425/ixp425var.h
  projects/clang600-import/sys/arm64/arm64/gic_v3.c
  projects/clang600-import/sys/arm64/arm64/gicv3_its.c
  projects/clang600-import/sys/arm64/arm64/machdep.c
  projects/clang600-import/sys/arm64/arm64/pmap.c
  projects/clang600-import/sys/arm64/include/stdarg.h
  projects/clang600-import/sys/cam/ata/ata_da.c
  projects/clang600-import/sys/cam/ctl/ctl.c
  projects/clang600-import/sys/cam/scsi/scsi_da.c
  projects/clang600-import/sys/cam/scsi/scsi_pass.c
  projects/clang600-import/sys/conf/files
  projects/clang600-import/sys/conf/files.arm64
  projects/clang600-import/sys/conf/files.i386
  projects/clang600-import/sys/conf/files.powerpc
  projects/clang600-import/sys/conf/options.arm
  projects/clang600-import/sys/dev/al_eth/al_eth.c
  projects/clang600-import/sys/dev/ath/if_ath.c
  projects/clang600-import/sys/dev/axgbe/xgbe-drv.c
  projects/clang600-import/sys/dev/axgbe/xgbe-mdio.c
  projects/clang600-import/sys/dev/bhnd/nvram/bhnd_nvram_store_subr.c
  projects/clang600-import/sys/dev/cadence/if_cgem.c
  projects/clang600-import/sys/dev/cesa/cesa.h
  projects/clang600-import/sys/dev/cxgbe/iw_cxgbe/cm.c
  projects/clang600-import/sys/dev/cxgbe/t4_sge.c
  projects/clang600-import/sys/dev/de/if_de.c
  projects/clang600-import/sys/dev/drm/mga_state.c
  projects/clang600-import/sys/dev/e1000/e1000_82543.c
  projects/clang600-import/sys/dev/e1000/e1000_api.c
  projects/clang600-import/sys/dev/e1000/e1000_hw.h
  projects/clang600-import/sys/dev/e1000/e1000_ich8lan.c
  projects/clang600-import/sys/dev/e1000/e1000_ich8lan.h
  projects/clang600-import/sys/dev/e1000/if_em.c
  projects/clang600-import/sys/dev/e1000/igb_txrx.c
  projects/clang600-import/sys/dev/extres/clk/clk_bus.c
  projects/clang600-import/sys/dev/extres/regulator/regulator_bus.c
  projects/clang600-import/sys/dev/extres/syscon/syscon.c
  projects/clang600-import/sys/dev/fdt/fdt_common.c
  projects/clang600-import/sys/dev/iicbus/twsi/a10_twsi.c
  projects/clang600-import/sys/dev/isci/scil/scic_sds_remote_node_context.c
  projects/clang600-import/sys/dev/isci/scil/scif_sas_controller.c
  projects/clang600-import/sys/dev/iwm/if_iwmreg.h
  projects/clang600-import/sys/dev/mii/rdcphy.c
  projects/clang600-import/sys/dev/mmc/host/dwmmc.c
  projects/clang600-import/sys/dev/mmc/mmc.c
  projects/clang600-import/sys/dev/mmc/mmcsd.c
  projects/clang600-import/sys/dev/mvs/mvs_pci.c
  projects/clang600-import/sys/dev/mwl/if_mwl.c
  projects/clang600-import/sys/dev/ofw/ofw_bus_subr.c
  projects/clang600-import/sys/dev/ofw/ofwpci.c
  projects/clang600-import/sys/dev/pccard/pccardvar.h
  projects/clang600-import/sys/dev/pci/pci.c
  projects/clang600-import/sys/dev/pci/pci_pci.c
  projects/clang600-import/sys/dev/sdhci/sdhci.c
  projects/clang600-import/sys/dev/sdhci/sdhci_pci.c
  projects/clang600-import/sys/dev/sfxge/common/siena_nvram.c
  projects/clang600-import/sys/dev/sio/sio.c
  projects/clang600-import/sys/dev/smc/if_smc_fdt.c
  projects/clang600-import/sys/dev/sound/isa/mss.h
  projects/clang600-import/sys/dev/spibus/ofw_spibus.c
  projects/clang600-import/sys/dev/syscons/scvgarndr.c
  projects/clang600-import/sys/dev/txp/if_txp.c
  projects/clang600-import/sys/dev/txp/if_txpreg.h
  projects/clang600-import/sys/dev/uart/uart_bus_acpi.c
  projects/clang600-import/sys/dev/uart/uart_dev_pl011.c
  projects/clang600-import/sys/dev/uart/uart_dev_snps.c
  projects/clang600-import/sys/dev/usb/controller/dwc_otg_fdt.c
  projects/clang600-import/sys/dev/usb/controller/ehci.c
  projects/clang600-import/sys/dev/usb/controller/ohci.c
  projects/clang600-import/sys/dev/usb/controller/xhci.c
  projects/clang600-import/sys/dev/usb/storage/umass.c
  projects/clang600-import/sys/dev/usb/usb_dev.c
  projects/clang600-import/sys/dev/vnic/nic_main.c
  projects/clang600-import/sys/dev/vnic/nicvf_main.c
  projects/clang600-import/sys/dev/vnic/nicvf_queues.c
  projects/clang600-import/sys/fs/cd9660/cd9660_vfsops.c
  projects/clang600-import/sys/fs/nfs/nfs_commonkrpc.c
  projects/clang600-import/sys/fs/nfs/nfs_commonsubs.c
  projects/clang600-import/sys/fs/nfsclient/nfs_clrpcops.c
  projects/clang600-import/sys/fs/nfsclient/nfs_clstate.c
  projects/clang600-import/sys/fs/nfsserver/nfs_nfsdport.c
  projects/clang600-import/sys/fs/nfsserver/nfs_nfsdstate.c
  projects/clang600-import/sys/fs/procfs/procfs_map.c
  projects/clang600-import/sys/geom/geom_subr.c
  projects/clang600-import/sys/geom/raid/g_raid.c
  projects/clang600-import/sys/geom/raid/md_ddf.c
  projects/clang600-import/sys/geom/raid/md_promise.c
  projects/clang600-import/sys/geom/raid/tr_raid5.c
  projects/clang600-import/sys/i386/conf/GENERIC
  projects/clang600-import/sys/i386/conf/NOTES
  projects/clang600-import/sys/i386/i386/support.s
  projects/clang600-import/sys/i386/isa/elink.c
  projects/clang600-import/sys/i386/isa/elink.h
  projects/clang600-import/sys/kern/kern_proc.c
  projects/clang600-import/sys/kern/kern_synch.c
  projects/clang600-import/sys/kern/link_elf.c
  projects/clang600-import/sys/kern/subr_msgbuf.c
  projects/clang600-import/sys/kern/subr_sleepqueue.c
  projects/clang600-import/sys/kern/subr_witness.c
  projects/clang600-import/sys/kern/vfs_aio.c
  projects/clang600-import/sys/kern/vfs_subr.c
  projects/clang600-import/sys/libkern/strstr.c
  projects/clang600-import/sys/mips/conf/BERI_SOCKIT
  projects/clang600-import/sys/mips/conf/TP-WN1043ND
  projects/clang600-import/sys/net/altq/altq_hfsc.h
  projects/clang600-import/sys/net/bpf.c
  projects/clang600-import/sys/net/if_ethersubr.c
  projects/clang600-import/sys/net/if_gif.c
  projects/clang600-import/sys/net/iflib.c
  projects/clang600-import/sys/net80211/ieee80211_ht.c
  projects/clang600-import/sys/net80211/ieee80211_scan_sta.c
  projects/clang600-import/sys/netinet/icmp6.h
  projects/clang600-import/sys/netinet/libalias/alias_sctp.c
  projects/clang600-import/sys/netinet/sctp_crc32.c
  projects/clang600-import/sys/netinet/sctp_crc32.h
  projects/clang600-import/sys/netinet/tcp_output.c
  projects/clang600-import/sys/netinet6/in6_mcast.c
  projects/clang600-import/sys/netinet6/in6_src.c
  projects/clang600-import/sys/netinet6/ip6_id.c
  projects/clang600-import/sys/netinet6/mld6.c
  projects/clang600-import/sys/netinet6/nd6.c
  projects/clang600-import/sys/netinet6/nd6.h
  projects/clang600-import/sys/netinet6/nd6_nbr.c
  projects/clang600-import/sys/netinet6/raw_ip6.c
  projects/clang600-import/sys/netinet6/udp6_usrreq.c
  projects/clang600-import/sys/netipsec/key.c
  projects/clang600-import/sys/netipsec/xform_ah.c
  projects/clang600-import/sys/netipsec/xform_esp.c
  projects/clang600-import/sys/netipsec/xform_ipcomp.c
  projects/clang600-import/sys/nfs/nfs_fha.c
  projects/clang600-import/sys/nlm/nlm_prot_impl.c
  projects/clang600-import/sys/opencrypto/crypto.c
  projects/clang600-import/sys/opencrypto/cryptosoft.c
  projects/clang600-import/sys/powerpc/booke/locore.S
  projects/clang600-import/sys/rpc/clnt_dg.c
  projects/clang600-import/sys/security/mac/mac_syscalls.c
  projects/clang600-import/sys/sparc64/include/idprom.h
  projects/clang600-import/sys/sparc64/pci/sbbc.c
  projects/clang600-import/sys/sys/chio.h
  projects/clang600-import/sys/sys/proc.h
  projects/clang600-import/sys/ufs/ffs/ffs_alloc.c
  projects/clang600-import/sys/ufs/ffs/ffs_balloc.c
  projects/clang600-import/sys/ufs/ffs/ffs_softdep.c
  projects/clang600-import/sys/ufs/ffs/ffs_vnops.c
  projects/clang600-import/sys/ufs/ufs/dinode.h
  projects/clang600-import/sys/vm/vm_map.c
  projects/clang600-import/sys/vm/vm_object.c
  projects/clang600-import/sys/vm/vm_pageout.c
  projects/clang600-import/sys/vm/vm_swapout.c
  projects/clang600-import/sys/x86/include/stdarg.h
  projects/clang600-import/sys/x86/x86/io_apic.c
  projects/clang600-import/tests/sys/fifo/fifo_io.c
  projects/clang600-import/tests/sys/kern/ptrace_test.c
  projects/clang600-import/tools/regression/bpf/bpf_filter/bpf_test.c
  projects/clang600-import/usr.bin/column/column.c
  projects/clang600-import/usr.bin/localedef/ctype.c
  projects/clang600-import/usr.bin/mail/cmd3.c
  projects/clang600-import/usr.bin/mail/collect.c
  projects/clang600-import/usr.bin/mail/names.c
  projects/clang600-import/usr.bin/msgs/msgs.c
  projects/clang600-import/usr.bin/rpcgen/rpc_main.c
  projects/clang600-import/usr.bin/rpcgen/rpc_parse.c
  projects/clang600-import/usr.bin/rpcgen/rpc_scan.c
  projects/clang600-import/usr.bin/showmount/showmount.c
  projects/clang600-import/usr.bin/tcopy/tcopy.c
  projects/clang600-import/usr.bin/wall/wall.c
  projects/clang600-import/usr.bin/xargs/strnsubst.c
  projects/clang600-import/usr.sbin/Makefile
  projects/clang600-import/usr.sbin/binmiscctl/binmiscctl.c
  projects/clang600-import/usr.sbin/bsdinstall/partedit/gpart_ops.c
  projects/clang600-import/usr.sbin/btxld/btxld.c
  projects/clang600-import/usr.sbin/cpucontrol/intel.c
  projects/clang600-import/usr.sbin/cpucontrol/via.c
  projects/clang600-import/usr.sbin/ctld/login.c
  projects/clang600-import/usr.sbin/fwcontrol/fwdv.c
  projects/clang600-import/usr.sbin/kgmon/kgmon.c
  projects/clang600-import/usr.sbin/makefs/cd9660.c
  projects/clang600-import/usr.sbin/nandtool/nand_read.c
  projects/clang600-import/usr.sbin/nandtool/nand_readoob.c
  projects/clang600-import/usr.sbin/ndiscvt/ndiscvt.c
  projects/clang600-import/usr.sbin/nfsd/nfsd.c
  projects/clang600-import/usr.sbin/ntp/doc/ntp.conf.5
  projects/clang600-import/usr.sbin/rpc.lockd/lockd_lock.c
Directory Properties:
  projects/clang600-import/   (props changed)
  projects/clang600-import/contrib/elftoolchain/   (props changed)
  projects/clang600-import/lib/libedit/   (props changed)

Copied: projects/clang600-import/.gitattributes (from r327340, head/.gitattributes)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang600-import/.gitattributes	Fri Dec 29 12:51:26 2017	(r327341, copy of r327340, head/.gitattributes)
@@ -0,0 +1,5 @@
+*.c    diff=cpp
+*.h    diff=cpp
+*.cpp  diff=cpp
+*.hpp  diff=cpp
+*.py   diff=python

Copied: projects/clang600-import/.gitignore (from r327340, head/.gitignore)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang600-import/.gitignore	Fri Dec 29 12:51:26 2017	(r327341, copy of r327340, head/.gitignore)
@@ -0,0 +1,18 @@
+_.tinderbox.*
+_.amd64.*
+_.arm.*
+_.arm64.*
+_.i386.*
+_.ia64.*
+_.mips.*
+_.pc98.*
+_.powerpc.*
+_.riscv.*
+_.sparc64.*
+_.sun4v.*
+GPATH
+GRTAGS
+GTAGS
+ID
+cscope.out
+?cscope.out

Modified: projects/clang600-import/UPDATING
==============================================================================
--- projects/clang600-import/UPDATING	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/UPDATING	Fri Dec 29 12:51:26 2017	(r327341)
@@ -821,7 +821,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 
 20150623:
 	An additional fix for the issue described in the 20150614 sendmail
-	entry below has been been committed in revision 284717.
+	entry below has been committed in revision 284717.
 
 20150616:
 	FreeBSD's old make (fmake) has been removed from the system. It is
@@ -829,7 +829,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 
 20150615:
 	The fix for the issue described in the 20150614 sendmail entry
-	below has been been committed in revision 284436.  The work
+	below has been committed in revision 284436.  The work
 	around described in that entry is no longer needed unless the
 	default setting is overridden by a confDH_PARAMETERS configuration
 	setting of '5' or pointing to a 512 bit DH parameter file.

Modified: projects/clang600-import/bin/pax/buf_subs.c
==============================================================================
--- projects/clang600-import/bin/pax/buf_subs.c	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/bin/pax/buf_subs.c	Fri Dec 29 12:51:26 2017	(r327341)
@@ -485,7 +485,7 @@ wr_rdbuf(char *out, int outcnt)
 	int cnt;
 
 	/*
-	 * while there is data to copy copy into the write buffer. when the
+	 * while there is data to copy into the write buffer. when the
 	 * write buffer fills, flush it to the archive and continue
 	 */
 	while (outcnt > 0) {

Modified: projects/clang600-import/bin/sh/eval.c
==============================================================================
--- projects/clang600-import/bin/sh/eval.c	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/bin/sh/eval.c	Fri Dec 29 12:51:26 2017	(r327341)
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/resource.h>
-#include <sys/wait.h> /* For WIFSIGNALED(status) */
 #include <errno.h>
 
 /*
@@ -840,7 +839,7 @@ evalcommand(union node *cmd, int flags, struct backcmd
 	struct parsefile *savetopfile;
 	volatile int e;
 	char *lastarg;
-	int realstatus;
+	int signaled;
 	int do_clearcmdentry;
 	const char *path = pathval();
 	int i;
@@ -1163,9 +1162,9 @@ cmddone:
 parent:	/* parent process gets here (if we forked) */
 	if (mode == FORK_FG) {	/* argument to fork */
 		INTOFF;
-		exitstatus = waitforjob(jp, &realstatus);
+		exitstatus = waitforjob(jp, &signaled);
 		INTON;
-		if (iflag && loopnest > 0 && WIFSIGNALED(realstatus)) {
+		if (iflag && loopnest > 0 && signaled) {
 			evalskip = SKIPBREAK;
 			skipcount = loopnest;
 		}

Modified: projects/clang600-import/bin/sh/jobs.c
==============================================================================
--- projects/clang600-import/bin/sh/jobs.c	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/bin/sh/jobs.c	Fri Dec 29 12:51:26 2017	(r327341)
@@ -1016,7 +1016,7 @@ vforkexecshell(struct job *jp, char **argv, char **env
  */
 
 int
-waitforjob(struct job *jp, int *origstatus)
+waitforjob(struct job *jp, int *signaled)
 {
 #if JOBS
 	int propagate_int = jp->jobctl && jp->foreground;
@@ -1039,8 +1039,8 @@ waitforjob(struct job *jp, int *origstatus)
 		setcurjob(jp);
 #endif
 	status = jp->ps[jp->nprocs - 1].status;
-	if (origstatus != NULL)
-		*origstatus = status;
+	if (signaled != NULL)
+		*signaled = WIFSIGNALED(status);
 	/* convert to 8 bits */
 	if (WIFEXITED(status))
 		st = WEXITSTATUS(status);

Modified: projects/clang600-import/bin/sh/tests/builtins/var-assign.0
==============================================================================
--- projects/clang600-import/bin/sh/tests/builtins/var-assign.0	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/bin/sh/tests/builtins/var-assign.0	Fri Dec 29 12:51:26 2017	(r327341)
@@ -47,7 +47,7 @@ do
 	${SH} -c "VAR=1; VAR=0 ${cmd}; exit \${VAR}" >/dev/null 2>&1
 done
 
-# For other built-ins and utilites they do not.
+# For other built-ins and utilities they do not.
 set -- ${UTILS}
 for cmd in "$@"
 do

Modified: projects/clang600-import/contrib/elftoolchain/readelf/readelf.c
==============================================================================
--- projects/clang600-import/contrib/elftoolchain/readelf/readelf.c	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/contrib/elftoolchain/readelf/readelf.c	Fri Dec 29 12:51:26 2017	(r327341)
@@ -2753,6 +2753,7 @@ dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32
 	case DT_SYMENT:
 	case DT_RELSZ:
 	case DT_RELENT:
+	case DT_PREINIT_ARRAYSZ:
 	case DT_INIT_ARRAYSZ:
 	case DT_FINI_ARRAYSZ:
 	case DT_GNU_CONFLICTSZ:

Modified: projects/clang600-import/etc/devd/hyperv.conf
==============================================================================
--- projects/clang600-import/etc/devd/hyperv.conf	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/etc/devd/hyperv.conf	Fri Dec 29 12:51:26 2017	(r327341)
@@ -39,39 +39,39 @@ notify 11 {
 #
 # How network VF works with hn(4) on Hyper-V in non-transparent mode:
 #
-# - Each network VF has a cooresponding hn(4).
-# - The network VF and the it's cooresponding hn(4) have the same hardware
+# - Each network VF has a corresponding hn(4).
+# - The network VF and the it's corresponding hn(4) have the same hardware
 #   address.
 # - Once the network VF is up, e.g. ifconfig VF up:
 #   o  All of the transmission should go through the network VF.
 #   o  Most of the reception goes through the network VF.
-#   o  Small amount of reception may go through the cooresponding hn(4).
-#      This reception will happen, even if the the cooresponding hn(4) is
-#      down.  The cooresponding hn(4) will change the reception interface
+#   o  Small amount of reception may go through the corresponding hn(4).
+#      This reception will happen, even if the corresponding hn(4) is
+#      down.  The corresponding hn(4) will change the reception interface
 #      to the network VF, so that network layer and application layer will
 #      be tricked into thinking that these packets were received by the
 #      network VF.
-#   o  The cooresponding hn(4) pretends the physical link is down.
+#   o  The corresponding hn(4) pretends the physical link is down.
 # - Once the network VF is down or detached:
-#   o  All of the transmission should go through the cooresponding hn(4).
-#   o  All of the reception goes through the cooresponding hn(4).
-#   o  The cooresponding hn(4) fallbacks to the original physical link
+#   o  All of the transmission should go through the corresponding hn(4).
+#   o  All of the reception goes through the corresponding hn(4).
+#   o  The corresponding hn(4) fallbacks to the original physical link
 #      detection logic.
 #
 # All these features are mainly used to help live migration, during which
 # the network VF will be detached, while the network communication to the
 # VM must not be cut off.  In order to reach this level of live migration
 # transparency, we use failover mode lagg(4) with the network VF and the
-# cooresponding hn(4) attached to it.
+# corresponding hn(4) attached to it.
 #
 # To ease user configuration for both network VF and non-network VF, the
 # lagg(4) will be created by the following rules, and the configuration
-# of the cooresponding hn(4) will be applied to the lagg(4) automatically.
+# of the corresponding hn(4) will be applied to the lagg(4) automatically.
 #
 # NOTE:
 # If live migration is not needed at all, the following rules could be
 # commented out, and the network VF interface could be used exclusively.
-# Most often the cooresponding hn(4) could be completely ignored.
+# Most often the corresponding hn(4) could be completely ignored.
 #
 #
 # Default workflow for the network VF bringup:

Modified: projects/clang600-import/etc/mail/mailer.conf
==============================================================================
--- projects/clang600-import/etc/mail/mailer.conf	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/etc/mail/mailer.conf	Fri Dec 29 12:51:26 2017	(r327341)
@@ -3,7 +3,6 @@
 # Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail
 #
 sendmail	/usr/libexec/sendmail/sendmail
-send-mail	/usr/libexec/sendmail/sendmail
 mailq		/usr/libexec/sendmail/sendmail
 newaliases	/usr/libexec/sendmail/sendmail
 hoststat	/usr/libexec/sendmail/sendmail

Modified: projects/clang600-import/etc/portsnap.conf
==============================================================================
--- projects/clang600-import/etc/portsnap.conf	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/etc/portsnap.conf	Fri Dec 29 12:51:26 2017	(r327341)
@@ -30,7 +30,6 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddbd64f13f978f2f3
 # REFUSE korean polish portuguese russian ukrainian vietnamese
 
 # List of INDEX files to build and the DESCRIBE file to use for each
-#INDEX INDEX-9 DESCRIBE.9
 #INDEX INDEX-10 DESCRIBE.10
 #INDEX INDEX-11 DESCRIBE.11
 INDEX INDEX-12 DESCRIBE.12

Modified: projects/clang600-import/etc/rc.initdiskless
==============================================================================
--- projects/clang600-import/etc/rc.initdiskless	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/etc/rc.initdiskless	Fri Dec 29 12:51:26 2017	(r327341)
@@ -67,7 +67,7 @@
 # /conf/T/M/remount
 #		The contents of the file is a mount command. E.g. if
 # 		/conf/1.2.3.4/foo/remount contains "mount -o ro /dev/ad0s3",
-#		then /dev/ad0s3 will be be mounted on /conf/1.2.3.4/foo/
+#		then /dev/ad0s3 will be mounted on /conf/1.2.3.4/foo/
 #
 # /conf/T/M/remount_optional
 #		If this file exists, then failure to execute the mount

Modified: projects/clang600-import/etc/rc.subr
==============================================================================
--- projects/clang600-import/etc/rc.subr	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/etc/rc.subr	Fri Dec 29 12:51:26 2017	(r327341)
@@ -1542,7 +1542,7 @@ debug()
 #			is created.
 #
 #	update		`file' has changed and needs to be backed up.
-#			If `cur' exists, it is copied to to `back'
+#			If `cur' exists, it is copied to `back'
 #			and then `file' is copied to `cur'.
 #
 #	remove		`file' is no longer being tracked by the backups

Modified: projects/clang600-import/lib/libc/include/reentrant.h
==============================================================================
--- projects/clang600-import/lib/libc/include/reentrant.h	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libc/include/reentrant.h	Fri Dec 29 12:51:26 2017	(r327341)
@@ -67,7 +67,7 @@
  * Implementation Details:
  * 
  * The mutex primitives used by the library (mutex_t, mutex_lock, etc.)
- * are macros which expand to the cooresponding primitives provided by
+ * are macros which expand to the corresponding primitives provided by
  * the thread engine or to nothing.  The latter is used so that code is
  * not unreasonably cluttered with #ifdefs when all thread safe support
  * is removed.

Modified: projects/clang600-import/lib/libc/locale/euc.c
==============================================================================
--- projects/clang600-import/lib/libc/locale/euc.c	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libc/locale/euc.c	Fri Dec 29 12:51:26 2017	(r327341)
@@ -1,5 +1,5 @@
 /*-
- * SPDX-License-Identifier: BSD-4-Clause
+ * SPDX-License-Identifier: BSD-3-Clause
  *
  * Copyright 2013 Garrett D'Amore <garrett@damore.org>
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.

Modified: projects/clang600-import/lib/libc/mips/SYS.h
==============================================================================
--- projects/clang600-import/lib/libc/mips/SYS.h	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libc/mips/SYS.h	Fri Dec 29 12:51:26 2017	(r327341)
@@ -2,7 +2,7 @@
 /* $FreeBSD$ */
 
 /*-
- * SPDX-License-Identifier: BSD-4-Clause
+ * SPDX-License-Identifier: (BSD-4-Clause AND BSD-3-Clause)
  *
  * Copyright (c) 1996 Jonathan Stone
  * All rights reserved.

Modified: projects/clang600-import/lib/libc/sparc64/fpu/fpu_reg.h
==============================================================================
--- projects/clang600-import/lib/libc/sparc64/fpu/fpu_reg.h	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libc/sparc64/fpu/fpu_reg.h	Fri Dec 29 12:51:26 2017	(r327341)
@@ -31,7 +31,7 @@
 #define _LIBC_SPARC64_FPU_FPU_REG_H_
 
 /*
- * These are not really of type char[]. They are are arrays of functions defined
+ * These are not really of type char[]. They are arrays of functions defined
  * in fpu_reg.S; each array member loads/stores a certain fpu register of the
  * given size.
  */

Modified: projects/clang600-import/lib/libc/stdio/fflush.3
==============================================================================
--- projects/clang600-import/lib/libc/stdio/fflush.3	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libc/stdio/fflush.3	Fri Dec 29 12:51:26 2017	(r327341)
@@ -32,7 +32,7 @@
 .\"     @(#)fflush.3	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd June 4, 1993
+.Dd December 25, 2017
 .Dt FFLUSH 3
 .Os
 .Sh NAME
@@ -87,9 +87,7 @@ is set to indicate the error.
 The
 .Fa stream
 argument
-is not an open stream, or, in the case of
-.Fn fflush ,
-not a stream open for writing.
+is not an open stream.
 .El
 .Pp
 The function
@@ -97,7 +95,12 @@ The function
 may also fail and set
 .Va errno
 for any of the errors specified for the routine
-.Xr write 2 .
+.Xr write 2 ,
+except that in case of
+.Fa stream
+being a read-only descriptor,
+.Fn fflush
+returns 0.
 .Sh SEE ALSO
 .Xr write 2 ,
 .Xr fclose 3 ,

Modified: projects/clang600-import/lib/libc/sys/kqueue.2
==============================================================================
--- projects/clang600-import/lib/libc/sys/kqueue.2	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libc/sys/kqueue.2	Fri Dec 29 12:51:26 2017	(r327341)
@@ -190,7 +190,7 @@ The
 .Fa ext[2]
 and
 .Fa ext[3]
-members are always passed throught the kernel as-is,
+members are always passed through the kernel as-is,
 making additional context available to application.
 .El
 .Pp

Modified: projects/clang600-import/lib/libc/sys/sendfile.2
==============================================================================
--- projects/clang600-import/lib/libc/sys/sendfile.2	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libc/sys/sendfile.2	Fri Dec 29 12:51:26 2017	(r327341)
@@ -190,7 +190,7 @@ may read ahead when reading the file.
 A macro
 .Fn SF_FLAGS
 is provided to combine readahead amount and flags.
-Example shows specifing readahead of 16 pages and
+An example showing specifying readahead of 16 pages and
 .Dv SF_NOCACHE
 flag:
 .Pp

Modified: projects/clang600-import/lib/libcam/camlib.h
==============================================================================
--- projects/clang600-import/lib/libcam/camlib.h	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libcam/camlib.h	Fri Dec 29 12:51:26 2017	(r327341)
@@ -1,5 +1,5 @@
 /*-
- * SPDX-License-Identifier: BSD-4-Clause AND BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: (BSD-2-Clause-FreeBSD AND BSD-4-Clause) 
  *
  * Copyright (c) 1997, 1998 Kenneth D. Merry.
  * All rights reserved.

Modified: projects/clang600-import/lib/libedit/map.c
==============================================================================
--- projects/clang600-import/lib/libedit/map.c	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libedit/map.c	Fri Dec 29 12:51:26 2017	(r327341)
@@ -370,7 +370,7 @@ private const el_action_t  el_map_vi_insert[] = {
 				 * NOTE: These mappings do NOT Correspond well
 				 * to the KSH VI editing assignments.
 				 * On the other and they are convenient and
-				 * many people have have gotten used to them.
+				 * many people have gotten used to them.
 				 */
 	/*   0 */	ED_UNASSIGNED,		/* ^@ */
 	/*   1 */	ED_MOVE_TO_BEG,		/* ^A */

Modified: projects/clang600-import/lib/libedit/refresh.c
==============================================================================
--- projects/clang600-import/lib/libedit/refresh.c	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libedit/refresh.c	Fri Dec 29 12:51:26 2017	(r327341)
@@ -1148,7 +1148,7 @@ re_fastaddc(EditLine *el)
 
 
 /* re_clear_display():
- *	clear the screen buffers so that new new prompt starts fresh.
+ *	clear the screen buffers so that new prompt starts fresh.
  */
 protected void
 re_clear_display(EditLine *el)

Modified: projects/clang600-import/lib/libefivar/uefi-dputil.c
==============================================================================
--- projects/clang600-import/lib/libefivar/uefi-dputil.c	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libefivar/uefi-dputil.c	Fri Dec 29 12:51:26 2017	(r327341)
@@ -134,7 +134,7 @@ GetDevicePathSize (
   @param  MaxSize     The maximum size of the device path data structure.
 
   @retval TRUE        DevicePath is valid.
-  @retval FALSE       The length of any node node in the DevicePath is less
+  @retval FALSE       The length of any node in the DevicePath is less
                       than sizeof (EFI_DEVICE_PATH_PROTOCOL).
   @retval FALSE       If MaxSize is not zero, the size of the DevicePath
                       exceeds MaxSize.

Modified: projects/clang600-import/lib/libopenbsd/imsg_init.3
==============================================================================
--- projects/clang600-import/lib/libopenbsd/imsg_init.3	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libopenbsd/imsg_init.3	Fri Dec 29 12:51:26 2017	(r327341)
@@ -347,7 +347,7 @@ On success
 returns a pointer to the buffer; on failure it returns NULL.
 .Pp
 .Fn ibuf_dynamic
-allocates a resizeable buffer of initial length
+allocates a resizable buffer of initial length
 .Fa len
 and maximum size
 .Fa max .

Modified: projects/clang600-import/lib/libufs/type.c
==============================================================================
--- projects/clang600-import/lib/libufs/type.c	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libufs/type.c	Fri Dec 29 12:51:26 2017	(r327341)
@@ -83,6 +83,7 @@ ufs_disk_fillout(struct uufsd *disk, const char *name)
 	}
 	if (sbread(disk) == -1) {
 		ERROR(disk, "could not read superblock to fill out disk");
+		ufs_disk_close(disk);
 		return (-1);
 	}
 	return (0);

Modified: projects/clang600-import/lib/libutil/humanize_number.3
==============================================================================
--- projects/clang600-import/lib/libutil/humanize_number.3	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libutil/humanize_number.3	Fri Dec 29 12:51:26 2017	(r327341)
@@ -200,3 +200,9 @@ The
 .Dv HN_IEC_PREFIXES
 flag was introduced in
 .Fx 9.0 .
+.Sh CAVEATS
+For numbers greater than 999 using buffer length of 4 and less can cause
+rounding errors.
+When using
+.Dv HN_IEC_PREFIXES
+the same error occurs for buffer length of 5 or less.

Modified: projects/clang600-import/lib/libutil/humanize_number.c
==============================================================================
--- projects/clang600-import/lib/libutil/humanize_number.c	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libutil/humanize_number.c	Fri Dec 29 12:51:26 2017	(r327341)
@@ -145,7 +145,8 @@ humanize_number(char *buf, size_t len, int64_t quotien
 		 */
 		for (i = 0;
 		    (quotient >= max || (quotient == max - 1 &&
-		    remainder >= divisordeccut)) && i < maxscale; i++) {
+		    (remainder >= divisordeccut || remainder >=
+		    divisor / 2))) && i < maxscale; i++) {
 			remainder = quotient % divisor;
 			quotient /= divisor;
 		}

Modified: projects/clang600-import/lib/libutil/pty.c
==============================================================================
--- projects/clang600-import/lib/libutil/pty.c	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libutil/pty.c	Fri Dec 29 12:51:26 2017	(r327341)
@@ -101,12 +101,13 @@ forkpty(int *amaster, char *name, struct termios *term
 		return (-1);
 	switch (pid = fork()) {
 	case -1:
+		(void)close(slave);
 		return (-1);
 	case 0:
 		/*
 		 * child
 		 */
-		(void) close(master);
+		(void)close(master);
 		login_tty(slave);
 		return (0);
 	}

Modified: projects/clang600-import/lib/libutil/tests/humanize_number_test.c
==============================================================================
--- projects/clang600-import/lib/libutil/tests/humanize_number_test.c	Fri Dec 29 12:49:24 2017	(r327340)
+++ projects/clang600-import/lib/libutil/tests/humanize_number_test.c	Fri Dec 29 12:51:26 2017	(r327341)
@@ -49,333 +49,337 @@ static struct {
 	int64_t num;
 	int flags;
 	int scale;
+	size_t buflen;
 } test_args[] = {
 	/* tests 0-13 test 1000 suffixes */
-	{ 2, "0 ", (int64_t)0L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "1 k", (int64_t)500L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "1 G", (int64_t)500*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "1 T", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "1 P", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "1 E", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 2, "1 ", (int64_t)1L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "2 k", (int64_t)1500L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "2 M", (int64_t)1500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "2 G", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "2 T", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "2 P", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "2 E", (int64_t)1500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
+	{ 2, "0 ", (int64_t)0L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "1 k", (int64_t)500L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "1 G", (int64_t)500*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "1 T", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "1 P", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "1 E", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 2, "1 ", (int64_t)1L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "2 k", (int64_t)1500L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "2 M", (int64_t)1500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "2 G", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "2 T", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "2 P", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "2 E", (int64_t)1500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
 
 	/* tests 14-27 test 1024 suffixes */
-	{ 2, "0 ", (int64_t)0L, 0, HN_AUTOSCALE },
-	{ 3, "1 K", (int64_t)512L, 0, HN_AUTOSCALE },
-	{ 3, "1 M", (int64_t)512*1024L, 0, HN_AUTOSCALE },
-	{ 3, "1 G", (int64_t)512*1024*1024L, 0, HN_AUTOSCALE },
-	{ 3, "1 T", (int64_t)512*1024*1024*1024L, 0, HN_AUTOSCALE },
-	{ 3, "1 P", (int64_t)512*1024*1024*1024*1024L, 0, HN_AUTOSCALE },
-	{ 3, "1 E", (int64_t)512*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE },
-	{ 2, "1 ", (int64_t)1L, 0, HN_AUTOSCALE },
-	{ 3, "2 K", (int64_t)1536L, 0, HN_AUTOSCALE },
-	{ 3, "2 M", (int64_t)1536*1024L, 0, HN_AUTOSCALE },
-	{ 3, "2 G", (int64_t)1536*1024*1024L, 0, HN_AUTOSCALE },
-	{ 3, "2 T", (int64_t)1536*1024*1024*1024L, 0, HN_AUTOSCALE },
-	{ 3, "2 P", (int64_t)1536*1024*1024*1024*1024L, 0, HN_AUTOSCALE },
-	{ 3, "2 E", (int64_t)1536*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE },
+	{ 2, "0 ", (int64_t)0L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "1 K", (int64_t)512L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "1 M", (int64_t)512*1024L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "1 G", (int64_t)512*1024*1024L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "1 T", (int64_t)512*1024*1024*1024L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "1 P", (int64_t)512*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "1 E", (int64_t)512*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 4 },
+	{ 2, "1 ", (int64_t)1L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "2 K", (int64_t)1536L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "2 M", (int64_t)1536*1024L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "2 G", (int64_t)1536*1024*1024L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "2 T", (int64_t)1536*1024*1024*1024L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "2 P", (int64_t)1536*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "2 E", (int64_t)1536*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 4 },
 
 	/* tests 28-37 test rounding */
-	{ 3, "0 M", (int64_t)500*1000L-1, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "1 M", (int64_t)1000*1000L + 500*1000L-1, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "2 M", (int64_t)1000*1000L + 500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 3, "0 K", (int64_t)512L-1, 0, HN_AUTOSCALE },
-	{ 3, "1 K", (int64_t)512L, 0, HN_AUTOSCALE },
-	{ 3, "0 M", (int64_t)512*1024L-1, 0, HN_AUTOSCALE },
-	{ 3, "1 M", (int64_t)512*1024L, 0, HN_AUTOSCALE },
-	{ 3, "1 M", (int64_t)1024*1024L + 512*1024L-1, 0, HN_AUTOSCALE },
-	{ 3, "2 M", (int64_t)1024*1024L + 512*1024L, 0, HN_AUTOSCALE },
+	{ 3, "0 M", (int64_t)500*1000L-1, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "1 M", (int64_t)1000*1000L + 500*1000L-1, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "2 M", (int64_t)1000*1000L + 500*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 4 },
+	{ 3, "0 K", (int64_t)512L-1, 0, HN_AUTOSCALE, 4 },
+	{ 3, "1 K", (int64_t)512L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "0 M", (int64_t)512*1024L-1, 0, HN_AUTOSCALE, 4 },
+	{ 3, "1 M", (int64_t)512*1024L, 0, HN_AUTOSCALE, 4 },
+	{ 3, "1 M", (int64_t)1024*1024L + 512*1024L-1, 0, HN_AUTOSCALE, 4 },
+	{ 3, "2 M", (int64_t)1024*1024L + 512*1024L, 0, HN_AUTOSCALE, 4 },
 
 	/* tests 38-61 test specific scale factors with 1000 divisor */
-	{ 3, "0 k", (int64_t)0L, HN_DIVISOR_1000, 1 },
-	{ 3, "1 k", (int64_t)500L, HN_DIVISOR_1000, 1 },
-	{ 3, "0 M", (int64_t)500L, HN_DIVISOR_1000, 2 },
-	{ 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, 2 },
-	{ 3, "0 G", (int64_t)500*1000L, HN_DIVISOR_1000, 3 },
-	{ 3, "1 G", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 3 },
-	{ 3, "0 T", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 4 },
-	{ 3, "1 T", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, 4 },
-	{ 3, "0 P", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, 5 },
-	{ 3, "1 P", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, 5 },
-	{ 3, "0 E", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 },
-	{ 3, "1 E", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 },
-	{ 3, "0 k", (int64_t)1L, HN_DIVISOR_1000, 1 },
-	{ 3, "2 k", (int64_t)1500L, HN_DIVISOR_1000, 1 },
-	{ 3, "0 M", (int64_t)1500L, HN_DIVISOR_1000, 2 },
-	{ 3, "2 M", (int64_t)1500*1000L, HN_DIVISOR_1000, 2 },
-	{ 3, "0 G", (int64_t)1500*1000L, HN_DIVISOR_1000, 3 },
-	{ 3, "2 G", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 3 },
-	{ 3, "0 T", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 4 },
-	{ 3, "2 T", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, 4 },
-	{ 3, "0 P", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, 5 },
-	{ 3, "2 P", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, 5 },
-	{ 3, "0 E", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 },
-	{ 3, "2 E", (int64_t)1500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6 },
+	{ 3, "0 k", (int64_t)0L, HN_DIVISOR_1000, 1, 4 },
+	{ 3, "1 k", (int64_t)500L, HN_DIVISOR_1000, 1, 4 },
+	{ 3, "0 M", (int64_t)500L, HN_DIVISOR_1000, 2, 4 },
+	{ 3, "1 M", (int64_t)500*1000L, HN_DIVISOR_1000, 2, 4 },
+	{ 3, "0 G", (int64_t)500*1000L, HN_DIVISOR_1000, 3, 4 },
+	{ 3, "1 G", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 3, 4 },
+	{ 3, "0 T", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 4, 4 },
+	{ 3, "1 T", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, 4, 4 },
+	{ 3, "0 P", (int64_t)500*1000*1000*1000L, HN_DIVISOR_1000, 5, 4 },
+	{ 3, "1 P", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, 5, 4 },
+	{ 3, "0 E", (int64_t)500*1000*1000*1000*1000L, HN_DIVISOR_1000, 6, 4 },
+	{ 3, "1 E", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6, 4 },
+	{ 3, "0 k", (int64_t)1L, HN_DIVISOR_1000, 1, 4 },
+	{ 3, "2 k", (int64_t)1500L, HN_DIVISOR_1000, 1, 4 },
+	{ 3, "0 M", (int64_t)1500L, HN_DIVISOR_1000, 2, 4 },
+	{ 3, "2 M", (int64_t)1500*1000L, HN_DIVISOR_1000, 2, 4 },
+	{ 3, "0 G", (int64_t)1500*1000L, HN_DIVISOR_1000, 3, 4 },
+	{ 3, "2 G", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 3, 4 },
+	{ 3, "0 T", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 4, 4 },
+	{ 3, "2 T", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, 4, 4 },
+	{ 3, "0 P", (int64_t)1500*1000*1000*1000L, HN_DIVISOR_1000, 5, 4 },
+	{ 3, "2 P", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, 5, 4 },
+	{ 3, "0 E", (int64_t)1500*1000*1000*1000*1000L, HN_DIVISOR_1000, 6, 4 },
+	{ 3, "2 E", (int64_t)1500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, 6, 4 },
 
 	/* tests 62-85 test specific scale factors with 1024 divisor */
-	{ 3, "0 K", (int64_t)0L, 0, 1 },
-	{ 3, "1 K", (int64_t)512L, 0, 1 },
-	{ 3, "0 M", (int64_t)512L, 0, 2 },
-	{ 3, "1 M", (int64_t)512*1024L, 0, 2 },
-	{ 3, "0 G", (int64_t)512*1024L, 0, 3 },
-	{ 3, "1 G", (int64_t)512*1024*1024L, 0, 3 },
-	{ 3, "0 T", (int64_t)512*1024*1024L, 0, 4 },
-	{ 3, "1 T", (int64_t)512*1024*1024*1024L, 0, 4 },
-	{ 3, "0 P", (int64_t)512*1024*1024*1024L, 0, 5 },
-	{ 3, "1 P", (int64_t)512*1024*1024*1024*1024L, 0, 5 },
-	{ 3, "0 E", (int64_t)512*1024*1024*1024*1024L, 0, 6 },
-	{ 3, "1 E", (int64_t)512*1024*1024*1024*1024*1024L, 0, 6 },
-	{ 3, "0 K", (int64_t)1L, 0, 1 },
-	{ 3, "2 K", (int64_t)1536L, 0, 1 },
-	{ 3, "0 M", (int64_t)1536L, 0, 2 },
-	{ 3, "2 M", (int64_t)1536*1024L, 0, 2 },
-	{ 3, "0 G", (int64_t)1536*1024L, 0, 3 },
-	{ 3, "2 G", (int64_t)1536*1024*1024L, 0, 3 },
-	{ 3, "0 T", (int64_t)1536*1024*1024L, 0, 4 },
-	{ 3, "2 T", (int64_t)1536*1024*1024*1024L, 0, 4 },
-	{ 3, "0 P", (int64_t)1536*1024*1024*1024L, 0, 5 },
-	{ 3, "2 P", (int64_t)1536*1024*1024*1024*1024L, 0, 5 },
-	{ 3, "0 E", (int64_t)1536*1024*1024*1024*1024L, 0, 6 },
-	{ 3, "2 E", (int64_t)1536*1024*1024*1024*1024*1024L, 0, 6 },
+	{ 3, "0 K", (int64_t)0L, 0, 1, 4 },
+	{ 3, "1 K", (int64_t)512L, 0, 1, 4 },
+	{ 3, "0 M", (int64_t)512L, 0, 2, 4 },
+	{ 3, "1 M", (int64_t)512*1024L, 0, 2, 4 },
+	{ 3, "0 G", (int64_t)512*1024L, 0, 3, 4 },
+	{ 3, "1 G", (int64_t)512*1024*1024L, 0, 3, 4 },
+	{ 3, "0 T", (int64_t)512*1024*1024L, 0, 4, 4 },
+	{ 3, "1 T", (int64_t)512*1024*1024*1024L, 0, 4, 4 },
+	{ 3, "0 P", (int64_t)512*1024*1024*1024L, 0, 5, 4 },
+	{ 3, "1 P", (int64_t)512*1024*1024*1024*1024L, 0, 5, 4 },
+	{ 3, "0 E", (int64_t)512*1024*1024*1024*1024L, 0, 6, 4 },
+	{ 3, "1 E", (int64_t)512*1024*1024*1024*1024*1024L, 0, 6, 4 },
+	{ 3, "0 K", (int64_t)1L, 0, 1, 4 },
+	{ 3, "2 K", (int64_t)1536L, 0, 1, 4 },
+	{ 3, "0 M", (int64_t)1536L, 0, 2, 4 },
+	{ 3, "2 M", (int64_t)1536*1024L, 0, 2, 4 },
+	{ 3, "0 G", (int64_t)1536*1024L, 0, 3, 4 },
+	{ 3, "2 G", (int64_t)1536*1024*1024L, 0, 3, 4 },
+	{ 3, "0 T", (int64_t)1536*1024*1024L, 0, 4, 4 },
+	{ 3, "2 T", (int64_t)1536*1024*1024*1024L, 0, 4, 4 },
+	{ 3, "0 P", (int64_t)1536*1024*1024*1024L, 0, 5, 4 },
+	{ 3, "2 P", (int64_t)1536*1024*1024*1024*1024L, 0, 5, 4 },
+	{ 3, "0 E", (int64_t)1536*1024*1024*1024*1024L, 0, 6, 4 },
+	{ 3, "2 E", (int64_t)1536*1024*1024*1024*1024*1024L, 0, 6, 4 },
 
 	/* tests 86-99 test invalid specific scale values of < 0 or >= 7 with
 	and without HN_DIVISOR_1000 set */
 	/*  all should return errors with new code; with old, the latter 3
 	are instead processed as if having AUTOSCALE and/or GETSCALE set */
-	{ -1, "", (int64_t)1L, 0, 7 },
-	{ -1, "", (int64_t)1L, HN_DIVISOR_1000, 7 },
-	{ -1, "", (int64_t)1L, 0, 1000 },
-	{ -1, "", (int64_t)1L, HN_DIVISOR_1000, 1000 },
-	{ -1, "", (int64_t)0L, 0, 1000*1000 },
-	{ -1, "", (int64_t)0L, HN_DIVISOR_1000, 1000*1000 },
-	{ -1, "", (int64_t)0L, 0, INT_MAX },
-	{ -1, "", (int64_t)0L, HN_DIVISOR_1000, INT_MAX },
+	{ -1, "", (int64_t)1L, 0, 7, 4 },
+	{ -1, "", (int64_t)1L, HN_DIVISOR_1000, 7, 4 },
+	{ -1, "", (int64_t)1L, 0, 1000, 4 },
+	{ -1, "", (int64_t)1L, HN_DIVISOR_1000, 1000, 4 },
+	{ -1, "", (int64_t)0L, 0, 1000*1000, 4 },
+	{ -1, "", (int64_t)0L, HN_DIVISOR_1000, 1000*1000, 4 },
+	{ -1, "", (int64_t)0L, 0, INT_MAX, 4 },
+	{ -1, "", (int64_t)0L, HN_DIVISOR_1000, INT_MAX, 4 },
 
 	/* Negative scale values are not handled well
 	 by the existing library routine - should report as error */
 	/*  all should return errors with new code, fail assertion with old */
 
-	{ -1, "", (int64_t)1L, 0, -1 },
-	{ -1, "", (int64_t)1L, HN_DIVISOR_1000, -1 },
-	{ -1, "", (int64_t)1L, 0, -1000 },
-	{ -1, "", (int64_t)1L, HN_DIVISOR_1000, -1000 },
+	{ -1, "", (int64_t)1L, 0, -1, 4 },
+	{ -1, "", (int64_t)1L, HN_DIVISOR_1000, -1, 4 },
+	{ -1, "", (int64_t)1L, 0, -1000, 4 },
+	{ -1, "", (int64_t)1L, HN_DIVISOR_1000, -1000, 4 },
 
 	/* __INT_MIN doesn't print properly, skipped. */
 
-	{ -1, "", (int64_t)1L, 0, -__INT_MAX },
-	{ -1, "", (int64_t)1L, HN_DIVISOR_1000, -__INT_MAX },
+	{ -1, "", (int64_t)1L, 0, -__INT_MAX, 4 },
+	{ -1, "", (int64_t)1L, HN_DIVISOR_1000, -__INT_MAX, 4 },
 
 
 	/* tests for scale == 0, without autoscale */
 	/* tests 100-114 test scale 0 with 1000 divisor - print first N digits */
-	{ 2, "0 ", (int64_t)0L, HN_DIVISOR_1000, 0 },
-	{ 2, "1 ", (int64_t)1L, HN_DIVISOR_1000, 0 },
-	{ 3, "10 ", (int64_t)10L, HN_DIVISOR_1000, 0 },
-	{ 3, "0 M", (int64_t)150L, HN_DIVISOR_1000, HN_NOSPACE },
-	{ 3, "0 M", (int64_t)500L, HN_DIVISOR_1000, HN_NOSPACE },
-	{ 3, "0 M", (int64_t)999L, HN_DIVISOR_1000, HN_NOSPACE },
-	{ 4, "150", (int64_t)150L, HN_DIVISOR_1000, 0 },
-	{ 4, "500", (int64_t)500L, HN_DIVISOR_1000, 0 },
-	{ 4, "999", (int64_t)999L, HN_DIVISOR_1000, 0 },
-	{ 5, "100", (int64_t)1000L, HN_DIVISOR_1000, 0 },
-	{ 5, "150", (int64_t)1500L, HN_DIVISOR_1000, 0 },
-	{ 7, "500", (int64_t)500*1000L, HN_DIVISOR_1000, 0 },
-	{ 8, "150", (int64_t)1500*1000L, HN_DIVISOR_1000, 0 },
-	{ 10, "500", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 0 },
-	{ 11, "150", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 0 },
+	{ 2, "0 ", (int64_t)0L, HN_DIVISOR_1000, 0, 4 },
+	{ 2, "1 ", (int64_t)1L, HN_DIVISOR_1000, 0, 4 },
+	{ 3, "10 ", (int64_t)10L, HN_DIVISOR_1000, 0, 4 },
+	{ 3, "0 M", (int64_t)150L, HN_DIVISOR_1000, HN_NOSPACE, 4 },
+	{ 3, "0 M", (int64_t)500L, HN_DIVISOR_1000, HN_NOSPACE, 4 },
+	{ 3, "0 M", (int64_t)999L, HN_DIVISOR_1000, HN_NOSPACE, 4 },
+	{ 4, "150", (int64_t)150L, HN_DIVISOR_1000, 0, 4 },
+	{ 4, "500", (int64_t)500L, HN_DIVISOR_1000, 0, 4 },
+	{ 4, "999", (int64_t)999L, HN_DIVISOR_1000, 0, 4 },
+	{ 5, "100", (int64_t)1000L, HN_DIVISOR_1000, 0, 4 },
+	{ 5, "150", (int64_t)1500L, HN_DIVISOR_1000, 0, 4 },
+	{ 7, "500", (int64_t)500*1000L, HN_DIVISOR_1000, 0, 4 },
+	{ 8, "150", (int64_t)1500*1000L, HN_DIVISOR_1000, 0, 4 },
+	{ 10, "500", (int64_t)500*1000*1000L, HN_DIVISOR_1000, 0, 4 },
+	{ 11, "150", (int64_t)1500*1000*1000L, HN_DIVISOR_1000, 0, 4 },
 
 	/* tests 115-126 test scale 0 with 1024 divisor - print first N digits */
-	{ 2, "0 ", (int64_t)0L, 0, 0 },
-	{ 2, "1 ", (int64_t)1L, 0, 0 },
-	{ 3, "10 ", (int64_t)10L, 0, 0 },
-	{ 4, "150", (int64_t)150L, 0, 0 },
-	{ 4, "500", (int64_t)500L, 0, 0 },
-	{ 4, "999", (int64_t)999L, 0, 0 },
-	{ 5, "100", (int64_t)1000L, 0, 0 },
-	{ 5, "150", (int64_t)1500L, 0, 0 },
-	{ 7, "500", (int64_t)500*1000L, 0, 0 },
-	{ 8, "150", (int64_t)1500*1000L, 0, 0 },
-	{ 10, "500", (int64_t)500*1000*1000L, 0, 0 },
-	{ 11, "150", (int64_t)1500*1000*1000L, 0, 0 },
+	{ 2, "0 ", (int64_t)0L, 0, 0, 4 },
+	{ 2, "1 ", (int64_t)1L, 0, 0, 4 },
+	{ 3, "10 ", (int64_t)10L, 0, 0, 4 },
+	{ 4, "150", (int64_t)150L, 0, 0, 4 },
+	{ 4, "500", (int64_t)500L, 0, 0, 4 },
+	{ 4, "999", (int64_t)999L, 0, 0, 4 },
+	{ 5, "100", (int64_t)1000L, 0, 0, 4 },
+	{ 5, "150", (int64_t)1500L, 0, 0, 4 },
+	{ 7, "500", (int64_t)500*1000L, 0, 0, 4 },
+	{ 8, "150", (int64_t)1500*1000L, 0, 0, 4 },
+	{ 10, "500", (int64_t)500*1000*1000L, 0, 0, 4 },
+	{ 11, "150", (int64_t)1500*1000*1000L, 0, 0, 4 },
 
+	/* Test case for rounding of edge numbers around 999.5+, see PR224498.
+	 * Require buflen >= 5 */
+	{ 4, "1.0M", (int64_t)1023500, HN_DECIMAL|HN_B|HN_NOSPACE, HN_AUTOSCALE, 5 },
+
 	/* Test boundary cases for very large positive/negative number formatting */
 	/* Explicit scale, divisor 1024 */
 
-	/* XXX = requires length 5 (buflen 6) for some cases*/
-	/* KLUDGE - test loop below will bump length 5 up to 5 */
-	{ 3, "8 E",   INT64_MAX, 0, 6 },
-	{ 4, "-8 E", -INT64_MAX, 0, 6 },
-	{ 3, "0 E", (int64_t)92*1024*1024*1024*1024*1024L, 0, 6 },
-	{ 3, "0 E", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 6 },
-	{ 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, 0, 6 },
-	{ 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 6 },
-	{ 3, "0 E", (int64_t)81*1024*1024*1024*1024*1024L, 0, 6 },
-	{ 3, "0 E", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 6 },
-	{ 4, "92 P", (int64_t)92*1024*1024*1024*1024*1024L, 0, 5 },
-	{ 5, "-92 P", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 5 },
-	{ 4, "82 P", (int64_t)82*1024*1024*1024*1024*1024L, 0, 5 },
-	{ 5, "-82 P", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 5 },
-	{ 4, "81 P", (int64_t)81*1024*1024*1024*1024*1024L, 0, 5 },
-	{ 5, "-81 P", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 5 },
+	/* Requires buflen >= 6 */
+	{ 3, "8 E",   INT64_MAX, 0, 6, 6 },
+	{ 4, "-8 E", -INT64_MAX, 0, 6, 6 },
+	{ 3, "0 E", (int64_t)92*1024*1024*1024*1024*1024L, 0, 6, 6 },
+	{ 3, "0 E", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 6, 6 },
+	{ 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, 0, 6, 6 },
+	{ 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 6, 6 },
+	{ 3, "0 E", (int64_t)81*1024*1024*1024*1024*1024L, 0, 6, 6 },
+	{ 3, "0 E", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 6, 6 },
+	{ 4, "92 P", (int64_t)92*1024*1024*1024*1024*1024L, 0, 5, 6 },
+	{ 5, "-92 P", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 5, 6 },
+	{ 4, "82 P", (int64_t)82*1024*1024*1024*1024*1024L, 0, 5, 6 },
+	{ 5, "-82 P", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 5, 6 },
+	{ 4, "81 P", (int64_t)81*1024*1024*1024*1024*1024L, 0, 5, 6 },
+	{ 5, "-81 P", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 5, 6 },
 
 	/* Explicit scale, divisor 1000 */
-	{ 3, "9 E",   INT64_MAX, HN_DIVISOR_1000, 6 },
-	{ 4, "-9 E", -INT64_MAX, HN_DIVISOR_1000,  6 },
-	{ 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  6 },
-	{ 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  6 },
-	{ 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  6 },
-	{ 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  6 },
-	{ 4, "92 P", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  5 },
-	{ 5, "-92 P", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  5 },
-	{ 4, "91 P", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  5 },
-	{ 5, "-91 P", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  5 },
+	{ 3, "9 E",   INT64_MAX, HN_DIVISOR_1000, 6, 6 },
+	{ 4, "-9 E", -INT64_MAX, HN_DIVISOR_1000,  6, 6 },
+	{ 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  6, 6 },
+	{ 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  6, 6 },
+	{ 3, "0 E", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  6, 6 },
+	{ 3, "0 E", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  6, 6 },
+	{ 4, "92 P", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  5, 6 },
+	{ 5, "-92 P", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  5, 6 },
+	{ 4, "91 P", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  5, 6 },
+	{ 5, "-91 P", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  5, 6 },
 
 	/* Autoscale, divisor 1024 */
-	{ 3, "8 E",   INT64_MAX, 0, HN_AUTOSCALE },
-	{ 4, "-8 E", -INT64_MAX, 0, HN_AUTOSCALE },
-	{ 4, "92 P", (int64_t)92*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE },
-	{ 5, "-92 P", -(int64_t)92*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE },
-	{ 4, "82 P", (int64_t)82*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE },
-	{ 5, "-82 P", -(int64_t)82*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE },
-	{ 4, "81 P", (int64_t)81*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE },
-	{ 5, "-81 P", -(int64_t)81*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE },
+	{ 3, "8 E",   INT64_MAX, 0, HN_AUTOSCALE, 6 },
+	{ 4, "-8 E", -INT64_MAX, 0, HN_AUTOSCALE, 6 },
+	{ 4, "92 P", (int64_t)92*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 6 },
+	{ 5, "-92 P", -(int64_t)92*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 6 },
+	{ 4, "82 P", (int64_t)82*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 6 },
+	{ 5, "-82 P", -(int64_t)82*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 6 },
+	{ 4, "81 P", (int64_t)81*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 6 },
+	{ 5, "-81 P", -(int64_t)81*1024*1024*1024*1024*1024L, 0, HN_AUTOSCALE, 6 },
 	/* Autoscale, divisor 1000 */
-	{ 3, "9 E",   INT64_MAX, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 4, "-9 E", -INT64_MAX, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 4, "92 P", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "-92 P", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 4, "91 P", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "-91 P", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE },
+	{ 3, "9 E",   INT64_MAX, HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 4, "-9 E", -INT64_MAX, HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 4, "92 P", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "-92 P", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 4, "91 P", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "-91 P", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
 
 	/* 0 scale, divisor 1024 */
-	{ 12, "skdj",  INT64_MAX, 0, 0 },
-	{ 21, "-9223", -INT64_MAX, 0, 0 },
-	{ 19, "10358", (int64_t)92*1024*1024*1024*1024*1024L, 0, 0 },
-	{ 20, "-1035", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 0 },
-	{ 18, "92323", (int64_t)82*1024*1024*1024*1024*1024L, 0, 0 },
-	{ 19, "-9232", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 0 },
-	{ 18, "91197", (int64_t)81*1024*1024*1024*1024*1024L, 0, 0 },
-	{ 19, "-9119", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 0 },
+	{ 12, "skdj",  INT64_MAX, 0, 0, 6 },
+	{ 21, "-9223", -INT64_MAX, 0, 0, 6 },
+	{ 19, "10358", (int64_t)92*1024*1024*1024*1024*1024L, 0, 0, 6 },
+	{ 20, "-1035", -(int64_t)92*1024*1024*1024*1024*1024L, 0, 0, 6 },
+	{ 18, "92323", (int64_t)82*1024*1024*1024*1024*1024L, 0, 0, 6 },
+	{ 19, "-9232", -(int64_t)82*1024*1024*1024*1024*1024L, 0, 0, 6 },
+	{ 18, "91197", (int64_t)81*1024*1024*1024*1024*1024L, 0, 0, 6 },
+	{ 19, "-9119", -(int64_t)81*1024*1024*1024*1024*1024L, 0, 0, 6 },
 
 	/* 0 scale, divisor 1000 */
 	/* XXX - why does this fail? */
-	{ -1, "", INT64_MAX, HN_DIVISOR_1000, 0 },
-	{ 21, "-9223", -INT64_MAX, HN_DIVISOR_1000,  0 },
-	{ 19, "10358", (int64_t)92*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  0 },
-	{ 20, "-1035", -(int64_t)92*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  0 },
-	{ 18, "92323", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  0 },
-	{ 19, "-9232", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  0 },
+	{ -1, "", INT64_MAX, HN_DIVISOR_1000, 0, 6 },
+	{ 21, "-9223", -INT64_MAX, HN_DIVISOR_1000,  0, 6 },
+	{ 19, "10358", (int64_t)92*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  0, 6 },
+	{ 20, "-1035", -(int64_t)92*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  0, 6 },
+	{ 18, "92323", (int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  0, 6 },
+	{ 19, "-9232", -(int64_t)82*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  0, 6 },
 	/* Expected to pass */
-	{ 18, "91197", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  0 },
-	{ 19, "-9119", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  0 },
+	{ 18, "91197", (int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  0, 6 },
+	{ 19, "-9119", -(int64_t)81*1024*1024*1024*1024*1024L, HN_DIVISOR_1000,  0, 6 },
 
 
 
 	/* Need to implement tests for GETSCALE */
-/*	{ ?, "", (int64_t)0L, HN_DIVISOR_1000, HN_GETSCALE },
+/*	{ ?, "", (int64_t)0L, HN_DIVISOR_1000, HN_GETSCALE, 6 },
 	...
 */
         /* Tests for HN_DECIMAL */
         /* Positive, Autoscale */
-	{ 5, "500 k", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "994 k", (int64_t)994*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "995 k", (int64_t)995*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "999 k", (int64_t)999*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "1.0 M", (int64_t)1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "1.5 M", (int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "1.9 M", (int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "2.0 M", (int64_t)1950*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "9.9 M", (int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 4, "10 M", (int64_t)9950*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "500 M", (int64_t)500*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "994 M", (int64_t)994*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "995 M", (int64_t)995*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "999 M", (int64_t)999*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
+	{ 5, "500 k", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "994 k", (int64_t)994*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "995 k", (int64_t)995*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "999 k", (int64_t)999*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "1.0 M", (int64_t)1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "1.5 M", (int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "1.9 M", (int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "2.0 M", (int64_t)1950*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "9.9 M", (int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 4, "10 M", (int64_t)9950*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "500 M", (int64_t)500*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "994 M", (int64_t)994*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "995 M", (int64_t)995*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "999 M", (int64_t)999*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
 
-	{ 5, "500 K", (int64_t)500*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "994 K", (int64_t)994*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "995 K", (int64_t)995*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "999 K", (int64_t)999*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "1.0 M", (int64_t)1000*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "1.0 M", (int64_t)1018*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "1.0 M", (int64_t)1019*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "1.5 M", (int64_t)1536*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "1.9 M", (int64_t)1996*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "2.0 M", (int64_t)1997*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "2.0 M", (int64_t)2047*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "2.0 M", (int64_t)2048*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "2.0 M", (int64_t)2099*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "2.1 M", (int64_t)2100*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "9.9 M", (int64_t)10188*1024L, HN_DECIMAL, HN_AUTOSCALE },
+	{ 5, "500 K", (int64_t)500*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "994 K", (int64_t)994*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "995 K", (int64_t)995*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "999 K", (int64_t)999*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "1.0 M", (int64_t)1000*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "1.0 M", (int64_t)1018*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "1.0 M", (int64_t)1019*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "1.5 M", (int64_t)1536*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "1.9 M", (int64_t)1996*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "2.0 M", (int64_t)1997*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "2.0 M", (int64_t)2047*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "2.0 M", (int64_t)2048*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "2.0 M", (int64_t)2099*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "2.1 M", (int64_t)2100*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "9.9 M", (int64_t)10188*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
 	/* XXX - shouldn't the following two be "10. M"? */
-	{ 4, "10 M", (int64_t)10189*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 4, "10 M", (int64_t)10240*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "500 M", (int64_t)500*1024*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "994 M", (int64_t)994*1024*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "995 M", (int64_t)995*1024*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "999 M", (int64_t)999*1024*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "1.0 G", (int64_t)1000*1024*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "1.0 G", (int64_t)1023*1024*1024L, HN_DECIMAL, HN_AUTOSCALE },
+	{ 4, "10 M", (int64_t)10189*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 4, "10 M", (int64_t)10240*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "500 M", (int64_t)500*1024*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "994 M", (int64_t)994*1024*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "995 M", (int64_t)995*1024*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "999 M", (int64_t)999*1024*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "1.0 G", (int64_t)1000*1024*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "1.0 G", (int64_t)1023*1024*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
 
         /* Negative, Autoscale - should pass */
-	{ 6, "-1.5 ", -(int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 6, "-1.9 ", -(int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 6, "-9.9 ", -(int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
+	{ 6, "-1.5 ", -(int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 6, "-1.9 ", -(int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 6, "-9.9 ", -(int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
 
-	{ 6, "-1.5 ", -(int64_t)1536*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 6, "-1.9 ", -(int64_t)1949*1024L, HN_DECIMAL, HN_AUTOSCALE },
-	{ 6, "-9.7 ", -(int64_t)9949*1024L, HN_DECIMAL, HN_AUTOSCALE },
+	{ 6, "-1.5 ", -(int64_t)1536*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 6, "-1.9 ", -(int64_t)1949*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 6, "-9.7 ", -(int64_t)9949*1024L, HN_DECIMAL, HN_AUTOSCALE, 6 },
 
 	/* Positive/negative, at maximum scale */
-	{ 5, "500 P", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "1.9 E", (int64_t)1949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "8.9 E", (int64_t)8949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 5, "9.2 E", INT64_MAX, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
+	{ 5, "500 P", (int64_t)500*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "1.9 E", (int64_t)1949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "8.9 E", (int64_t)8949*1000*1000*1000*1000*1000L, HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 5, "9.2 E", INT64_MAX, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
         /* Negatives work with latest rev only: */
-	{ 6, "-9.2 ", -INT64_MAX, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
-	{ 6, "-8.9 ", -(int64_t)8949*1000*1000*1000*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE },
+	{ 6, "-9.2 ", -INT64_MAX, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
+	{ 6, "-8.9 ", -(int64_t)8949*1000*1000*1000*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, HN_AUTOSCALE, 6 },
 
-	{ 5, "8.0 E",   INT64_MAX, HN_DECIMAL, HN_AUTOSCALE },
-	{ 5, "7.9 E",   INT64_MAX-(int64_t)100*1024*1024*1024*1024*1024LL, HN_DECIMAL, HN_AUTOSCALE },
-	{ 6, "-8.0 ", -INT64_MAX, HN_DECIMAL, HN_AUTOSCALE },
-	{ 6, "-7.9 ",   -INT64_MAX+(int64_t)100*1024*1024*1024*1024*1024LL, HN_DECIMAL, HN_AUTOSCALE },
+	{ 5, "8.0 E",   INT64_MAX, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 5, "7.9 E",   INT64_MAX-(int64_t)100*1024*1024*1024*1024*1024LL, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 6, "-8.0 ", -INT64_MAX, HN_DECIMAL, HN_AUTOSCALE, 6 },
+	{ 6, "-7.9 ",   -INT64_MAX+(int64_t)100*1024*1024*1024*1024*1024LL, HN_DECIMAL, HN_AUTOSCALE, 6 },
 
 	/* Positive, Fixed scales */
-	{ 5, "500 k", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1 },
-	{ 5, "0.5 M", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 },
-	{ 5, "949 k", (int64_t)949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1 },
-	{ 5, "0.9 M", (int64_t)949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 },
-	{ 5, "950 k", (int64_t)950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1 },
-	{ 5, "1.0 M", (int64_t)950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 },
-	{ 5, "999 k", (int64_t)999*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1 },
-	{ 5, "1.0 M", (int64_t)999*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 },
-	{ 5, "1.5 M", (int64_t)1500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 },
-	{ 5, "1.9 M", (int64_t)1949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 },
-	{ 5, "2.0 M", (int64_t)1950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 },
-	{ 5, "9.9 M", (int64_t)9949*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 },
-	{ 4, "10 M", (int64_t)9950*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 },
-	{ 5, "500 M", (int64_t)500*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 },
-	{ 5, "0.5 G", (int64_t)500*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 3 },
-	{ 5, "999 M", (int64_t)999*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2 },
-	{ 5, "1.0 G", (int64_t)999*1000*1000L, HN_DECIMAL|HN_DIVISOR_1000, 3 },
+	{ 5, "500 k", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 1, 6 },
+	{ 5, "0.5 M", (int64_t)500*1000L, HN_DECIMAL|HN_DIVISOR_1000, 2, 6 },

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712291251.vBTCpQsa011082>