dragonfly.git
6 years agoFix typo in MLINK name.
Sascha Wildner [Sun, 4 Mar 2018 09:18:24 +0000 (10:18 +0100)]
Fix typo in MLINK name.

6 years agoRemove some sendsys()/waitsys() remains.
Sascha Wildner [Sat, 3 Mar 2018 17:20:16 +0000 (18:20 +0100)]
Remove some sendsys()/waitsys() remains.

6 years agosysmouse - Fix sigio handling after c2962d9da8200947ee394b190eea39d437fb1af7
Imre Vadász [Wed, 28 Feb 2018 20:47:08 +0000 (21:47 +0100)]
sysmouse - Fix sigio handling after c2962d9da8200947ee394b190eea39d437fb1af7

6 years agoRemove some really old portability hacks that should no longer be needed.
Sascha Wildner [Sat, 3 Mar 2018 15:52:10 +0000 (16:52 +0100)]
Remove some really old portability hacks that should no longer be needed.

This no longer declares ftruncate()/lseek()/mmap() and truncate() in
either <stdio.h> or <sys/types.h>. 20 years after FreeBSD added it
(in r24896) we should be over it. What's left, we'll fix better.

6 years ago<arpa/inet.h>: Some cleanups.
Sascha Wildner [Sat, 3 Mar 2018 15:42:06 +0000 (16:42 +0100)]
<arpa/inet.h>: Some cleanups.

* Stop defining struct in6_addr. This doesn't belong here, and it was
  originally only added because of some issue in pkgsrc. Thanks to
  Sevan Janiyan for confirming that this no longer occurs.

* Incude <stdint.h> instead of the full <sys/types.h> and define
  in_addr_t and in_port_t per POSIX.

* Put inet_ntoa_r under __BSD_VISIBLE.

* Remove an obsolete comment.

6 years ago<pthread.h>: Add missing 'const' to four functions.
Sascha Wildner [Sat, 3 Mar 2018 15:34:48 +0000 (16:34 +0100)]
<pthread.h>: Add missing 'const' to four functions.

6 years agoSort SEE ALSO in two manual pages.
Sascha Wildner [Fri, 2 Mar 2018 13:30:48 +0000 (14:30 +0100)]
Sort SEE ALSO in two manual pages.

6 years agonfs.5: Add missing markup.
Sascha Wildner [Fri, 2 Mar 2018 07:10:50 +0000 (08:10 +0100)]
nfs.5: Add missing markup.

6 years agonfs.5: Clarify vfs.nfs.nfsv3_commit_on_close description a bit.
Sascha Wildner [Fri, 2 Mar 2018 07:08:07 +0000 (08:08 +0100)]
nfs.5: Clarify vfs.nfs.nfsv3_commit_on_close description a bit.

6 years ago{read,write}.2: A bit more cleanup. Also add ext*() MLINKS.
Sascha Wildner [Fri, 2 Mar 2018 06:40:17 +0000 (07:40 +0100)]
{read,write}.2: A bit more cleanup. Also add ext*() MLINKS.

6 years agoworld - Document extpread() and extpwrite()
Matthew Dillon [Fri, 2 Mar 2018 02:57:11 +0000 (18:57 -0800)]
world - Document extpread() and extpwrite()

* Document these DragonFly-specific system calls.

6 years agofstat(1): Add hammer2 support.
Sascha Wildner [Wed, 28 Feb 2018 13:24:07 +0000 (14:24 +0100)]
fstat(1): Add hammer2 support.

6 years ago<vfs/hammer2/hammer2.h>: Expose VTOI() with _KERNEL_STRUCTURES.
Sascha Wildner [Wed, 28 Feb 2018 13:22:56 +0000 (14:22 +0100)]
<vfs/hammer2/hammer2.h>: Expose VTOI() with _KERNEL_STRUCTURES.

6 years agokernel/netgraph7: Fix panic
Markus Pfeiffer [Sat, 24 Feb 2018 14:11:06 +0000 (14:11 +0000)]
kernel/netgraph7: Fix panic

We just unset the M_HASH flag for the mbuf before queueing the
message to the netisr, making sure the handler doesn't run
on the wrong CPU.

