authorgravatar for devnexen@gmail.comDavid Carlier <devnexen@gmail.com> 2023-05-08 22:51:02+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-05-10 01:48:35+03:00
log52606572309f843c043123c1f2771829e45b4b5d
tree049f798ca78dae6790d700904aa688a92acde153
parent10a7cf58c1530e004e5ccb1a81f02aa86ab51dd1

std.c: add freebsd's kinfo_vmobject


1 files changed, 25 insertions(+), 0 deletions(-)

lib/std/c/freebsd.zig+25
......@@ -64,6 +64,8 @@ pub extern "c" fn getpid() pid_t;
6464pub extern "c" fn kinfo_getfile(pid: pid_t, cntp: *c_int) ?[*]kinfo_file;
6565pub extern "c" fn kinfo_getvmmap(pid: pid_t, cntp: *c_int) ?[*]kinfo_vmentry;
6666pub extern "c" fn kinfo_getproc(pid: pid_t) ?[*]kinfo_proc;
67pub extern "c" fn kinfo_getvmobject(cntp: *c_int) ?[*]kinfo_vmobject;
68pub extern "c" fn kinfo_getswapvmobject(cntp: *c_int) ?[*]kinfo_vmobject;
6769
6870pub extern "c" fn cpuset_getaffinity(level: cpulevel_t, which: cpuwhich_t, id: id_t, setsize: usize, mask: *cpuset_t) c_int;
6971pub extern "c" fn cpuset_setaffinity(level: cpulevel_t, which: cpuwhich_t, id: id_t, setsize: usize, mask: *const cpuset_t) c_int;
......@@ -861,6 +863,29 @@ comptime {
861863 assert(@sizeOf(kinfo_proc) == KINFO_PROC_SIZE);
862864}
863865
866pub const kinfo_vmobject = extern struct {
867 structsize: c_int,
868 tpe: c_int,
869 size: u64,
870 vn_fileid: u64,
871 vn_fsid_freebsd11: u32,
872 ref_count: c_int,
873 shadow_count: c_int,
874 memattr: c_int,
875 resident: u64,
876 active: u64,
877 inactive: u64,
878 type_spec: extern union {
879 _vn_fsid: u64,
880 _backing_obj: u64,
881 },
882 me: u64,
883 _qspare: [6]u64,
884 swapped: u32,
885 _ispare: [7]u32,
886 path: [PATH_MAX]u8,
887};
888
864889pub const CTL = struct {
865890 pub const KERN = 1;
866891 pub const DEBUG = 5;