mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-23 23:47:16 +08:00
netstat: Enable use of kvm again
The code committed has some debug information enabled. It ends with an odd reference to address 0x1.
This commit is contained in:
parent
34e1fb2c5a
commit
5f600ddbed
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user