KINFO_GETVMOBJECT(3)
hii bestie π welcome to the KINFO_GETVMOBJECT(3) page β yep, the Library Functions Manual one. we're talking system-wide memory info, and it's lowkey iconic. no cap. π«Ά
πΈ NAME πΈ
kinfo_getvmobject β the function for getting system-wide memory information, bestie. it's giving "show me the memory objects" energy. β¨
π LIBRARY π
System Utilities Library (libutil, -lutil). yes, that's the one. π
β¨ SYNOPSIS β¨
include these headers, then call it like this:
#include <sys/types.h>
#include <sys/user.h>
#include <libutil.h>
struct kinfo_vmobject *
kinfo_getvmobject(int *cntp);
π¦ DESCRIPTION π¦
okay so this function is how you obtain information about the objects that are using memory in the system. literally its whole job. π
The cntp argument is the little counter receipt β it lets the caller know how many records are returned. π§Ύ
It's a wrapper around the vm.objects sysctl(3) MIB. the kernel returns a packed structure, but this function expands the data into a fixed record format. so you get the fixed record vibe instead of the packed chaos. π₯
π RETURN VALUES π
On success, kinfo_getvmobject() returns a pointer to an array of struct kinfo_vmobject structures as defined by <sys/user.h>. π
That array is allocated by an internal call to malloc(3), and you β yes, the caller β must free it with a call to free(3). do not forget, bestie β it's your job to free it. π
On failure, kinfo_getvmobject() returns NULL. π
π SEE ALSO π
go read these too, bestie:
π HISTORY π
kinfo_getvmobject() first appeared in FreeBSD 10.2. periodt. π
and that's the page, bestie π source/version: Debian, dated May 20, 2020. slay. β¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2015 John Baldwin <jhb@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms