7 months agoMerge branch 'vendor/BYACC'
Sascha Wildner [Sat, 19 Sep 2020 09:31:31 +0000 (11:31 +0200)]
Merge branch 'vendor/BYACC'

7 months agoImport byacc-20200910 vendor/BYACC
Sascha Wildner [Sat, 19 Sep 2020 09:31:12 +0000 (11:31 +0200)]
Import byacc-20200910

7 months agoFix some more programs for newer byaccs.
Sascha Wildner [Sat, 19 Sep 2020 09:29:41 +0000 (11:29 +0200)]
Fix some more programs for newer byaccs.

7 months agoinet6 - Fix panic after route purge
Matthew Dillon [Fri, 18 Sep 2020 19:55:57 +0000 (12:55 -0700)]
inet6 - Fix panic after route purge

* When the codepath in nd6_timer_dispatch() purges an ia6, it
  then continues on and tests content in the now dead structure,
  resulting in a panic.

* Once an ia6 has been purged we continue the loop at the next
  ia6 instead of falling through and doing more tests.

Reported-by: phma
7 months agoPrepare a few programs for future byacc upgrades.
Sascha Wildner [Fri, 18 Sep 2020 17:49:33 +0000 (19:49 +0200)]
Prepare a few programs for future byacc upgrades.

Conditionalize yylex() prototypes on byacc's patchlevel.

Never byacc provides a prototype for yylex() by default since some time
and this prevents any fallout related to that.

7 months agosys/vfs/hammer2: Remove obsolete hammer2_devblk{radix,size}()
Tomohiro Kusumi [Wed, 16 Sep 2020 16:33:36 +0000 (01:33 +0900)]
sys/vfs/hammer2: Remove obsolete hammer2_devblk{radix,size}()

Remove these functions from 2013 as the comment implies.

Since physical blk size is always 64KiB, radix bits itself
in freemap class variable is redundant, but this commit just
removes two functions without functional changes.

7 months agohier.7: Mention /etc/calendar.
Sascha Wildner [Thu, 17 Sep 2020 08:43:24 +0000 (10:43 +0200)]
hier.7: Mention /etc/calendar.

7 months agoftpd(8): Exit during authentication if an error occurs after chroot().
Antonio Huete Jimenez [Wed, 16 Sep 2020 00:04:57 +0000 (02:04 +0200)]
ftpd(8): Exit during authentication if an error occurs after chroot().

Taken-from: FreeBSD
Security:       CVE-2020-7468

7 months agohack(6): Remove an unused header file.
Sascha Wildner [Wed, 16 Sep 2020 00:05:04 +0000 (02:05 +0200)]
hack(6): Remove an unused header file.

7 months agousr.bin/xargs: Do not report SIGPIPE from children.
Antonio Huete Jimenez [Tue, 15 Sep 2020 23:38:32 +0000 (01:38 +0200)]
usr.bin/xargs: Do not report SIGPIPE from children.

  - Additionally, print the signal name if it's known,
    otherwise just print the signal number. Before only
    the signal number was being reported.

Reported-by: swildner@
Taken-from: OpenBSD

7 months agobinutils227: Backport binutils commit 033bfb739b52
Antonio Huete Jimenez [Sun, 13 Sep 2020 14:54:04 +0000 (14:54 +0000)]
binutils227: Backport binutils commit 033bfb739b52

 - In DPorts, lang/ghc 'configure' phase was failing with this message:

      checking for ld.gold object merging bug (binutils 22266)... Abort trap
      (core dumped) affected
      configure: error: Linker is affected by binutils 22266 but couldn't find
      another unaffected linker. Please set the SettingsMergeObjectsCommand
      variable to a functional linker.
      ===>  Script "configure" failed unexpectedly.
 - https://lists.gnu.org/archive/html/bug-binutils/2017-11/msg00042.html
 - https://gitlab.haskell.org/ghc/ghc/-/issues/14328

Tested-with: buildworld+buildkernel+full dsynth run.

The fix for PR 19291 broke some other cases where -r is used with scripts,
as reported in PR 22266. The original fix for PR 22266 ended up breaking
many cases for REL targets, where the addends are stored in the section data,
and are not being adjusted properly.

The problem was basically that in a relocatable output file (ET_REL),
symbol values are supposed to be relative to the start address of their
section. Usually in a relocatable file, all sections start at 0, so the
failure to get this right is often irrelevant, but with a linker script,
we occasionally see an output section whose starting address is not 0,
and gold would occasionally write a symbol with its relocated value instead
of its section-relative value.

This patch reverts the recent fix for PR 22266 as well as my original fix
for PR 19291. The original fix moved the symbol value adjustment to
write_local_symbols, but neglected to undo a few places where the adjustment
was also being applied, resulting in an occasional double adjustment. The
more recent fix removed those other adjustments, but then failed to
re-account for the adjustment when rewriting the relocations on REL targets.

With the old attempts reverted, we now apply the symbol value adjustment to
the one case that had been missed (non-section symbols in merge sections).
But now we also need to account for the adjustment when rewriting the addends
for RELA relocations.

