New file.

1998-07-22  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/mountlist.h: New file.

	* features.def: Added new feature `mountlist'.

	* sysdeps/common/mountlist.c (glibtop_get_mountlist_s): New function.
	(read_filesystem_list): Declared as `static'.
This commit is contained in:
Martin Baulig
1998-07-22 20:52:42 +00:00
committed by Martin Baulig
parent dd5c4a716b
commit 6bf243c901
18 changed files with 392 additions and 75 deletions

View File

@@ -12,9 +12,14 @@ BEGIN {
}
function output(feature) {
orig = feature;
sub(/@/,"",feature);
if (feature ~ /^proclist$/) {
print "unsigned *";
prefix = "return ";
} else if (feature ~ /^mountlist$/) {
print "glibtop_mountentry *";
prefix = "return ";
} else {
prefix = "";
print "void";
@@ -42,7 +47,11 @@ function output(feature) {
print "#if (!GLIBTOP_SUID_"toupper(feature)")";
print "\t\tglibtop_get_"feature"_r (server, buf, pid);";
} else {
if (feature ~ /^proclist$/) {
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 buf);";
} else if (feature ~ /^proclist$/) {
print "\t\treturn glibtop_call_l (server, GLIBTOP_CMND_PROCLIST,";
print "\t\t\t\t 0, NULL, sizeof (glibtop_proclist),";
print "\t\t\t\t buf);";
@@ -51,18 +60,25 @@ function output(feature) {
print "\t\t\t\tsizeof (glibtop_"feature"), buf);";
}
print "\t} else {";
print "#if (!GLIBTOP_SUID_"toupper(feature)")";
print "\t\t"prefix"glibtop_get_"feature"_r (server, buf);";
if (orig ~ /^@/) {
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);";
}
}
if (!(orig ~ /^@/)) {
print "#else";
print "\t\terrno = ENOSYS;";
print "\t\tglibtop_error_io_r (server, \"glibtop_get_"feature"\");";
print "#endif";
}
print "#else";
print "\t\terrno = ENOSYS;";
print "\t\tglibtop_error_io_r (server, \"glibtop_get_"feature"\");";
print "#endif";
print "\t}";
print "}";
print "";
}
/^@(\w+)/ { output($1) }
/^(\w+)/ { output($1) }