From 8d0d26767b5606a7c65dc22daba9bf48a2ebd2b1 Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Mon, 4 Jun 2018 04:59:32 +0000 Subject: top(1): include what you use - Change headers to more closely match what we use - use more standard functions instead of bzero, bcmp, bcopy - Add myself to authors. Tested with: base clang (amd64), gcc 9 (amd64), base clang (i386), base gcc (mips) --- usr.bin/top/machine.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'usr.bin/top/machine.c') diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 4d7ff95ebfb1..f5b8dfac0245 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -8,37 +8,35 @@ * by Monte Mitzelfelt (for latest top see http://www.groupsys.com/topinfo/) * * AUTHOR: Christos Zoulas - * Steven Wallace + * Steven Wallace * Wolfram Schneider * Thomas Moestl + * Eitan Adler * * $FreeBSD$ */ #include -#include +#include #include +#include #include #include -#include -#include #include #include #include -#include #include #include #include #include -#include #include -#include #include #include +#include #include #include -#include +#include #include #include @@ -86,8 +84,6 @@ struct handle { #define PCTCPU(pp) (pcpu[pp - pbase]) -/* definitions for indices in the nlist array */ - /* * These definitions control the format of the per-process area */ @@ -647,7 +643,7 @@ get_old_proc(struct kinfo_proc *pp) return (NULL); } oldp = *oldpp; - if (bcmp(&oldp->ki_start, &pp->ki_start, sizeof(pp->ki_start)) != 0) { + if (memcmp(&oldp->ki_start, &pp->ki_start, sizeof(pp->ki_start)) != 0) { pp->ki_udata = NOPROC; return (NULL); } @@ -669,7 +665,7 @@ get_io_stats(const struct kinfo_proc *pp, long *inp, long *oup, long *flp, oldp = get_old_proc(pp); if (oldp == NULL) { - bzero(&dummy, sizeof(dummy)); + memset(&dummy, 0, sizeof(dummy)); oldp = &dummy; } *inp = RU(pp)->ru_inblock - RU(oldp)->ru_inblock; -- cgit v1.2.3