diff --git a/ChangeLog b/ChangeLog index aa172184..92404929 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 1998-07-24 Martin Baulig + * sysdeps/common/mountlist.c (glibtop_get_mountlist_s): + Added `all_fs' parameter. + * sysdeps/{kernel, linux}/*.c: Replaced `glibtop_init_r' with `glibtop_init_s'. diff --git a/examples/mountlist.c b/examples/mountlist.c index 5e2e72c4..cca91d3f 100644 --- a/examples/mountlist.c +++ b/examples/mountlist.c @@ -69,14 +69,14 @@ main (int argc, char *argv []) printf ("sbrk (0) = %p\n\n", sbrk (0)); for (c = 0; c < PROFILE_COUNT; c++) { - mount_entries = glibtop_get_mountlist (&mount_list); + mount_entries = glibtop_get_mountlist (&mount_list, 1); glibtop_free (mount_entries); } printf ("sbrk (0) = %p\n\n", sbrk (0)); - mount_entries = glibtop_get_mountlist (&mount_list); + mount_entries = glibtop_get_mountlist (&mount_list, 1); if (mount_entries == NULL) _exit (1); diff --git a/include/glibtop/Makefile.am b/include/glibtop/Makefile.am index a0157346..bf565fab 100644 --- a/include/glibtop/Makefile.am +++ b/include/glibtop/Makefile.am @@ -6,4 +6,4 @@ glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \ procmem.h procuid.h swap.h write.h error.h open.h \ procsegment.h read.h sysdeps.h xmalloc.h global.h \ output.h procsignal.h read_data.h union.h types.h \ - parameter.h + parameter.h mountlist.h fsusage.h diff --git a/include/glibtop/mountlist.h b/include/glibtop/mountlist.h index ddd7a632..a6c368d5 100644 --- a/include/glibtop/mountlist.h +++ b/include/glibtop/mountlist.h @@ -55,13 +55,13 @@ struct _glibtop_mountlist size; /* GLIBTOP_MOUNTLIST_SIZE */ }; -#define glibtop_get_mountlist(mountlist) glibtop_get_mountlist_l(glibtop_global_server, mountlist) +#define glibtop_get_mountlist(mountlist,all_fs) glibtop_get_mountlist_l(glibtop_global_server, mountlist, all_fs) #define glibtop_get_mountlist_r glibtop_get_mountlist_s -extern glibtop_mountentry *glibtop_get_mountlist_l __P((glibtop *, glibtop_mountlist *)); +extern glibtop_mountentry *glibtop_get_mountlist_l __P((glibtop *, glibtop_mountlist *, int)); -extern glibtop_mountentry *glibtop_get_mountlist_s __P((glibtop *, glibtop_mountlist *)); +extern glibtop_mountentry *glibtop_get_mountlist_s __P((glibtop *, glibtop_mountlist *, int)); __END_DECLS diff --git a/lib/lib.awk b/lib/lib.awk index c89694e3..ad402974 100644 --- a/lib/lib.awk +++ b/lib/lib.awk @@ -28,6 +28,8 @@ function output(feature) { param = ", pid_t pid"; } else if (feature ~ /^fsusage$/) { param = ", const char *mountdir"; + } else if (feature ~ /^mountlist$/) { + param = ", int all_fs"; } else { param = ""; } @@ -58,7 +60,8 @@ function output(feature) { } else { if (feature ~ /^mountlist$/) { print "\t\treturn glibtop_call_l (server, GLIBTOP_CMND_MOUNTLIST,"; - print "\t\t\t\t 0, NULL, sizeof (glibtop_mountlist),"; + print "\t\t\t\t sizeof (all_fs), &all_fs,"; + print "\t\t\t\t sizeof (glibtop_mountlist),"; print "\t\t\t\t buf);"; } else if (feature ~ /^proclist$/) { print "\t\treturn glibtop_call_l (server, GLIBTOP_CMND_PROCLIST,"; @@ -70,7 +73,11 @@ function output(feature) { } print "\t} else {"; if (orig ~ /^@/) { - print "\t\t"prefix"glibtop_get_"feature"_s (server, buf);"; + if (feature ~ /^mountlist$/) { + print "\t\t"prefix"glibtop_get_"feature"_r (server, buf, all_fs);"; + } else { + print "\t\t"prefix"glibtop_get_"feature"_s (server, buf);"; + } } else { print "#if (!GLIBTOP_SUID_"toupper(feature)")"; print "\t\t"prefix"glibtop_get_"feature"_r (server, buf);"; diff --git a/src/daemon/main.c b/src/daemon/main.c index e7bb4b8f..5e6f934a 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -29,6 +29,7 @@ handle_parent_connection (int s) glibtop_command _cmnd, *cmnd = &_cmnd; glibtop_mountentry *mount_list; char parameter [BUFSIZ]; + int all_fs; pid_t pid; void *ptr; @@ -160,8 +161,9 @@ handle_parent_connection (int s) do_output (s, resp, _offset_data (proc_segment), 0, NULL); break; case GLIBTOP_CMND_MOUNTLIST: + memcpy (&all_fs, parameter, sizeof (all_fs)); mount_list = glibtop_get_mountlist_l - (server, &resp->u.data.mountlist); + (server, &resp->u.data.mountlist, all_fs); do_output (s, resp, _offset_data (mountlist), resp->u.data.mountlist.total, mount_list); glibtop_free_r (server, mount_list); diff --git a/sysdeps/common/mountlist.c b/sysdeps/common/mountlist.c index 468a115a..8545e097 100644 --- a/sysdeps/common/mountlist.c +++ b/sysdeps/common/mountlist.c @@ -589,7 +589,7 @@ read_filesystem_list (need_fs_type, all_fs) } glibtop_mountentry * -glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf) +glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf, int all_fs) { struct mount_entry *me, *tmp, *next; glibtop_mountentry *mount_list; @@ -601,7 +601,7 @@ glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf) /* Read filesystem list. */ - me = read_filesystem_list (1, 0); + me = read_filesystem_list (1, all_fs); if (me == NULL) return NULL;