6 years agolibc: Fix a comment in Makefile.inc.
Sascha Wildner [Fri, 23 Feb 2018 08:30:55 +0000 (09:30 +0100)]
libc: Fix a comment in Makefile.inc.

6 years agostring.3: Fix types of strlcat() and strlcpy() prototypes.
Sascha Wildner [Fri, 23 Feb 2018 07:57:14 +0000 (08:57 +0100)]
string.3: Fix types of strlcat() and strlcpy() prototypes.

6 years agosyscons - Detangle sysmouse from tty handling, implement a custom FIFO.
Imre Vadász [Thu, 22 Feb 2018 21:54:33 +0000 (22:54 +0100)]
syscons - Detangle sysmouse from tty handling, implement a custom FIFO.

* This avoids unnecessary IPIs and other overhead from the tty handling.

* This also makes reads from the character device always get only complete
  sysmouse packets.

6 years agosyscons - No special minor device number is needed anymore for sysmouse.
Imre Vadász [Thu, 22 Feb 2018 21:54:10 +0000 (22:54 +0100)]
syscons - No special minor device number is needed anymore for sysmouse.

6 years agoselect.2: timeout is restrict too.
Sascha Wildner [Thu, 22 Feb 2018 17:56:30 +0000 (18:56 +0100)]
select.2: timeout is restrict too.

6 years agoAdd missing restrict qualifiers to various manual pages.
Sascha Wildner [Thu, 22 Feb 2018 17:40:14 +0000 (18:40 +0100)]
Add missing restrict qualifiers to various manual pages.

6 years agokernel/u4b: Some additional work for the recent cdce(4) addition.
Sascha Wildner [Thu, 22 Feb 2018 13:37:35 +0000 (14:37 +0100)]
kernel/u4b: Some additional work for the recent cdce(4) addition.

* Add a manual page from FreeBSD.

* Add to LINT64.

* Adjust devd(8) configuration so that cdce.ko automatically loads upon
  plugging.

6 years agokernel/u4b: Use CDCE_LOCK/CDCE_UNLOCK macros
Markus Pfeiffer [Wed, 21 Feb 2018 23:57:23 +0000 (23:57 +0000)]
kernel/u4b: Use CDCE_LOCK/CDCE_UNLOCK macros

6 years agokernel: port if_cdce
Markus Pfeiffer [Mon, 19 Feb 2018 20:59:02 +0000 (20:59 +0000)]
kernel: port if_cdce

While here also update it to FreeBSD's

6 years agokernel/acpi: Remove the old APM emulation code.
Sascha Wildner [Thu, 22 Feb 2018 06:50:13 +0000 (07:50 +0100)]
kernel/acpi: Remove the old APM emulation code.

This is no longer needed by anything. The <machine/apm_bios.h> header
with APM ioctl defines can go as well.

While here, do a little adjustment of comments and manual pages too.

Pointed-out-by: ivadasz
6 years agoUPGRADING: Mention the recent removal of 'device virtio_pci'.
Sascha Wildner [Wed, 21 Feb 2018 10:01:29 +0000 (11:01 +0100)]
UPGRADING: Mention the recent removal of 'device virtio_pci'.

6 years agonrelease - Add missing headers to src-sys.tar.bz2
Matthew Dillon [Tue, 20 Feb 2018 18:47:26 +0000 (10:47 -0800)]
nrelease - Add missing headers to src-sys.tar.bz2

* Add missing headers to src-sys.tar.bz2 so 'make nativekernel'
  actually works.

Reported-by: Constantine A. Murenin
6 years agolibc/libc_rtld: Fix up some comments in the Makefiles.
Sascha Wildner [Tue, 20 Feb 2018 13:28:02 +0000 (14:28 +0100)]
libc/libc_rtld: Fix up some comments in the Makefiles.

6 years agogpt - Add a new directive called 'init'
Matthew Dillon [Tue, 20 Feb 2018 08:39:01 +0000 (00:39 -0800)]
gpt - Add a new directive called 'init'

* Add a new directive called 'init'.  This directive works like
  gpt create except it will also create a msdos slice 0 (and newfs_msdos
  it), and a "DragonFly Label64" slice 1, and
  'disklabel -r -w <slice1> auto'.

