mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-19 17:46:52 +08:00
Add netstat command
This adds the netstat command. All but one file is currently enabled. That file does not currently build. Also added libmemstat and libutil. libmemstat had a lot of code related to kvm and kernel memory access disabled. This may or may not be an issue.
This commit is contained in:
@@ -56,12 +56,10 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <err.h>
|
||||
#ifdef __rtems__
|
||||
/* XXX what to do? */
|
||||
#else
|
||||
#ifndef __rtems__
|
||||
#include <kvm.h>
|
||||
#include <memstat.h>
|
||||
#endif
|
||||
#include <memstat.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -110,6 +108,7 @@ mbpr(void *kvmd, u_long mbaddr)
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
#ifndef __rtems__
|
||||
if (memstat_kvm_all(mtlp, kvmd) < 0) {
|
||||
error = memstat_mtl_geterror(mtlp);
|
||||
if (error == MEMSTAT_ERROR_KVM)
|
||||
@@ -120,6 +119,7 @@ mbpr(void *kvmd, u_long mbaddr)
|
||||
memstat_strerror(error));
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
mtp = memstat_mtl_find(mtlp, ALLOCATOR_UMA, MBUF_MEM_NAME);
|
||||
|
Reference in New Issue
Block a user