add field for kvm descriptor.

* glibtop_machine.h: add field for kvm descriptor.

        * open.c: add code for opening kernel name space.

        * shm_limits.c: implemented.

The real implementation will have this code in the daemon, since process
needs to be setgid sys to be able to read kernel symbols.
This commit is contained in:
Drazen Kacar
1999-04-29 20:42:17 +00:00
parent a567adcce5
commit 2868191440
4 changed files with 42 additions and 2 deletions

View File

@@ -60,6 +60,10 @@ glibtop_open_s (glibtop *server, const char *program_name,
if (!server->machine.kc)
glibtop_error_io_r (server, "kstat_open ()");
server->machine.kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL);
if(!server->machine.kd)
glibtop_warn_io_r(server, "kvm_open()");
fprintf (stderr, "Sleeping 2 seconds, please wait ...\n");
sleep (2);
}