Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F132946957
D29754.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D29754.diff
View Options
diff --git a/lib/libutil/kinfo_getvmobject.c b/lib/libutil/kinfo_getvmobject.c
--- a/lib/libutil/kinfo_getvmobject.c
+++ b/lib/libutil/kinfo_getvmobject.c
@@ -36,8 +36,8 @@
#include "libutil.h"
-struct kinfo_vmobject *
-kinfo_getvmobject(int *cntp)
+static struct kinfo_vmobject *
+kinfo_getvmobject_impl(int *cntp, const char *vmobjsysctl)
{
char *buf, *bp, *ep;
struct kinfo_vmobject *kvo, *list, *kp;
@@ -46,14 +46,14 @@
buf = NULL;
for (i = 0; i < 3; i++) {
- if (sysctlbyname("vm.objects", NULL, &len, NULL, 0) < 0) {
+ if (sysctlbyname(vmobjsysctl, NULL, &len, NULL, 0) < 0) {
free(buf);
return (NULL);
}
buf = reallocf(buf, len);
if (buf == NULL)
return (NULL);
- if (sysctlbyname("vm.objects", buf, &len, NULL, 0) == 0)
+ if (sysctlbyname(vmobjsysctl, buf, &len, NULL, 0) == 0)
goto unpack;
if (errno != ENOMEM) {
free(buf);
@@ -94,3 +94,15 @@
*cntp = cnt;
return (list);
}
+
+struct kinfo_vmobject *
+kinfo_getvmobject(int *cntp)
+{
+ return (kinfo_getvmobject_impl(cntp, "vm.objects"));
+}
+
+struct kinfo_vmobject *
+kinfo_getswapvmobject(int *cntp)
+{
+ return (kinfo_getvmobject_impl(cntp, "vm.swap_objects"));
+}
diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h
--- a/lib/libutil/libutil.h
+++ b/lib/libutil/libutil.h
@@ -109,6 +109,8 @@
kinfo_getvmmap(pid_t _pid, int *_cntp);
struct kinfo_vmobject *
kinfo_getvmobject(int *_cntp);
+struct kinfo_vmobject *
+ kinfo_getswapvmobject(int *_cntp);
struct kinfo_proc *
kinfo_getallproc(int *_cntp);
struct kinfo_proc *
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 22, 10:15 AM (8 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24053572
Default Alt Text
D29754.diff (1 KB)
Attached To
Mode
D29754: Augment systat(1) -swap to display large swap space processes
Attached
Detach File
Event Timeline
Log In to Comment