PR gold/19291
PR gold/22266
* object.cc (Sized_relobj_file::compute_final_local_value_internal):
Revert changes from 2017-11-08 patch.  Adjust symbol value in
relocatable links for non-section symbols.
(Sized_relobj_file::compute_final_local_value): Revert changes from
2017-11-08 patch.
(Sized_relobj_file::do_finalize_local_symbols): Likewise.
(Sized_relobj_file::write_local_symbols): Revert changes from
2015-11-25 patch.
* object.h (Sized_relobj_file::compute_final_local_value_internal):
Revert changes from 2017-11-08 patch.
* powerpc.cc (Target_powerpc::relocate_relocs): Adjust addend for
relocatable links.
* target-reloc.h (relocate_relocs): Adjust addend for relocatable links.
* testsuite/pr22266_a.c (hello): New function.
* testsuite/pr22266_main.c (main): Add test for merge sections.
* testsuite/pr22266_script.t: Add rule for .rodata.

7 months agobinutils227: Backport binutils commit 333d0055f6f16
Antonio Huete Jimenez [Sun, 13 Sep 2020 14:49:45 +0000 (14:49 +0000)]
binutils227: Backport binutils commit 333d0055f6f16

Fix problems with -r.

The fix committed for PR gold/19291 ended up breaking other cases. The
commit added adjustment code to write_local_symbols, but in many cases
compute_final_local_value_internal had already subtracted the output
section's address. To fix this, all other adjustments are now removed, so
only the one in write_local_symbols is left.

PR gold/22266
* object.cc (Sized_relobj_file::compute_final_local_value_internal):
Drop relocatable parameter and stop adjusting output value based on
(Sized_relobj_file::compute_final_local_value): Stop passing
relocatable to compute_final_local_value_internal.
(Sized_relobj_file::do_finalize_local_symbols): Ditto.
* object.h (Sized_relobj_file::compute_final_local_value_internal):
Drop relocatable parameter.

7 months agosbin/hammer2: Set error code if "grow" failed
Tomohiro Kusumi [Tue, 15 Sep 2020 16:00:22 +0000 (01:00 +0900)]
sbin/hammer2: Set error code if "grow" failed

7 months agoUpdate the pciconf(8) database.
Sascha Wildner [Tue, 15 Sep 2020 11:15:01 +0000 (13:15 +0200)]
Update the pciconf(8) database.

August 19, 2020 snapshot from https://pci-ids.ucw.cz

7 months agoecclesiastical.c: Fix comment error to easter()
Aaron LI [Mon, 14 Sep 2020 13:53:33 +0000 (21:53 +0800)]
ecclesiastical.c: Fix comment error to easter()

Well, the comment of easter() was copied from orthodox_easter() but
forgot to update it.

Reported-by: Sascha Wildner
7 months agocalendar.1: Fix a grammar mistake and avoid Pinyin symbols
Aaron LI [Mon, 14 Sep 2020 13:52:02 +0000 (21:52 +0800)]
calendar.1: Fix a grammar mistake and avoid Pinyin symbols

7 months agomkcsmapper(1): Move yylex() declaration to the .y file.
Sascha Wildner [Sun, 13 Sep 2020 17:38:13 +0000 (19:38 +0200)]
mkcsmapper(1): Move yylex() declaration to the .y file.

7 months agomille(6): Remove local erasechar()/killchar() definitions.
Sascha Wildner [Sat, 12 Sep 2020 23:56:41 +0000 (01:56 +0200)]
mille(6): Remove local erasechar()/killchar() definitions.

This also reverts f2a508fe031425cd16ce86e24837668eeffbc6f7 which is
no longer needed after this commit.

7 months agosbin/newfs_hammer2: Remove -f in SYNOPSIS
Tomohiro Kusumi [Sat, 12 Sep 2020 16:12:19 +0000 (01:12 +0900)]
sbin/newfs_hammer2: Remove -f in SYNOPSIS

7b2944d3f07cfec26f629f9ed161157b42a0af32 missed removal of -f in SYNOPSIS.

7 months agoedk2: Sync our TianoCore EDK II headers with the edk2-stable202008 tag.
Sascha Wildner [Sat, 12 Sep 2020 09:10:36 +0000 (11:10 +0200)]
edk2: Sync our TianoCore EDK II headers with the edk2-stable202008 tag.

7 months agoUpgrade libressl. 2/2
Daniel Fojt [Sat, 12 Sep 2020 07:43:41 +0000 (09:43 +0200)]
Upgrade libressl. 2/2


7 months agoUpgrade libressl. 1/2
Daniel Fojt [Sat, 12 Sep 2020 07:40:26 +0000 (09:40 +0200)]
Upgrade libressl. 1/2

Merge branch 'vendor/LIBRESSL' into master.

7 months agovendor/libressl: upgrade from 3.1.3 to 3.1.4
Daniel Fojt [Fri, 11 Sep 2020 14:58:25 +0000 (16:58 +0200)]
vendor/libressl: upgrade from 3.1.3 to 3.1.4

Interoperability and bug fixes for the TLSv1.3 client:

 * Improve client certificate selection to allow EC certificates
   instead of only RSA certificates.

 * Do not error out if a TLSv1.3 server requests an OCSP response as
   part of a certificate request.

 * Fix SSL_shutdown behavior to match the legacy stack.  The previous
   behaviour could cause a hang.

 * Fix a memory leak and add a missing error check in the handling of
   the key update message.

 * Fix a memory leak in tls13_record_layer_set_traffic_key.

 * Avoid calling freezero with a negative size if a server sends a
   malformed plaintext of all zeroes.

 * Ensure that only PSS may be used with RSA in TLSv1.3 in order
   to avoid using PKCS1-based signatures.

 * Add the P-521 curve to the list of curves supported by default
   in the client.

