* Copyright (c) 1980, 1992, 1993
* The Regents of the University of California. All rights reserved.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)mbufs.c 8.1 (Berkeley) %G%";
static struct mbstat
*mb
;
#define NNAMES (sizeof (mtnames) / sizeof (mtnames[0]))
return (subwin(stdscr
, LINES
-5-1, 0, 5, 0));
wmove(wnd
, 0, 0); wclrtoeol(wnd
);
"/0 /5 /10 /15 /20 /25 /30 /35 /40 /45 /50 /55 /60");
register int i
, j
, max
, index
;
for (j
= 0; j
< wnd
->maxy
; j
++) {
for (i
= 0; i
< wnd
->maxy
; i
++)
if (mb
->m_mtypes
[i
] > max
) {
mvwprintw(wnd
, 1+j
, 0, "%10d", index
);
mvwprintw(wnd
, 1+j
, 0, "%-10.10s", mtnames
[index
]);
sprintf(buf
, " %d", max
);
wmove(wnd
, 1+j
, 0); wclrtobot(wnd
);
static struct nlist namelist
[] = {
if (namelist
[X_MBSTAT
].n_type
== 0) {
if (kvm_nlist(kd
, namelist
)) {
if (namelist
[X_MBSTAT
].n_type
== 0) {
error("namelist on %s failed", _PATH_UNIX
);
mb
= (struct mbstat
*)calloc(1, sizeof (*mb
));
if (namelist
[X_MBSTAT
].n_type
== 0)
NREAD(X_MBSTAT
, mb
, sizeof (*mb
));