summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-08-07 03:17:03 -0400
committerIan Moffett <ian@osmora.org>2025-08-07 03:22:03 -0400
commit06f1fb09a830b89da5854eb6f5b1b5d4c8a7f41c (patch)
tree4595927830a015267a3abf51f569b4de79d601e4 /sys/kern
parent1f3d3c11c94ef1ba7bf1e6bd28743067c3861099 (diff)
kernel: sysctl: Add 'hw.machine' variable
Introduce the 'hw.machine' sysctl variable to represent the current machine architecture. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sysctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 9b3d301..a4c16bb 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -41,6 +41,7 @@
HYRA_BUILDDATE
static uint32_t pagesize = DEFAULT_PAGESIZE;
+static char machine[] = HYRA_ARCH;
static char hyra[] = "Hyra";
static char hyra_version[] = HYRA_VERSION;
static char osrelease[] = HYRA_RELEASE;
@@ -60,7 +61,8 @@ static struct sysctl_entry common_optab[] = {
/* 'hw.*' */
[HW_PAGESIZE] = { HW_PAGESIZE, SYSCTL_OPTYPE_INT_RO, &pagesize },
- [HW_NCPU] = { HW_NCPU, SYSCTL_OPTYPE_INT, NULL }
+ [HW_NCPU] = { HW_NCPU, SYSCTL_OPTYPE_INT, NULL },
+ [HW_MACHINE] = {HW_MACHINE, SYSCTL_OPTYPE_STR_RO, &machine }
};
static int