7 months ago<sys/cdefs.h>: Restore to original behavior for __{BEGIN,END}_DECLS.
Sascha Wildner [Fri, 11 Sep 2020 18:48:33 +0000 (20:48 +0200)]
<sys/cdefs.h>: Restore to original behavior for __{BEGIN,END}_DECLS.

Specifically, to how it was after a1671b4d6c66bceb629394590c46c15be034d14e
until 07a9133651472164d0ff4a0b6ffd6ecec4f46b30. I messed it up a little in
the latter commit.


7 months agosys/vfs/hammer2: Remove unused hammer2_iod_invals sysctl
Tomohiro Kusumi [Fri, 11 Sep 2020 18:40:46 +0000 (03:40 +0900)]
sys/vfs/hammer2: Remove unused hammer2_iod_invals sysctl

No longer used since 85b1f267a5c33386e0761edb93a486fce13e8e88 in 2017.

7 months agosys/vfs/hammer2: Remove unused hammer2_chain_frees sysctl
Tomohiro Kusumi [Fri, 11 Sep 2020 18:37:29 +0000 (03:37 +0900)]
sys/vfs/hammer2: Remove unused hammer2_chain_frees sysctl

Appeared in 7d565a4f16015b664e90560061ad7574c3e68737 in 2016,
but never used.

7 months agosys/vfs/hammer2: Remove unused hammer2_inval_enable sysctl
Tomohiro Kusumi [Fri, 11 Sep 2020 18:34:59 +0000 (03:34 +0900)]
sys/vfs/hammer2: Remove unused hammer2_inval_enable sysctl

No longer used since 85b1f267a5c33386e0761edb93a486fce13e8e88 in 2017.

7 months agodrm/linux: Fix __test_and_set_bit()
François Tigeot [Fri, 11 Sep 2020 17:19:16 +0000 (19:19 +0200)]
drm/linux: Fix __test_and_set_bit()

Its arguments were inverted.

7 months agodrm/linux: Add pagevec_space()
François Tigeot [Fri, 11 Sep 2020 17:12:37 +0000 (19:12 +0200)]
drm/linux: Add pagevec_space()

Obtained-from: OpenBSD

7 months agoterminfo: drop repeat-character capability from 'xterm-new' (2)
Matthew Dillon [Fri, 11 Sep 2020 16:31:18 +0000 (09:31 -0700)]
terminfo: drop repeat-character capability from 'xterm-new' (2)

* Drop all use cases, output is mis-generated in some situations
  (LANG and LC_CTYPE envs both unset, vi (nvi) a file with 0x0000000
  sequences in it).

  Frankly, its beyond stupid to even implement ansi sequences that were
  designed for an era of 1200 baud modems.

* Add comment describing why ansi+rep was removed.

7 months agosbin/newfs_hammer2: Remove/fix obsolete stuff from HAMMER1
Tomohiro Kusumi [Fri, 11 Sep 2020 15:18:20 +0000 (00:18 +0900)]
sbin/newfs_hammer2: Remove/fix obsolete stuff from HAMMER1

Remove unused -f option. HAMMER1 had this to force creation when
devices were smaller than expected, but HAMMER2 has no such limitation.
The man page also had incorrect description.

Fix incorrect code/description for -r option originally from HAMMER1.

7 months agocalendar.1: Fix minor formatting issues
Aaron LI [Fri, 11 Sep 2020 15:02:26 +0000 (23:02 +0800)]
calendar.1: Fix minor formatting issues

* Fix markup of the '-s' flag
* Use 'Cm' to itemize the values of the '-s' flag
* Use 'Rs' and 'Re' macros to format the reference book
* Update the usage text against the man page

7 months agoterminfo: drop repeat-character capability from 'xterm-new'
Daniel Fojt [Fri, 11 Sep 2020 14:12:44 +0000 (16:12 +0200)]
terminfo: drop repeat-character capability from 'xterm-new'

Remove ANSI capability 'rep' from xterm-new entry as it's causing
misbehaviour (at least) in nvi2 editor from base.

Reported by: Matthew Dillon

7 months agoterminfo: avoid alternate buffer in 'xterm-basic'
Daniel Fojt [Thu, 10 Sep 2020 18:01:31 +0000 (20:01 +0200)]
terminfo: avoid alternate buffer in 'xterm-basic'

Remove smcup and rmcup capabilities from xterm-basic entry to avoid screen
content restoration upon leaving viewers and editors (like less, vi, etc).

Reported by: Peeter Must, Matthew Dillon

7 months agocalendar(1): Define some days in Austria in relation to 'Advent' as well.
Sascha Wildner [Fri, 11 Sep 2020 10:27:34 +0000 (12:27 +0200)]
calendar(1): Define some days in Austria in relation to 'Advent' as well.