* If -B is also specified, the init directive will populate the msdos
  filesystem with efi/boot/bootx64.efi, and also supplies -B to the
  disklabel command.

* This command does not create the boot, swap, or root filesystem
  partitions in the disklabel.  It is meant to do something similar
  to what fdisk -IB used to do for us for legacy partitions (though
  I should note that fdisk -IB didn't initialize a new disklabel).  But
  we do for gpt.

6 years agokernel/ncr: Fix double assignment.
Sascha Wildner [Tue, 20 Feb 2018 07:36:41 +0000 (08:36 +0100)]
kernel/ncr: Fix double assignment.

Taken-from: FreeBSD

6 years agokernel/i915: Fix double assignment (Linux' ed58570f55e2c5755).
Sascha Wildner [Tue, 20 Feb 2018 07:30:16 +0000 (08:30 +0100)]
kernel/i915: Fix double assignment (Linux' ed58570f55e2c5755).

6 years agokernel/i915: Fix double assignment (Linux' 52eb92c6fe8f89c30).
Sascha Wildner [Tue, 20 Feb 2018 07:25:33 +0000 (08:25 +0100)]
kernel/i915: Fix double assignment (Linux' 52eb92c6fe8f89c30).

6 years agortadvd(8): Fix double assignment.
Sascha Wildner [Tue, 20 Feb 2018 07:10:06 +0000 (08:10 +0100)]
rtadvd(8): Fix double assignment.

ra->nd_ra_flags_reserved is initialized properly a few lines below.
Assigning 0 first is unnecessary.

6 years agokernel/urtw: Fix double assignments.
Sascha Wildner [Tue, 20 Feb 2018 07:05:43 +0000 (08:05 +0100)]
kernel/urtw: Fix double assignments.

This driver hasn't been properly ported and isn't built currently. The
fix is just to silence coccinelle when searching for double assignments.

Taken-from: FreeBSD

6 years agotools/w00t: Fix double assignment.
Sascha Wildner [Tue, 20 Feb 2018 06:57:52 +0000 (07:57 +0100)]
tools/w00t: Fix double assignment.

6 years agoFix two double assignments in the kernel and the boot code.
Sascha Wildner [Mon, 19 Feb 2018 12:46:53 +0000 (13:46 +0100)]
Fix two double assignments in the kernel and the boot code.

6 years agovirtio - Remove explicit load of virtio.ko. Remove device virtio_pci line.
Imre Vadász [Sun, 12 Mar 2017 12:54:48 +0000 (13:54 +0100)]
virtio - Remove explicit load of virtio.ko. Remove device virtio_pci line.

* virtio.ko never needs to be loaded explicitly, since virtio_pci.ko
  depends on it.

* Also get rid of device virtio_pci line in the kernel config. Similar to
  other buses, link virtio_pci statically into the kernel when both
  device virtio and device pci are configured.

6 years agoncurses: Make sure to pass NXCFLAGS to NXCC.
zrj [Mon, 5 Feb 2018 18:04:30 +0000 (20:04 +0200)]
ncurses: Make sure to pass NXCFLAGS to NXCC.

Only the -I... paths are needed for cpp invocation.

6 years agoLIBPRIV: Make sure sh(1) only depends on lib.so.
zrj [Wed, 7 Feb 2018 14:48:20 +0000 (16:48 +0200)]
LIBPRIV: Make sure sh(1) only depends on lib.so.

Avoid possible cases of failed installworld target.

6 years agosh(1): Add and use pregenerated headers.
zrj [Tue, 6 Feb 2018 21:56:48 +0000 (23:56 +0200)]
sh(1): Add and use pregenerated headers.

These only add 30k to the repo while ensuring that bin/sh would not be
affected by bad shell script invocation etc. As the bonus it solves the
issue in share/initrd too. Nothing in the generated headers should fail
for our use cases. If that would change, please report it.

6 years agodevinfo - Print info, whether a device is flagged as disabled.
Imre Vadász [Mon, 5 Feb 2018 17:19:52 +0000 (18:19 +0100)]
devinfo - Print info, whether a device is flagged as disabled.

* Also make -v print only enabled devices, specifying -v twice will also
  print disabled devices. This should make "devinfo -v" output less
  confusing on modern hardware with lots of non-present devices in the ACPI
  namespace.

6 years agolibdevinfo - Fix enum devinfo_state.
Imre Vadász [Mon, 5 Feb 2018 17:19:33 +0000 (18:19 +0100)]
libdevinfo - Fix enum devinfo_state.

6 years agokern - Add D_MEM flag to /dev/mem and /dev/kmem character devices.
Imre Vadász [Mon, 5 Feb 2018 20:24:11 +0000 (21:24 +0100)]
kern - Add D_MEM flag to /dev/mem and /dev/kmem character devices.

* This makes seeking actually work on these character devices, which fixes
  performance of various tools when reading from /dev/mem or /dev/kmem.

6 years agoatkbdc - Do not attach PS2 controller via legacy ISA bus, if FADT says so.
Imre Vadász [Thu, 1 Feb 2018 12:16:55 +0000 (13:16 +0100)]
atkbdc - Do not attach PS2 controller via legacy ISA bus, if FADT says so.

* If the FADT BootFlags value tells us that we shouldn't expect the PS2
  controller to be at the IO ports 0x60/0x64, we should instead only attach
  the atkbdc driver when there is a matching device in the ACPI namespace.

* This avoids attempts to attach the atkbdc PS2 controller driver on
  hardware which doesn't have a usable PS2 controller. This happens on
  many modern notebooks, and has been the case for some time on desktop
  hardware that doesn't provide an emulated PS2 controller for using USB
  input devices all the time (it either is never initialized, or might
  get disabled by some of the ACPI or USB initialization during bootup).

6 years agoReplace local array size calculations with NELEM().
Sascha Wildner [Sun, 18 Feb 2018 01:42:43 +0000 (02:42 +0100)]
Replace local array size calculations with NELEM().

6 years agoConvert from __arysize to NELEM
Eitan Adler [Fri, 16 Feb 2018 08:53:39 +0000 (00:53 -0800)]
Convert from __arysize to NELEM

Try to use a single macro across the board

Discussed-with: zrj, swildner

6 years agonfs.5: Adjust (c) year.
Sascha Wildner [Sat, 17 Feb 2018 22:35:11 +0000 (23:35 +0100)]
nfs.5: Adjust (c) year.

6 years agonfs.5: Remove unneeded .Pp
Sascha Wildner [Sat, 17 Feb 2018 22:31:09 +0000 (23:31 +0100)]
nfs.5: Remove unneeded .Pp

6 years agodevfs.5: Document sysctl.
Sascha Wildner [Sat, 17 Feb 2018 22:29:15 +0000 (23:29 +0100)]
devfs.5: Document sysctl.

Submitted-by: zrj
6 years agoffs.5: Document more sysctls.
Sascha Wildner [Sat, 17 Feb 2018 22:28:15 +0000 (23:28 +0100)]
ffs.5: Document more sysctls.

Move ffs sysctls to their own section.

Submitted-by: zrj
6 years agoAdd nfs(5) manpage.
Sascha Wildner [Sat, 17 Feb 2018 22:27:03 +0000 (23:27 +0100)]
Add nfs(5) manpage.

Document all sysctls.

Submitted-by: zrj
6 years agoAdd vfs(7) manpage.
Sascha Wildner [Sat, 17 Feb 2018 22:25:39 +0000 (23:25 +0100)]
Add vfs(7) manpage.

Document all sysctls except for sizeof stuct ones.

Submitted-by: zrj
6 years agokernel - Fix syscons's visual bell
Matthew Dillon [Sat, 17 Feb 2018 19:29:49 +0000 (11:29 -0800)]
kernel - Fix syscons's visual bell

* The visual bell code was completely broken.

* Refactor the callout, and use the new callout_init_lk facility
  to deal with races.

Reported-by: snurg
6 years agodrm/linux: Update hlist_for_each_entry_safe() from FreeBSD
François Tigeot [Sat, 17 Feb 2018 08:56:55 +0000 (09:56 +0100)]
drm/linux: Update hlist_for_each_entry_safe() from FreeBSD

6 years agosbin/hammer: Fix compile warning on Linux
Tomohiro Kusumi [Sat, 17 Feb 2018 01:49:39 +0000 (10:49 +0900)]
sbin/hammer: Fix compile warning on Linux

Warned by gcc 7.3.1 in Fedora.
Extend the size of destination string.
dirent::d_name[] is 256 bytes in Linux (and *BSD).

--
cmd_abort.c: In function 'hammer_cmd_abort_cleanup':
cmd_abort.c:73:44: warning: '%s' directive output may be truncated writing up to 255 bytes into a region of size 55 [-Wformat-truncation=]
    snprintf (pidfile, PIDFILE_BUFSIZE, "%s/%s",
                                            ^~
cmd_abort.c:73:4: note: 'snprintf' output between 10 and 265 bytes into a destination of size 64
    snprintf (pidfile, PIDFILE_BUFSIZE, "%s/%s",
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     pidfile_loc, den->d_name);
     ~~~~~~~~~~~~~~~~~~~~~~~~~

6 years agomille(6): minor nits
Eitan Adler [Fri, 16 Feb 2018 08:13:08 +0000 (00:13 -0800)]
mille(6): minor nits

- adding missing header
- remove unused variable
- static where possible

Reviewed-by: zrj

6 years agogcc50: Switch backends to use internal lib framework.
zrj [Wed, 14 Feb 2018 15:08:24 +0000 (17:08 +0200)]
gcc50: Switch backends to use internal lib framework.

Previously backends where implicitly using bsd.hostlib.mk that have few
unwanted side effects (backends are install targets). Avoid that.
No functional change for current master users.

Tested-with: WORLD_CCVER and _DEFAULT_CCVER combinations.

6 years agofish(6): Suppress -Wdiscarded-qualifiers warning.
zrj [Thu, 15 Feb 2018 13:43:06 +0000 (15:43 +0200)]
fish(6): Suppress -Wdiscarded-qualifiers warning.

6 years ago/usr/Makefile: Fix typo.
Sascha Wildner [Thu, 15 Feb 2018 14:19:30 +0000 (15:19 +0100)]
/usr/Makefile: Fix typo.

6 years agocorrect prior commit...
Eitan Adler [Thu, 15 Feb 2018 12:21:58 +0000 (04:21 -0800)]
correct prior commit...

6 years agolarn(6): fix open call
Eitan Adler [Thu, 15 Feb 2018 12:17:58 +0000 (04:17 -0800)]
larn(6): fix open call

Prior to this the ", 0666" was being treated like the comma operator
rather than an argument to open(2).

6 years agolarn(6): remove HIDEBYLINK
Eitan Adler [Thu, 15 Feb 2018 12:10:13 +0000 (04:10 -0800)]
larn(6): remove HIDEBYLINK

The implementation of HIDEBYLINK is a bit wonky, doesn't really work,
and includes its own reimplementation of bzero.

6 years agofish(6): fix several issues
Eitan Adler [Thu, 15 Feb 2018 11:52:52 +0000 (03:52 -0800)]
fish(6): fix several issues

- avoid use of _ in application namespace
- use posix_spawnp instead of system()
- prefer less(1) over more(1)
- mark usage as dead
- staticfy

This world-class programs deserves world-class source code.

6 years agoUpdate the pciconf(8) database.
Sascha Wildner [Thu, 15 Feb 2018 11:03:40 +0000 (12:03 +0100)]
Update the pciconf(8) database.

February 15, 2018 snapshot from https://pci-ids.ucw.cz

6 years ago<pthread.h>: Note that we are missing some functions in #if 0'd protos.
Sascha Wildner [Thu, 15 Feb 2018 09:10:34 +0000 (10:10 +0100)]
<pthread.h>: Note that we are missing some functions in #if 0'd protos.

6 years agodevd: only use correct argument in select(2)
Eitan Adler [Thu, 15 Feb 2018 08:53:49 +0000 (00:53 -0800)]
devd: only use correct argument in select(2)

Discussed-with: zrj
Reviewed-by: vangyzen@FreeBSD.org, ian@FreeBSD.org
Objected-to-by: imp@FreeBSD.org

6 years agoselect(2): mark as restrict in man page
Eitan Adler [Thu, 15 Feb 2018 08:40:34 +0000 (00:40 -0800)]
select(2): mark as restrict in man page

This has already been done in code, so change the man page

Discussed-with: swildner

6 years agoAdd missing restrict qualifiers in POSIX function definitions/declarations.
Sascha Wildner [Thu, 15 Feb 2018 08:54:34 +0000 (09:54 +0100)]
Add missing restrict qualifiers in POSIX function definitions/declarations.

This creates no further -Wrestrict warnings with gcc80 in buildworld.

6 years ago<sys/cdefs.h>: Add __restrict_arr to declare arrays as non-overlapping.
Sascha Wildner [Thu, 15 Feb 2018 08:26:09 +0000 (09:26 +0100)]
<sys/cdefs.h>: Add __restrict_arr to declare arrays as non-overlapping.

Based-on: glibc

6 years agokernel - Vet b_cmd in swap_pager_strategy().
Matthew Dillon [Wed, 14 Feb 2018 19:53:40 +0000 (11:53 -0800)]
kernel - Vet b_cmd in swap_pager_strategy().

* swap_pager_strategy() needs to properly vet b_cmd.  This doesn't fix
  any bugs per-say, but is needed for robustness to ensure that the code
  does not accidently corrupt the swapcache in a later evolution.

6 years agokernel - Fix rare missed wakeup() in lockmgr
Matthew Dillon [Wed, 14 Feb 2018 19:49:40 +0000 (11:49 -0800)]
kernel - Fix rare missed wakeup() in lockmgr

* Fix a rare missed wakeup() case in lockmgr.  lk_count can briefly
  become (SHARED | 0 counts | (EXREQ or UPREQ)).  Three competing cores
  can then cause a situation where undo_shreq() fails to issue a wakeup()
  to threads acquiring a shared lock that are blocked waiting for the
  EXREQ or UPREQ

  Issue the missing wakeup() for this case.

* This race arises because of an optimization we make when dropping a
  shared lock.  atomic_fcmpset*() loops are fairly poor at dealing
  with concurrent increments and decrements, so undo_shreq() (which
  is also used when releasing a standard shared lock) decrements the
  shared lock count first, then deals with EXREQ or UPREQ afterwords.

  Usually a shared lock request bumps the shared lock count before
  blocking, which other lock releases use to determine the need for a
  wakeup().  However, shared lock requests cannot bump the shared lock
  count when the lock is already held SHARED but there is an EXREQ or
  UPREQ pending, because doing do basically grants the shared lock
  immediately.

  This combination leads to the brief situation which allows other cpu
  cores to squeeze in operations of their own without realizing that
  someone might be blocked trying to obtain a shared lock, but with no
  shared count present to indicate so.  If the undo_shreq()'s later
  atomic_fcmpset*() calls then fail, or find that there is no EXREQ or
  UPREQ pending, it fails to issue the needed wakeup().

6 years agohammer2 - Add missing bkvasync() (2)
Matthew Dillon [Wed, 14 Feb 2018 15:48:10 +0000 (07:48 -0800)]
hammer2 - Add missing bkvasync() (2)

* Add another missing bkvasync().  This fixes a temporary (memory-only)
  corruption issue which crops up in synth tests.

6 years agokernel - Document bkvasync() requirements
Matthew Dillon [Wed, 14 Feb 2018 15:45:26 +0000 (07:45 -0800)]
kernel - Document bkvasync() requirements

* Document that bkvasync() needs to be callable from multiple
  cpus concurrently (aka H2 shared buffering).  The lock has to be
  controlled by the caller (owned by the caller in some way), but the
  owner does not have to be the calling cpu.

6 years agoBump __DragonFly_version after %b and %r formats removal.
zrj [Wed, 14 Feb 2018 09:30:38 +0000 (11:30 +0200)]
Bump __DragonFly_version after %b and %r formats removal.

6 years agoddb: Some minor adjustments.
Sascha Wildner [Wed, 14 Feb 2018 08:49:50 +0000 (09:49 +0100)]
ddb: Some minor adjustments.

6 years agokernel: Add security.ptr_restrict sysctl.
zrj [Sun, 4 Feb 2018 17:13:02 +0000 (19:13 +0200)]
kernel: Add security.ptr_restrict sysctl.

Allow to prevent leaking kernel addresses back to the userland
(intentionally or not). We have quite a lot debug prints already and by
default we allow unprivileged processes to read kernel message buffers.

6 years agoUpdate porting_drivers.txt
zrj [Sun, 4 Feb 2018 15:58:34 +0000 (17:58 +0200)]
Update porting_drivers.txt

6 years agoworld: Remove references to %r and %b.
zrj [Sun, 4 Feb 2018 15:32:02 +0000 (17:32 +0200)]
world: Remove references to %r and %b.

While there, remove %r and %b and %y support from libstand(3).
Those format are not used in loaders and only eat space.

6 years agokernel: Remove last use cases of "%b" format.
zrj [Sun, 4 Feb 2018 14:50:03 +0000 (16:50 +0200)]
kernel: Remove last use cases of "%b" format.

Switch to args safe "%pb%i" internal format.

6 years agokernel/disk: Remove use of "%b" format.
zrj [Sun, 4 Feb 2018 14:27:27 +0000 (16:27 +0200)]
kernel/disk: Remove use of "%b" format.

Switch to args safe "%pb%i" internal format.

6 years agokernel/net: Remove use of "%b" format.
zrj [Sun, 4 Feb 2018 13:06:59 +0000 (15:06 +0200)]
kernel/net: Remove use of "%b" format.

Switch to args safe "%pb%i" internal format.

Note: the if_nfe.c used 0x%4b format, while %b was not handling the width.

6 years agokernel: Remove use of "%b" format in main kernel code.
zrj [Sun, 4 Feb 2018 12:30:53 +0000 (14:30 +0200)]
kernel: Remove use of "%b" format in main kernel code.

Switch to args safe "%pb%i" internal format.

6 years agokernel: Implement "%pb%i" as args safe "%b" replacement.
zrj [Sun, 4 Feb 2018 12:15:43 +0000 (14:15 +0200)]
kernel: Implement "%pb%i" as args safe "%b" replacement.

6 years agokernel: Nuke legacy FreeBSD "%r" format support.
zrj [Sat, 3 Feb 2018 19:27:51 +0000 (21:27 +0200)]
kernel: Nuke legacy FreeBSD "%r" format support.

Makes a quite a cleanup in subr_prf.c and less hits against things
like "%rip". Only one custom format remains - "%b".

6 years agokernel: Remove use of deprecated "%r" radix format.
zrj [Sat, 3 Feb 2018 18:42:11 +0000 (20:42 +0200)]
kernel: Remove use of deprecated "%r" radix format.

6 years agokernel: Implement makedev_unit_b32()
zrj [Sat, 3 Feb 2018 18:37:03 +0000 (20:37 +0200)]
kernel: Implement makedev_unit_b32()

It would be used to replace deprecated legacy FreeBSD "%r" formats.
Change tty_pty.c to use hex2ascii(), since it has only upto 32 devices.

6 years agoddb(4): Remove use of deprecated "%r" radix format.
zrj [Sat, 3 Feb 2018 13:08:21 +0000 (15:08 +0200)]
ddb(4): Remove use of deprecated "%r" radix format.

Use internal helpers like for "%z" to print numbers.

Taken-from: NetBSD (with adaptations by swildner)

6 years agokernel - Try to fix delayed mtime updates on SHARED+RW maps again
Matthew Dillon [Wed, 14 Feb 2018 07:02:18 +0000 (23:02 -0800)]
kernel - Try to fix delayed mtime updates on SHARED+RW maps again

* Attempt to fix continuing problems with mtime updates related to
  modifications made via SHARED+RW mmap()s.  As evidenced by builds
  under synth sometimes getting confused.

* Don't update vp->v_lastwrite_ts in vop_stdclose().  Instead, update
  the field and set a new flag VLASTWRITETS upon mmap(SHARED+PROT_WRITE)
  or upon mprotect(PROT_WRITE) on a SHARED mmap.

* Clear the flag on any regular write, utimes, or truncation.

* Adjust various filesystems to update mtime from vp->v_lastwrite_ts
  only upon UIO_NOCOPY writes, and only if VLASTWRITETS is set.

  tmpfs, ufs, hammer, hammer2 adjusted.

6 years agohammer2 - Add missing bkvasync()
Matthew Dillon [Wed, 14 Feb 2018 01:46:46 +0000 (17:46 -0800)]
hammer2 - Add missing bkvasync()

* Add missing bkvasync() when a file read receives a chain from the
  XOP helper thread.

6 years agopthread.3: Add missing functions.
Sascha Wildner [Tue, 13 Feb 2018 17:25:10 +0000 (18:25 +0100)]
pthread.3: Add missing functions.

6 years ago<signal.h>: Adjust #if 0'd prototype.
Sascha Wildner [Tue, 13 Feb 2018 17:23:21 +0000 (18:23 +0100)]
<signal.h>: Adjust #if 0'd prototype.

6 years agoChange __restrict -> restrict in two manual pages.
Sascha Wildner [Tue, 13 Feb 2018 17:22:38 +0000 (18:22 +0100)]
Change __restrict -> restrict in two manual pages.

6 years agosbin/hammer: Fix compile error on Linux
Tomohiro Kusumi [Tue, 13 Feb 2018 23:48:39 +0000 (08:48 +0900)]
sbin/hammer: Fix compile error on Linux

Failed with gcc 4.4.7 in CentOS 6.x.
--
cmd_recover.c:78: error: redefinition of typedef 'bigblock_t'
cmd_recover.c:55: note: previous declaration of 'bigblock_t' was here

6 years agosys/vfs/autofs: Remove AUTOFS_ASSERT_*LOCKED()
Tomohiro Kusumi [Tue, 13 Feb 2018 23:35:32 +0000 (08:35 +0900)]
sys/vfs/autofs: Remove AUTOFS_ASSERT_*LOCKED()

These macros came from FreeBSD, but more readable without these.

6 years agosys/vfs/autofs: Change autofs_mount::am_lock to use mutex(9)
Tomohiro Kusumi [Tue, 13 Feb 2018 22:13:13 +0000 (07:13 +0900)]
sys/vfs/autofs: Change autofs_mount::am_lock to use mutex(9)

6 years agosys/vfs/autofs: Change autofs_node::an_vnode_lock to use mutex(9)
Tomohiro Kusumi [Tue, 13 Feb 2018 21:57:32 +0000 (06:57 +0900)]
sys/vfs/autofs: Change autofs_node::an_vnode_lock to use mutex(9)

6 years agohammer(8): Remove include guards in a .c file.
Sascha Wildner [Tue, 13 Feb 2018 14:06:25 +0000 (15:06 +0100)]
hammer(8): Remove include guards in a .c file.

6 years agosys/vfs/autofs: Remove #if0'd export related code
Tomohiro Kusumi [Tue, 13 Feb 2018 18:33:30 +0000 (03:33 +0900)]
sys/vfs/autofs: Remove #if0'd export related code

Exporting is never going to be implemented.

6 years agosys/vfs/autofs: Cleanups
Tomohiro Kusumi [Tue, 13 Feb 2018 17:10:39 +0000 (02:10 +0900)]
sys/vfs/autofs: Cleanups

6 years agobinutils227: Add support for DWARF-4 line number tables.
zrj [Tue, 13 Feb 2018 09:56:13 +0000 (11:56 +0200)]
binutils227: Add support for DWARF-4 line number tables.

Backport from upstream trunk the c83344582375e65643c5efe68b3739e87db482f3

Work around the ld.gold issue when '.rela.debug_line' is populated.
We use ld.gold as default system linker that sigbus on DWARF-4 tables.
LDVER=ld.bfd seems to be unaffected, apply 2018-02-03 fix only for 227.
No functional change for default non-debug buildworlds (only for gcc80).

6 years ago<unistd.h>: Remove commented out ctermid() prototype. It's not needed here.
Sascha Wildner [Mon, 12 Feb 2018 20:05:42 +0000 (21:05 +0100)]
<unistd.h>: Remove commented out ctermid() prototype. It's not needed here.