summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/main.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-06-14 15:45:09 +0000
committerru <ru@FreeBSD.org>2001-06-14 15:45:09 +0000
commitbf0e940d3c46e6420e5bc6760b2340164800d440 (patch)
tree355a0dea4d821b23b4b9611c08a8a37d57fb0917 /usr.bin/netstat/main.c
parent1122486743c04a141d79ea166612f06d2c54325c (diff)
downloadFreeBSD-src-bf0e940d3c46e6420e5bc6760b2340164800d440.zip
FreeBSD-src-bf0e940d3c46e6420e5bc6760b2340164800d440.tar.gz
Restore -M -N support for -m.
PR: 20808
Diffstat (limited to 'usr.bin/netstat/main.c')
-rw-r--r--usr.bin/netstat/main.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 1981e44..293e899 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -145,6 +145,14 @@ static struct nlist nl[] = {
{ "_mif6table" },
#define N_PFKEYSTAT 37
{ "_pfkeystat" },
+#define N_MBSTAT 38
+ { "_mbstat" },
+#define N_MBTYPES 39
+ { "_mbtypes" },
+#define N_NMBCLUSTERS 40
+ { "_nmbclusters" },
+#define N_NMBUFS 41
+ { "_nmbufs" },
{ "" },
};
@@ -467,7 +475,14 @@ main(argc, argv)
setgid(getgid());
if (mflag) {
- mbpr();
+ if (memf != NULL) {
+ if (kread(0, 0, 0) == 0)
+ mbpr(nl[N_MBSTAT].n_value,
+ nl[N_MBTYPES].n_value,
+ nl[N_NMBCLUSTERS].n_value,
+ nl[N_NMBUFS].n_value);
+ } else
+ mbpr(0, 0, 0, 0);
exit(0);
}
if (pflag) {
@@ -723,10 +738,11 @@ name2protox(name)
static void
usage()
{
- (void)fprintf(stderr, "%s\n%s\n%s\n%s\n",
+ (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
"usage: netstat [-AaLlnW] [-f address_family] [-M core] [-N system]",
-" netstat [-abdgilmnrs] [-f address_family] [-M core] [-N system]",
+" netstat [-abdgilnrs] [-f address_family] [-M core] [-N system]",
" netstat [-bdn] [-I interface] [-M core] [-N system] [-w wait]",
+" netstat -m [-M core] [-N system]",
" netstat [-M core] [-N system] [-p protocol]");
exit(1);
}
OpenPOWER on IntegriCloud