7 months agocalendar(1): Define various German entries relative to "Advent".
Sascha Wildner [Fri, 11 Sep 2020 06:15:00 +0000 (08:15 +0200)]
calendar(1): Define various German entries relative to "Advent".

Now that we have the special "Advent" day defined, we can make this
much better readable and unambiguous.

7 months agoflex - Fix buildworld issue when compiling on older releases
Matthew Dillon [Fri, 11 Sep 2020 04:11:15 +0000 (21:11 -0700)]
flex - Fix buildworld issue when compiling on older releases

* Conditionalize use of reallocarray() so flex can bootstrap during
  a buildworld on an older release.

7 months agosbin/newfs_hammer2: Fix comments/assert on 4MB segments
Tomohiro Kusumi [Thu, 10 Sep 2020 16:30:18 +0000 (01:30 +0900)]
sbin/newfs_hammer2: Fix comments/assert on 4MB segments

The 4MB segments exist at every 1GB (every level1 freemap),
not every 2GB "zone".

7 months agosys/vfs/hammer2: Remove obsolete comments on volume headers
Tomohiro Kusumi [Thu, 10 Sep 2020 15:36:24 +0000 (00:36 +0900)]
sys/vfs/hammer2: Remove obsolete comments on volume headers

Some comments here from 2012 seem obsolete.

7 months agosys/vfs/hammer2: Remove obsolete comments on hardlink
Tomohiro Kusumi [Thu, 10 Sep 2020 15:25:07 +0000 (00:25 +0900)]
sys/vfs/hammer2: Remove obsolete comments on hardlink

Hardlink in HAMMER2 is dirents which refer to the same inode#.
It was initially designed differently.

7 months agocalendar(1): Remove Volkstrauertag. It's already in calendar.kirche.
Sascha Wildner [Thu, 10 Sep 2020 17:18:39 +0000 (19:18 +0200)]
calendar(1): Remove Volkstrauertag. It's already in calendar.kirche.

7 months agocalendar(1): Add three more commemoration days to the german calendar.
Sascha Wildner [Thu, 10 Sep 2020 14:58:35 +0000 (16:58 +0200)]
calendar(1): Add three more commemoration days to the german calendar.

7 months agoSync tpm(4) with FreeBSD.
Sascha Wildner [Thu, 10 Sep 2020 04:02:11 +0000 (06:02 +0200)]
Sync tpm(4) with FreeBSD.

Adds TPM 2.0 support, mainly.

7 months agosbin/newfs_hammer2: Assert inodes/volhdrs don't cross 64KB boundary
Tomohiro Kusumi [Wed, 9 Sep 2020 16:01:19 +0000 (01:01 +0900)]
sbin/newfs_hammer2: Assert inodes/volhdrs don't cross 64KB boundary

Assert they fit within a pbuf in addition to existing asserts.

7 months agoUpgrade vi(1). 2/2
Daniel Fojt [Tue, 8 Sep 2020 08:49:35 +0000 (10:49 +0200)]
Upgrade vi(1). 2/2

- adjust Makefile
- regenerate header files

7 months agoUpgrade vi(1). 1/2
Daniel Fojt [Wed, 9 Sep 2020 06:36:13 +0000 (08:36 +0200)]
Upgrade vi(1). 1/2

Merge branch 'vendor/NVI2' into master.

7 months agovendor/nvi2: upgrade from 2.1.3 to 2.2.0 vendor/NVI2
Daniel Fojt [Mon, 7 Sep 2020 17:33:17 +0000 (19:33 +0200)]
vendor/nvi2: upgrade from 2.1.3 to 2.2.0

Digest of notable changes from git commit messages:

- fix incompatible behaviour of T
- remove a needless NULL-checks before free()
- fix backward sentence deletion
- fix a few memory leaks and a double free
- prevent erroneous COLUMNS/LINES settings
- add Vim-style expandtab option
- align unprintable chars correctly

For complete "git log" see:


7 months agosys/vfs/hammer2: Add () around HAMMER2_XOPMASK_* macros
Tomohiro Kusumi [Tue, 8 Sep 2020 16:04:51 +0000 (01:04 +0900)]
sys/vfs/hammer2: Add () around HAMMER2_XOPMASK_* macros

7 months agosys/vfs/hammer2: Change hammer2_bref_type_str() to take btype
Tomohiro Kusumi [Tue, 8 Sep 2020 15:44:04 +0000 (00:44 +0900)]
sys/vfs/hammer2: Change hammer2_bref_type_str() to take btype

struct hammer2_blockref isn't the only data structure with blockref type.

7 months agosys/vfs/hammer2: Add hammer2_adjwritecounter()
Tomohiro Kusumi [Tue, 8 Sep 2020 15:27:57 +0000 (00:27 +0900)]
sys/vfs/hammer2: Add hammer2_adjwritecounter()

Separate counters adjustment from HAMMER2 I/O code.

7 months agosys/vfs/hammer2: Ignore HAMMER2_BREF_TYPE_EMPTY in dio_write_stats_update()
Tomohiro Kusumi [Tue, 8 Sep 2020 15:23:53 +0000 (00:23 +0900)]
sys/vfs/hammer2: Ignore HAMMER2_BREF_TYPE_EMPTY in dio_write_stats_update()

Same as 1de4fc15b2011a762e9001a3ad50d1a0e84e544f except this one
already ignored 0 (HAMMER2_BREF_TYPE_EMPTY).

