unix: add Uvmexp and SysctlUvmexp for NetBSD

NetBSD has both struct uvmexp (used internally) and struct uvmexp_sysctl
(preferred for interfacing from user code). Expose the latter as type
Uvmexp with the same interface as on OpenBSD.

I am not sure if it makes sense to even have a name parameter for
SysctlUvmexp, since the only valid value can be "vm.uvmext2".

Change-Id: I40a743536c28e3fb7a54253768db35b1629fabfe
Reviewed-on: https://go-review.googlesource.com/c/sys/+/460156
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Benny Siegert <bsiegert@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Benny Siegert
2023-01-03 15:36:18 +00:00
committed by Benny Siegert
parent b751db56c7
commit b60007cc4e
7 changed files with 372 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ package unix
#include <sys/un.h>
#include <sys/utsname.h>
#include <sys/wait.h>
#include <uvm/uvm_extern.h>
#include <net/bpf.h>
#include <net/if.h>
#include <net/if_dl.h>
@@ -297,6 +298,12 @@ type Sysctlnode C.struct_sysctlnode
type Utsname C.struct_utsname
// Uvmexp
const SizeofUvmexp = C.sizeof_struct_uvmexp_sysctl
type Uvmexp C.struct_uvmexp_sysctl
// Clockinfo
const SizeofClockinfo = C.sizeof_struct_clockinfo