diff options
author | Martin Baulig <martin@src.gnome.org> | 1998-08-12 16:42:57 +0000 |
---|---|---|
committer | Martin Baulig <martin@src.gnome.org> | 1998-08-12 16:42:57 +0000 |
commit | da622f70c7f6067b0f55ab098ebd24c8d8a8963e (patch) | |
tree | c0f3b402687e97da38da674b3b77b29b7ee46279 /examples/first.c | |
parent | a0cb2b913dab400a0bbeb069285b70ff043511c9 (diff) | |
download | libgtop-da622f70c7f6067b0f55ab098ebd24c8d8a8963e.tar.gz |
Reverted changed made in last revision (1.21) of this file.
Diffstat (limited to 'examples/first.c')
-rw-r--r-- | examples/first.c | 31 |
1 files changed, 1 insertions, 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 <glibtop/sysdeps.h> #include <sys/resource.h> -#include <sys/mman.h> #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); @@ -272,20 +257,6 @@ main (int argc, char *argv []) (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, - (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); - getrusage (RUSAGE_SELF, &ru); fprintf (stderr, "GETRUSAGE: (%ld, %ld) - (%ld, %ld)\n", |