7 months agosys/vfs/hammer2: Make hammer2_iod_inode_* static
Tomohiro Kusumi [Tue, 8 Sep 2020 15:12:05 +0000 (00:12 +0900)]
sys/vfs/hammer2: Make hammer2_iod_inode_* static

7 months agonrelease: Follow-up commit 10d767c30ac91
Antonio Huete Jimenez [Mon, 7 Sep 2020 23:30:44 +0000 (01:30 +0200)]
nrelease: Follow-up commit 10d767c30ac91

  - In our release disk image, create /firstboot so that any
    rc.d script using the KEYWORD firstboot can be run
    exactly once at boot. Since the firstboot code assumes
    a read-write root filesystem, do not add this file to
    our ISO image.

7 months agosys/vfs/hammer2: Implement missing errors in hammer2_err*_to_err*()
Tomohiro Kusumi [Mon, 7 Sep 2020 16:30:11 +0000 (01:30 +0900)]
sys/vfs/hammer2: Implement missing errors in hammer2_err*_to_err*()

Add missing HAMMER2_ERROR_* compatible with errnos.
The existing conversions stay the same.

7 months agosys/vfs/hammer2: Remove unused HAMMER2_LOOKUP_ALLNODES
Tomohiro Kusumi [Sun, 6 Sep 2020 16:13:10 +0000 (01:13 +0900)]
sys/vfs/hammer2: Remove unused HAMMER2_LOOKUP_ALLNODES

No longer used since 01d71aa5538cba09383737ddbea2fb05e1e75e78 in 2015.

7 months agosys/vfs/hammer2: Remove unused HAMMER2_CHAIN_EMBEDDED
Tomohiro Kusumi [Sun, 6 Sep 2020 15:28:40 +0000 (00:28 +0900)]
sys/vfs/hammer2: Remove unused HAMMER2_CHAIN_EMBEDDED

Appeared in 512beabd66d77a7cca8f73bf69030ffa90f0b9e3 in 2013,
but no longer used, only appears in KASSERT.

7 months agosys/vfs/hammer2: Remove unused HAMMER2_CHAIN_FICTITIOUS
Tomohiro Kusumi [Sun, 6 Sep 2020 15:03:15 +0000 (00:03 +0900)]
sys/vfs/hammer2: Remove unused HAMMER2_CHAIN_FICTITIOUS

Appeared in b93cc2e0815ec1ad6d6f8e60cc0becbdee247679 in 2015,
but never used.

7 months agodhcpcd: update README.DRAGONFLY
Roy Marples [Sun, 6 Sep 2020 16:20:31 +0000 (17:20 +0100)]
dhcpcd: update README.DRAGONFLY

7 months agoMerge branch 'vendor/DHCPCD'
Roy Marples [Sun, 6 Sep 2020 16:17:50 +0000 (17:17 +0100)]
Merge branch 'vendor/DHCPCD'

7 months agoUpdate to dhcpcd-9.2.0 with the following changes:
Roy Marples [Sun, 6 Sep 2020 16:15:23 +0000 (17:15 +0100)]
Update to dhcpcd-9.2.0 with the following changes:

 * route: ensure IPv4LL routes come last in priority
 * DHCP: fix many issues with extending the last lease
 * privsep: don't read control group from config in privsep
 * privsep: only the master process responds to signals
 * privsep: use a socketpair for stderr/stdin rather than dupping /dev/null
 * privsep: right limit stdin/stderr/stdout
 * privsep: dumping a lease is now run in a sandbox
 * options: check if kernel supports INET or INET6 before enabling default
 * options: let clientid override a prior duid
 * options: allow -1 to represent infinity for requested lease time
 * dhcpcd: fix a crash initing a new interface after route overflow

7 months agosys/vfs/hammer2: Remove #if0'd function hammer2_allocsize()
Tomohiro Kusumi [Sat, 5 Sep 2020 18:14:17 +0000 (03:14 +0900)]
sys/vfs/hammer2: Remove #if0'd function hammer2_allocsize()

This is obsolete version of hammer2_getradix() which won't be used again.

7 months agosys/vfs/hammer2: Ignore HAMMER2_BREF_TYPE_EMPTY in hammer2_adjreadcounter()
Tomohiro Kusumi [Sat, 5 Sep 2020 18:02:24 +0000 (03:02 +0900)]
sys/vfs/hammer2: Ignore HAMMER2_BREF_TYPE_EMPTY in hammer2_adjreadcounter()

7 months agolibm: Mark some functions hidden (syncs math_private.h with OpenBSD).
Sascha Wildner [Sun, 6 Sep 2020 11:12:08 +0000 (13:12 +0200)]
libm: Mark some functions hidden (syncs math_private.h with OpenBSD).

7 months ago<sys/cdefs.h>: Add __{BEGIN,END}_HIDDEN_DECLS definitions and use them.
Sascha Wildner [Sun, 6 Sep 2020 11:06:37 +0000 (13:06 +0200)]
<sys/cdefs.h>: Add __{BEGIN,END}_HIDDEN_DECLS definitions and use them.

Remove local empty definitions of these macros in some Makefiles.

Thanks to zrj for testing with a full bulk build.

