Added `all_fs' parameter.
1998-07-24 Martin Baulig <martin@home-of-linux.org> * sysdeps/common/mountlist.c (glibtop_get_mountlist_s): Added `all_fs' parameter.
This commit is contained in:
committed by
Martin Baulig
parent
f3f051ecba
commit
aa6d16e47b
@@ -1,5 +1,8 @@
|
|||||||
1998-07-24 Martin Baulig <martin@home-of-linux.org>
|
1998-07-24 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
* sysdeps/common/mountlist.c (glibtop_get_mountlist_s):
|
||||||
|
Added `all_fs' parameter.
|
||||||
|
|
||||||
* sysdeps/{kernel, linux}/*.c: Replaced `glibtop_init_r' with
|
* sysdeps/{kernel, linux}/*.c: Replaced `glibtop_init_r' with
|
||||||
`glibtop_init_s'.
|
`glibtop_init_s'.
|
||||||
|
|
||||||
|
@@ -69,14 +69,14 @@ main (int argc, char *argv [])
|
|||||||
printf ("sbrk (0) = %p\n\n", sbrk (0));
|
printf ("sbrk (0) = %p\n\n", sbrk (0));
|
||||||
|
|
||||||
for (c = 0; c < PROFILE_COUNT; c++) {
|
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);
|
glibtop_free (mount_entries);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("sbrk (0) = %p\n\n", sbrk (0));
|
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)
|
if (mount_entries == NULL)
|
||||||
_exit (1);
|
_exit (1);
|
||||||
|
@@ -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 \
|
procmem.h procuid.h swap.h write.h error.h open.h \
|
||||||
procsegment.h read.h sysdeps.h xmalloc.h global.h \
|
procsegment.h read.h sysdeps.h xmalloc.h global.h \
|
||||||
output.h procsignal.h read_data.h union.h types.h \
|
output.h procsignal.h read_data.h union.h types.h \
|
||||||
parameter.h
|
parameter.h mountlist.h fsusage.h
|
||||||
|
@@ -55,13 +55,13 @@ struct _glibtop_mountlist
|
|||||||
size; /* GLIBTOP_MOUNTLIST_SIZE */
|
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
|
#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
|
__END_DECLS
|
||||||
|
|
||||||
|
11
lib/lib.awk
11
lib/lib.awk
@@ -28,6 +28,8 @@ function output(feature) {
|
|||||||
param = ", pid_t pid";
|
param = ", pid_t pid";
|
||||||
} else if (feature ~ /^fsusage$/) {
|
} else if (feature ~ /^fsusage$/) {
|
||||||
param = ", const char *mountdir";
|
param = ", const char *mountdir";
|
||||||
|
} else if (feature ~ /^mountlist$/) {
|
||||||
|
param = ", int all_fs";
|
||||||
} else {
|
} else {
|
||||||
param = "";
|
param = "";
|
||||||
}
|
}
|
||||||
@@ -58,7 +60,8 @@ function output(feature) {
|
|||||||
} else {
|
} else {
|
||||||
if (feature ~ /^mountlist$/) {
|
if (feature ~ /^mountlist$/) {
|
||||||
print "\t\treturn glibtop_call_l (server, GLIBTOP_CMND_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);";
|
print "\t\t\t\t buf);";
|
||||||
} else if (feature ~ /^proclist$/) {
|
} else if (feature ~ /^proclist$/) {
|
||||||
print "\t\treturn glibtop_call_l (server, GLIBTOP_CMND_PROCLIST,";
|
print "\t\treturn glibtop_call_l (server, GLIBTOP_CMND_PROCLIST,";
|
||||||
@@ -70,7 +73,11 @@ function output(feature) {
|
|||||||
}
|
}
|
||||||
print "\t} else {";
|
print "\t} else {";
|
||||||
if (orig ~ /^@/) {
|
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 {
|
} else {
|
||||||
print "#if (!GLIBTOP_SUID_"toupper(feature)")";
|
print "#if (!GLIBTOP_SUID_"toupper(feature)")";
|
||||||
print "\t\t"prefix"glibtop_get_"feature"_r (server, buf);";
|
print "\t\t"prefix"glibtop_get_"feature"_r (server, buf);";
|
||||||
|
@@ -29,6 +29,7 @@ handle_parent_connection (int s)
|
|||||||
glibtop_command _cmnd, *cmnd = &_cmnd;
|
glibtop_command _cmnd, *cmnd = &_cmnd;
|
||||||
glibtop_mountentry *mount_list;
|
glibtop_mountentry *mount_list;
|
||||||
char parameter [BUFSIZ];
|
char parameter [BUFSIZ];
|
||||||
|
int all_fs;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
|
|
||||||
@@ -160,8 +161,9 @@ handle_parent_connection (int s)
|
|||||||
do_output (s, resp, _offset_data (proc_segment), 0, NULL);
|
do_output (s, resp, _offset_data (proc_segment), 0, NULL);
|
||||||
break;
|
break;
|
||||||
case GLIBTOP_CMND_MOUNTLIST:
|
case GLIBTOP_CMND_MOUNTLIST:
|
||||||
|
memcpy (&all_fs, parameter, sizeof (all_fs));
|
||||||
mount_list = glibtop_get_mountlist_l
|
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),
|
do_output (s, resp, _offset_data (mountlist),
|
||||||
resp->u.data.mountlist.total, mount_list);
|
resp->u.data.mountlist.total, mount_list);
|
||||||
glibtop_free_r (server, mount_list);
|
glibtop_free_r (server, mount_list);
|
||||||
|
@@ -589,7 +589,7 @@ read_filesystem_list (need_fs_type, all_fs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
glibtop_mountentry *
|
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;
|
struct mount_entry *me, *tmp, *next;
|
||||||
glibtop_mountentry *mount_list;
|
glibtop_mountentry *mount_list;
|
||||||
@@ -601,7 +601,7 @@ glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf)
|
|||||||
|
|
||||||
/* Read filesystem list. */
|
/* Read filesystem list. */
|
||||||
|
|
||||||
me = read_filesystem_list (1, 0);
|
me = read_filesystem_list (1, all_fs);
|
||||||
|
|
||||||
if (me == NULL)
|
if (me == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user