summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2012-10-24 15:40:19 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2012-10-24 15:40:19 -0500
commit5f600ddbed5120adf738f49ddd32f0a7ab57f671 (patch)
tree08df03d99fb32385a1c04fbdbfa0df8b7d17c584
parentAdd support for kvm.h in RTEMS terms (diff)
downloadrtems-libbsd-5f600ddbed5120adf738f49ddd32f0a7ab57f671.tar.bz2
netstat: Enable use of kvm again
The code committed has some debug information enabled. It ends with an odd reference to address 0x1.
-rw-r--r--freebsd-userspace/commands/usr.bin/netstat/main.c7
-rw-r--r--freebsd-userspace/commands/usr.bin/netstat/netstat.h4
-rw-r--r--freebsd-userspace/commands/usr.bin/netstat/netstat_route.c6
3 files changed, 10 insertions, 7 deletions
diff --git a/freebsd-userspace/commands/usr.bin/netstat/main.c b/freebsd-userspace/commands/usr.bin/netstat/main.c
index e5e3b2d5..c9750e24 100644
--- a/freebsd-userspace/commands/usr.bin/netstat/main.c
+++ b/freebsd-userspace/commands/usr.bin/netstat/main.c
@@ -325,7 +325,7 @@ struct protox *protoprotox[] = {
#ifndef __rtems__
atalkprotox, NULL };
#else
- };
+ NULL };
#endif
static void printproto(struct protox *, const char *);
@@ -1087,7 +1087,6 @@ printproto(tp, name)
#define _POSIX2_LINE_MAX 128
#endif
-#ifndef __rtems__
/*
* Read kernel memory, return 0 on success.
*/
@@ -1095,6 +1094,9 @@ int
kread(u_long addr, void *buf, size_t size)
{
char errbuf[_POSIX2_LINE_MAX];
+#ifdef __rtems__
+ printf( "kread( %p to %p for %d)\n", (void *)addr, buf, size );
+#endif
if (kvmd == NULL) {
kvmd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf);
@@ -1127,7 +1129,6 @@ kread(u_long addr, void *buf, size_t size)
}
return (0);
}
-#endif
const char *
plural(uintmax_t n)
diff --git a/freebsd-userspace/commands/usr.bin/netstat/netstat.h b/freebsd-userspace/commands/usr.bin/netstat/netstat.h
index 2c40156a..30d84f09 100644
--- a/freebsd-userspace/commands/usr.bin/netstat/netstat.h
+++ b/freebsd-userspace/commands/usr.bin/netstat/netstat.h
@@ -67,11 +67,7 @@ extern int unit; /* unit number for above */
extern int af; /* address family */
extern int live; /* true if we are examining a live system */
-#ifdef __rtems__
-#define kread(_x, _y, _z) (0)
-#else
int kread(u_long addr, void *buf, size_t size);
-#endif
const char *plural(uintmax_t);
const char *plurales(uintmax_t);
const char *pluralies(uintmax_t);
diff --git a/freebsd-userspace/commands/usr.bin/netstat/netstat_route.c b/freebsd-userspace/commands/usr.bin/netstat/netstat_route.c
index 2963a548..3d6d8970 100644
--- a/freebsd-userspace/commands/usr.bin/netstat/netstat_route.c
+++ b/freebsd-userspace/commands/usr.bin/netstat/netstat_route.c
@@ -230,6 +230,12 @@ routepr(u_long rtree)
continue;
if (rnh == NULL)
continue;
+#ifdef __rtems__
+ printf( "rnh %p %p\n", (void *)rnhp, (void *)rnh );
+ /* We get a 1 here on some fields. Why? XXX */
+ if (rnh == 1)
+ continue;
+#endif
/* Read the rnh data. */
if (kget(rnh, head) != 0)
continue;