Taken-from: OpenBSD

7 months ago<sys/cdefs.h>: Move __dso_{public,hidden} to the other visibility defs.
Sascha Wildner [Sun, 6 Sep 2020 11:01:17 +0000 (13:01 +0200)]
<sys/cdefs.h>: Move __dso_{public,hidden} to the other visibility defs.

7 months ago<sys/cdefs.h>: Untangle the __{BEGIN,END}_DECLS definitions a bit.
Sascha Wildner [Sun, 6 Sep 2020 10:58:30 +0000 (12:58 +0200)]
<sys/cdefs.h>: Untangle the __{BEGIN,END}_DECLS definitions a bit.

Mainly separate the defined(__cplusplus) and the __GNU_PREREQ__(4, 0)

7 months agosys/vfs/hammer2: Fix function names in kprintf
Tomohiro Kusumi [Sat, 5 Sep 2020 12:34:07 +0000 (21:34 +0900)]
sys/vfs/hammer2: Fix function names in kprintf

8 months agoworld - Add /usr/projects maintenance to /usr/Makefile.
Matthew Dillon [Fri, 4 Sep 2020 18:18:04 +0000 (11:18 -0700)]
world - Add /usr/projects maintenance to /usr/Makefile.

* Add /usr/projects maintenance to /usr/Makefile.  This allows the
  dragonfly projects repo to be pulled and maintained, if desired.

8 months agocalendar(1): Rewrite to support Chinese & Julian calendars
Aaron LI [Sun, 2 Aug 2020 14:17:59 +0000 (22:17 +0800)]
calendar(1): Rewrite to support Chinese & Julian calendars

I wanted to use Chinese calendar in the calendar(1) utility, so I started
working on it.  The Chinese calendar is a lunisolar calendar and requires
calculations of Sun and Moon positions.  Along the way of implementing the
Chinese calendar support, more and more parts of the old code has been
replaced.  Now, the new calendar(1) code base has been mostly rewritten to
be more extensible to support multiple calendars.  Although only the
Gregorian (the default), Chinese and Julian calendars are currently
supported, more calendars now becomes much easier to add.

* Support Chinese calendar
* Support Julian calendar
* More accurate Sun and Moon calculations
* More extensible
* More calendar files/entries and more accurate information
* Better code base

Major Changes:
* If no user's calendar file, default to '/etc/calendar/default'
* Search calendar files in '/etc/calendar', which allows to override the
  calendar file in '/usr/share/calendar' in a system-wide way
* Add '-s' option to show information of Chinese/Julian calendar or
* Add '-H' option to specify the calendar home directory
* Add '-L' option to specify the location, which should be set to get
  accurate Sun/Moon information
* Add '-T' option to specify the current time for Sun/Moon calculations
* Much Improved calendar file parser
* More clean man page
* More helpful error messages
* Some bug fixes and various cleanups

The new calendar algorithms are implemented by referring to this great
Calendrical Calculations: The Ultimate Edition (4th Edition)
by Edward M. Reingold and Nachum Dershowitz.
Cambridge University Press, 2018.
ISBN: 9781107057623

More information about the development history of this calendar(1) utility
can be found in my GitHub repository:

8 months agoMakefile.usr: Always use pkg-static
Antonio Huete Jimenez [Thu, 3 Sep 2020 23:32:53 +0000 (01:32 +0200)]
Makefile.usr: Always use pkg-static

  - Should help in between LibreSSL upgrades.

8 months agosbin/newfs_hammer2: Fail if no free space left
Tomohiro Kusumi [Thu, 3 Sep 2020 15:17:02 +0000 (00:17 +0900)]
sbin/newfs_hammer2: Fail if no free space left

stat[v]fs shows negative free space if newfs/mount'd with <0 free_space.

8 months agosys/vfs/hammer2: Remove obsolete comments for hammer2_install_volume_header()
Tomohiro Kusumi [Thu, 3 Sep 2020 15:10:06 +0000 (00:10 +0900)]
sys/vfs/hammer2: Remove obsolete comments for hammer2_install_volume_header()

