HomeFreeBSD

Use timercmp() and timersub() in kdump.

Description

Use timercmp() and timersub() in kdump.

Previously, kdump used the kernel-only timervalsub() macro which required
defining _KERNEL when including <sys/time.h>. Now, kdump uses the existing
userland API. The timercmp() usage to check for a backwards timestamp is
also clearer and simpler than the previous code which checked the result of
the subtraction for a negative value.

While here, take advantage of the 3-arg timersub() to store the subtraction
results in a tempory timeval instead of overwriting the timestamp in the
ktrace record and then having to restore it.

Details

Provenance
jhbAuthored on
Parents
rS306564: Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined.
Branches
Unknown
Tags
Unknown