From da622f70c7f6067b0f55ab098ebd24c8d8a8963e Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Wed, 12 Aug 1998 16:42:57 +0000 Subject: [PATCH] Reverted changed made in last revision (1.21) of this file. --- examples/first.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/examples/first.c b/examples/first.c index 5113bebb..cd83dbcf 100644 --- a/examples/first.c +++ b/examples/first.c @@ -32,7 +32,6 @@ #include #include -#include #ifndef PROFILE_COUNT #define PROFILE_COUNT 1 @@ -44,12 +43,10 @@ main (int argc, char *argv []) glibtop_union data; glibtop_sysdeps sysdeps; unsigned c, method, count, port, i, *ptr; - char buffer [BUFSIZ], *mmap_ptr; + char buffer [BUFSIZ]; struct rlimit rlim; struct rusage ru; - struct stat statb; pid_t pid, ppid; - int fd; count = PROFILE_COUNT; @@ -77,18 +74,6 @@ main (int argc, char *argv []) glibtop_init_r (&glibtop_global_server, 0, 0); - fd = open ("/COPYRIGHT", O_RDONLY); - if (!fd) glibtop_error_io ("open (/COPYRIGHT)"); - - if (stat ("/COPYRIGHT", &statb)) - glibtop_error_io ("stat (/COPYRIGHT)"); - - mmap_ptr = mmap (NULL, statb.st_size, PROT_READ | PROT_WRITE, - MAP_PRIVATE, fd, 0); - if (!mmap_ptr) glibtop_error_io ("mmap (/COPYRIGHT)"); - - fprintf (stderr, "MMAP: %p - %lu\n", mmap_ptr, statb.st_size); - for (c = 0; c < PROFILE_COUNT; c++) glibtop_get_cpu (&data.cpu); @@ -262,20 +247,6 @@ main (int argc, char *argv []) (unsigned long) rlim.rlim_max, (unsigned long) ((1 << 63) - 1)); - printf ("Proc_Mem PID %5u (0x%08lx): " - "%lu %lu %lu %lu %lu %lu\n", pid, - (unsigned long) data.proc_mem.flags, - (unsigned long) data.proc_mem.size, - (unsigned long) data.proc_mem.vsize, - (unsigned long) data.proc_mem.resident, - (unsigned long) data.proc_mem.share, - (unsigned long) data.proc_mem.rss, - (unsigned long) data.proc_mem.rss_rlim); - - mmap_ptr [0] = 'M'; - - glibtop_get_proc_mem (&data.proc_mem, pid); - printf ("Proc_Mem PID %5u (0x%08lx): " "%lu %lu %lu %lu %lu %lu\n", pid, (unsigned long) data.proc_mem.flags,