First two are implemented.
bread will fail for a small device with <4 volume headers (4 isn't mandatory).

8 months agokernel: avoid possible use-after-free in ipv6
Daniel Fojt [Thu, 3 Sep 2020 06:59:12 +0000 (08:59 +0200)]
kernel: avoid possible use-after-free in ipv6

Fix improper mbuf handling when processing IPv6 Hop-by-Hop options.

Taken from: FreeBSD (FreeBSD-SA-20:24.ipv6)

8 months agofdisk - Add storage expansion option
Matthew Dillon [Wed, 2 Sep 2020 20:00:56 +0000 (13:00 -0700)]
fdisk - Add storage expansion option

* Add the -x option to fdisk.  This will expand the last valid
  slice for an existing dos label to fit the storage.

  fdisk will refuse to expand an EFI GPT label, use 'gpt expand ...'

8 months agogpt, disklabel64 - Add storage expansion options (2)
Matthew Dillon [Wed, 2 Sep 2020 18:51:15 +0000 (11:51 -0700)]
gpt, disklabel64 - Add storage expansion options (2)

* Cleanup debugging printfs and improve messages.

8 months agogpt, disklabel64 - Add storage expansion options
Matthew Dillon [Wed, 2 Sep 2020 18:24:47 +0000 (11:24 -0700)]
gpt, disklabel64 - Add storage expansion options

* Add gpt expand directive.  For example 'gpt expand /dev/da0' will
  expand the gpt to fill /dev/da0.  This allows the gpt to be enlarged
  to fit a new, larger storage device or expanded storage and can be issued
  on a live gpt if desired.

* Add disklabel64 -x and -xx features.  This expands the disklabel to
  fit the new enlarged slice that it resides in.  If -xx is specified,
  the last partition configured in the disklabel will also be enlarged.

* And we already have 'hammer2 growfs <mountpt>' to grow a live hammer2
  filesystem to fit an enlarged partition.

8 months agosys/vfs/hammer2: Remove unused HAMMER2_INODE_RENAME_INPROG
Tomohiro Kusumi [Wed, 2 Sep 2020 16:10:07 +0000 (01:10 +0900)]
sys/vfs/hammer2: Remove unused HAMMER2_INODE_RENAME_INPROG

Appeared in 51bf8e9b90e371ed867e5fd82f8ad6fb74867b22 in 2013,
but never used.

Also fix obsolete comments for inode flags.

8 months agosys/vfs/hammer2: Fix wrong comment for hammer2_inode_modify()
Tomohiro Kusumi [Wed, 2 Sep 2020 16:03:54 +0000 (01:03 +0900)]
sys/vfs/hammer2: Fix wrong comment for hammer2_inode_modify()

Sync with changes after 815e1c13cd185a8d3507c7d200b6f53a78b6a364 in 2015.

8 months agosys/vfs/ext2fs: Cleanup empty lines (sync with FreeBSD)
Tomohiro Kusumi [Wed, 2 Sep 2020 15:50:17 +0000 (00:50 +0900)]
sys/vfs/ext2fs: Cleanup empty lines (sync with FreeBSD)

from freebsd/freebsd@db86a2fd1ccdf6fcdfe452f21d38a7f038b368a7

8 months agosys/vfs/msdosfs: Cleanup empty lines (sync with FreeBSD)
Tomohiro Kusumi [Wed, 2 Sep 2020 15:37:18 +0000 (00:37 +0900)]
sys/vfs/msdosfs: Cleanup empty lines (sync with FreeBSD)

from freebsd/freebsd@db86a2fd1ccdf6fcdfe452f21d38a7f038b368a7

8 months agosys/vfs/autofs: Cleanup empty lines (sync with FreeBSD)
Tomohiro Kusumi [Wed, 2 Sep 2020 15:36:36 +0000 (00:36 +0900)]
sys/vfs/autofs: Cleanup empty lines (sync with FreeBSD)

from freebsd/freebsd@db86a2fd1ccdf6fcdfe452f21d38a7f038b368a7

8 months agokernel: Fix LINT64 build after Linux RCU changes
François Tigeot [Wed, 2 Sep 2020 08:10:08 +0000 (10:10 +0200)]
kernel: Fix LINT64 build after Linux RCU changes

8 months agohammer2 - Add HAMMER2IOC_GROWFS ioctl (2)
Matthew Dillon [Tue, 1 Sep 2020 21:29:36 +0000 (14:29 -0700)]
hammer2 - Add HAMMER2IOC_GROWFS ioctl (2)

* Fix minor bug to not try to write volume headers beyond the new size.
  Only applicable to H2 filesystems less than 8GB in size.

8 months agohammer2 - Implement 'growfs' directive
Matthew Dillon [Tue, 1 Sep 2020 21:25:19 +0000 (14:25 -0700)]
hammer2 - Implement 'growfs' directive

* Implement the 'growfs' directive, as in:

  hammer2 growfs /mnt

* If you resize the partition a hammer2 filesystem resides on, you
  can grow the filesystem into the partition via this command.

  The hammer2 filesystem must be mounted to issue this command.

* Note that disklabel partitions can be made larger in-place, even
  with the filesystem using the partition already mounted, as long
  as the drive actually has room to spare.

8 months agohammer2 - Add HAMMER2IOC_GROWFS ioctl
Matthew Dillon [Tue, 1 Sep 2020 21:24:28 +0000 (14:24 -0700)]
hammer2 - Add HAMMER2IOC_GROWFS ioctl

* This ioctl allows a live filesystem to be resized into a partition
  that has increased in size.

8 months agodrm - Implement poor-man's RCU
Matthew Dillon [Tue, 1 Sep 2020 18:13:25 +0000 (11:13 -0700)]
drm - Implement poor-man's RCU

* Implement a really poor-man's RCU.  Not even remotely perfect, this
  is just a brute-force tie-in for now.

  RCU operations are queued and then executed on the calling cpu
  1 second later.

8 months agokernel - Revamp ifsq_watchdog*() a bit
Matthew Dillon [Tue, 1 Sep 2020 18:06:23 +0000 (11:06 -0700)]
kernel - Revamp ifsq_watchdog*() a bit

* Add a flags argument to ifsq_watchdog_init() and implement two

  IF_WDOG_ALLTICKS Watchdog callback occurs each second
prior to terminal count, and on terminal

  IF_WDOG_LASTTICK Watchdog callback occurs one second prior
to terminal count, and on terminal count.

  0 Watchdog callback only occurs on terminal

  Note that the ifnet lock is fully serialized when a watchdog
  callback is made, so generally speaking to avoid hicups you
  only want to use IF_WDOG_LASTTICK.

* This feature allows the watchdog code to flush any tx buffers
  (call *_txeof()) that have completed transmission.  Many NICs
  and virtual NICs don't bother to generate interrupts to clean-up
  such buffers when the rings are only lightly loaded.

* Fix spurious vtnet watchdog events on lightly loaded vtnet
  interfaces, loosly using the same code that FreeBSD uses
  (just txeof from the second-prior watchdog callback and then
  check on terminal count).

8 months agosys/vfs/hammer2: Remove Debugger() call for debugging in normal paths
Tomohiro Kusumi [Tue, 1 Sep 2020 15:03:12 +0000 (00:03 +0900)]
sys/vfs/hammer2: Remove Debugger() call for debugging in normal paths

8 months agosys/vfs/hammer2: Remove obsolete comments on indirect block
Tomohiro Kusumi [Mon, 31 Aug 2020 17:18:21 +0000 (02:18 +0900)]
sys/vfs/hammer2: Remove obsolete comments on indirect block

These comments from 9061bde5ad5e46bcaee746ed03d598a75b38691f in 2013
aren't really true today. Depends on blockref type, but indirect
blocks are usually 4, 16, or 32 KB, and blockref is 128 bytes.

8 months agosys/vfs/hammer2: Use hammer2_spin_t
Tomohiro Kusumi [Mon, 31 Aug 2020 15:21:00 +0000 (00:21 +0900)]
sys/vfs/hammer2: Use hammer2_spin_t

Use hammer2_spin_t instead of DragonFly specific lock primitive
structure "struct spinlock" for spinlock.

8 months agoPartially revert commit bdaacb9f+.
Daniel Fojt [Mon, 31 Aug 2020 10:09:13 +0000 (12:09 +0200)]
Partially revert commit bdaacb9f+.

Make *_RB_SCAN() back inlined. Possible inlining failures should be
treated gracefully with particular WORLD_CCOPTLEVEL.

Pointed out by: Sascha Wildner

8 months agofsck_hammer2(8): de-inline couple of functions
Daniel Fojt [Sun, 30 Aug 2020 11:30:30 +0000 (13:30 +0200)]
fsck_hammer2(8): de-inline couple of functions

Fix -Werror=inline ("call is unlikely and code size would grow") exposed
when building world with -Os.

8 months agolibefivar: use correct types in conversion macros
Daniel Fojt [Mon, 31 Aug 2020 06:46:28 +0000 (08:46 +0200)]
libefivar: use correct types in conversion macros

Adjust Strtoi() and Strtoi64() to return unsigned results, to match
upstream implementation.

Discussed with: Sascha Wildner

8 months agolibefivar: avoid accessing type-punned pointer
Daniel Fojt [Sat, 29 Aug 2020 10:23:53 +0000 (12:23 +0200)]
libefivar: avoid accessing type-punned pointer

Fix -Werror=strict-aliasing in Strtoi64() macro exposed when building
world with -O2.

8 months agolibfetch: avoid dereferencing possibly uninitialized pointer
Daniel Fojt [Sat, 29 Aug 2020 08:58:35 +0000 (10:58 +0200)]
libfetch: avoid dereferencing possibly uninitialized pointer

Fix -Werror=maybe-uninitialized exposed when building world with -Os.

8 months agosys/vfs/hammer2: Minor cleanup from cecb915381c4268602e4dfb4725d792e633b326d
Tomohiro Kusumi [Sun, 30 Aug 2020 16:40:03 +0000 (01:40 +0900)]
sys/vfs/hammer2: Minor cleanup from cecb915381c4268602e4dfb4725d792e633b326d

8 months agosys/vfs/hammer2: Remove nonexistent function prototypes
Tomohiro Kusumi [Sun, 30 Aug 2020 15:00:12 +0000 (00:00 +0900)]
sys/vfs/hammer2: Remove nonexistent function prototypes

8 months agolibc & libkvm: Fix wrong calculations in getloadavg() functions.
Sascha Wildner [Sun, 30 Aug 2020 07:52:34 +0000 (09:52 +0200)]
libc & libkvm: Fix wrong calculations in getloadavg() functions.

41ca9afb26bd2f0654acb8462f6abe441e329f80 changed the ldavg field of
struct loadavg to an array of __uint64_t from previously fixpt_t
which is __uint32_t.

Adjust two associated nelem calculations to use __uint64_t as well.

8 months ago<sys/if_media.h>: Fix typo.
Sascha Wildner [Sat, 29 Aug 2020 18:10:48 +0000 (20:10 +0200)]
<sys/if_media.h>: Fix typo.

8 months agosys/vfs/hammer2: Remove unused HAMMER2_MODIFY_{NO_MODIFY_TID,UNUSED0008}
Tomohiro Kusumi [Sat, 29 Aug 2020 15:37:28 +0000 (00:37 +0900)]
sys/vfs/hammer2: Remove unused HAMMER2_MODIFY_{NO_MODIFY_TID,UNUSED0008}

No longer used since 504565062f34ec55037ac0cf308fe3562f091460 in 2014.