and compiler warnings.
The data for network statistics are still obtained via the kvm interface
if systat was started with the needed privileges, otherwise sysctls are
used. The reason for this is that with really many open sockets, the
sysctl method is probably slower, but it systat -netstat is probably not
really usable in either mode under these conditions.
Approved by: rwatson
o Add more checks for buffer overflows
o Use snprintf rather than strcat/cpy and have better checks for max
length exceeded.
Most of these changes are not exploitable buffer overruns, but it never
hurts to be safe.
Inspired by and obtained from: OpenBSD
Use the correct value of hz (stathz if it is nonzero) for
interpretion of dk_time[] and cp_time[] in iostat.c. Avoid
multiple conversions of this value in iostat.c and vmstat.c
iostat.c:
Implement the display of cp_time[CP_INTR]. Fix the display
of cp_time[CP_IDLE] (the display was always null because
cp_time[CP_INTR] == 0 was displayed instead).
systat.1:
Document the display of cp_time[CP_INTR].
vmstat.c:
Implement the display of cp_time[CP_INTR].