summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2018-11-12 13:26:13 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2018-11-12 13:26:13 +0000
commit970bdbf5d75f082b69c41aa9372ed1a0eddd3419 (patch)
tree1b54831a4a0676cea2f15767c098c44b479bdcd1
parentb2b56606889cd11b155472009a991d458ff119f7 (diff)
Notes
-rw-r--r--usr.bin/systat/fetch.c5
-rw-r--r--usr.bin/systat/icmp6.c9
-rw-r--r--usr.bin/systat/ip.c7
-rw-r--r--usr.bin/systat/ip6.c7
-rw-r--r--usr.bin/systat/tcp.c3
-rw-r--r--usr.bin/systat/zarc.c11
6 files changed, 23 insertions, 19 deletions
diff --git a/usr.bin/systat/fetch.c b/usr.bin/systat/fetch.c
index 0fe37c532a712..4bb38bb12e730 100644
--- a/usr.bin/systat/fetch.c
+++ b/usr.bin/systat/fetch.c
@@ -68,9 +68,8 @@ void getsysctl(const char *name, void *ptr, size_t len)
strerror(errno));
}
if (nlen != len) {
- error("sysctl(%s...) expected %lu, got %lu", name,
- (unsigned long)len, (unsigned long)nlen);
- }
+ error("sysctl(%s...) expected %zu, got %zu", name, len, nlen);
+ }
}
/*
diff --git a/usr.bin/systat/icmp6.c b/usr.bin/systat/icmp6.c
index d00c98a2e7cc5..2853b90eff297 100644
--- a/usr.bin/systat/icmp6.c
+++ b/usr.bin/systat/icmp6.c
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)mbufs.c 8.1 (Berkeley) 6/6/93";
#include <netinet/in.h>
#include <netinet/icmp6.h>
+#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <paths.h>
@@ -173,7 +174,7 @@ void
showicmp6(void)
{
struct icmp6stat stats;
- u_long totalin, totalout;
+ uint64_t totalin, totalout;
int i;
memset(&stats, 0, sizeof stats);
@@ -184,11 +185,11 @@ showicmp6(void)
}
totalin += stats.icp6s_badcode + stats.icp6s_badlen +
stats.icp6s_checksum + stats.icp6s_tooshort;
- mvwprintw(wnd, 1, 0, "%9lu", totalin);
- mvwprintw(wnd, 1, 35, "%9lu", totalout);
+ mvwprintw(wnd, 1, 0, "%9"PRIu64, totalin);
+ mvwprintw(wnd, 1, 35, "%9"PRIu64, totalout);
#define DO(stat, row, col) \
- mvwprintw(wnd, row, col, "%9lu", stats.stat)
+ mvwprintw(wnd, row, col, "%9"PRIu64, stats.stat)
DO(icp6s_badcode, 2, 0);
DO(icp6s_badlen, 3, 0);
diff --git a/usr.bin/systat/ip.c b/usr.bin/systat/ip.c
index 045beb486421e..f177a6cd0ff8c 100644
--- a/usr.bin/systat/ip.c
+++ b/usr.bin/systat/ip.c
@@ -53,6 +53,7 @@ static const char sccsid[] = "@(#)mbufs.c 8.1 (Berkeley) 6/6/93";
#include <netinet/udp.h>
#include <netinet/udp_var.h>
+#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <paths.h>
@@ -203,16 +204,16 @@ void
showip(void)
{
struct stat stats;
- u_long totalout;
+ uint64_t totalout;
domode(&stats);
totalout = stats.i.ips_forward + stats.i.ips_localout;
#define DO(stat, row, col) \
- mvwprintw(wnd, row, col, "%9lu", stats.stat)
+ mvwprintw(wnd, row, col, "%9"PRIu64, stats.stat)
DO(i.ips_total, 1, 0);
- mvwprintw(wnd, 1, 35, "%9lu", totalout);
+ mvwprintw(wnd, 1, 35, "%9"PRIu64, totalout);
DO(i.ips_badsum, 2, 0);
DO(i.ips_localout, 2, 35);
DO(i.ips_tooshort, 3, 0);
diff --git a/usr.bin/systat/ip6.c b/usr.bin/systat/ip6.c
index d17b74e55a2cb..3b40a0676219f 100644
--- a/usr.bin/systat/ip6.c
+++ b/usr.bin/systat/ip6.c
@@ -52,6 +52,7 @@ static const char sccsid[] = "@(#)mbufs.c 8.1 (Berkeley) 6/6/93";
#include <netinet/ip.h>
#include <netinet6/ip6_var.h>
+#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <paths.h>
@@ -190,16 +191,16 @@ void
showip6(void)
{
struct ip6stat stats;
- u_long totalout;
+ uint64_t totalout;
domode(&stats);
totalout = stats.ip6s_forward + stats.ip6s_localout;
#define DO(stat, row, col) \
- mvwprintw(wnd, row, col, "%9lu", stats.stat)
+ mvwprintw(wnd, row, col, "%9"PRIu64, stats.stat)
DO(ip6s_total, 1, 0);
- mvwprintw(wnd, 1, 35, "%9lu", totalout);
+ mvwprintw(wnd, 1, 35, "%9"PRIu64, totalout);
DO(ip6s_tooshort, 2, 0);
DO(ip6s_localout, 2, 35);
DO(ip6s_toosmall, 3, 0);
diff --git a/usr.bin/systat/tcp.c b/usr.bin/systat/tcp.c
index 7dc9f0dfaf501..4ab644deb6714 100644
--- a/usr.bin/systat/tcp.c
+++ b/usr.bin/systat/tcp.c
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
+#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <paths.h>
@@ -237,7 +238,7 @@ showtcp(void)
domode(&stats);
#define DO(stat, row, col) \
- mvwprintw(wnd, row, col, "%12lu", stats.stat)
+ mvwprintw(wnd, row, col, "%12"PRIu64, stats.stat)
#define L(row, stat) DO(stat, row, 0)
#define R(row, stat) DO(stat, row, 38)
L(1, tcps_connattempt); R(1, tcps_sndtotal);
diff --git a/usr.bin/systat/zarc.c b/usr.bin/systat/zarc.c
index 9ac2df3cfd7d5..eaf85fc221e05 100644
--- a/usr.bin/systat/zarc.c
+++ b/usr.bin/systat/zarc.c
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/sysctl.h>
+#include <inttypes.h>
#include <string.h>
#include "systat.h"
@@ -139,11 +140,11 @@ showzarc(void)
#define DO(stat, row, col, fmt) \
mvwprintw(wnd, row, col, fmt, stat)
-#define R(row, stat) DO(rate.hits.stat, row, 31+1, "%3lu")
-#define H(row, stat) DO(delta.hits.stat, row, 31+1+5, "%7lu"); \
- DO(curstat.hits.stat, row, 31+1+5+8+8, "%12lu")
-#define M(row, stat) DO(delta.misses.stat, row, 31+1+5+8, "%7lu"); \
- DO(curstat.misses.stat, row, 31+1+5+8+8+13, "%12lu")
+#define R(row, stat) DO(rate.hits.stat, row, 31+1, "%3"PRIu64)
+#define H(row, stat) DO(delta.hits.stat, row, 31+1+5, "%7"PRIu64); \
+ DO(curstat.hits.stat, row, 31+1+5+8+8, "%12"PRIu64)
+#define M(row, stat) DO(delta.misses.stat, row, 31+1+5+8, "%7"PRIu64); \
+ DO(curstat.misses.stat, row, 31+1+5+8+8+13, "%12"PRIu64)
#define E(row, stat) R(row, stat); H(row, stat); M(row, stat);
E(1, arcstats);
E(2, arcstats_demand_data);