diff options
-rw-r--r-- | sys/kern/kern_mib.c | 3 | ||||
-rw-r--r-- | sys/sys/kernel.h | 1 | ||||
-rw-r--r-- | sys/sys/sysctl.h | 4 |
3 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index 16755d4..0a5220d 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -301,6 +301,9 @@ SYSCTL_STRING(_kern, KERN_NISDOMAINNAME, domainname, CTLFLAG_RW, u_long hostid; SYSCTL_ULONG(_kern, KERN_HOSTID, hostid, CTLFLAG_RW, &hostid, 0, "Host ID"); +char hostuuid[64] = "00000000-0000-0000-0000-000000000000"; +SYSCTL_STRING(_kern, KERN_HOSTUUID, hostuuid, CTLFLAG_RW, hostuuid, + sizeof(hostuuid), "Host UUID"); /* * This is really cheating. These actually live in the libc, something diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index 92ceeb2..ff38d8f 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -56,6 +56,7 @@ /* 1.1 */ extern unsigned long hostid; +extern char *hostuuid; extern char hostname[MAXHOSTNAMELEN]; extern char domainname[MAXHOSTNAMELEN]; extern char kernelname[MAXPATHLEN]; diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index ef96c81..d56359b 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -389,7 +389,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #define KERN_USRSTACK 33 /* int: address of USRSTACK */ #define KERN_LOGSIGEXIT 34 /* int: do we log sigexit procs? */ #define KERN_IOV_MAX 35 /* int: value of UIO_MAXIOV */ -#define KERN_MAXID 36 /* number of valid kern ids */ +#define KERN_HOSTUUID 36 /* string: host UUID identifier */ +#define KERN_MAXID 37 /* number of valid kern ids */ #define CTL_KERN_NAMES { \ { 0, 0 }, \ @@ -427,6 +428,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); { "usrstack", CTLTYPE_INT }, \ { "logsigexit", CTLTYPE_INT }, \ { "iov_max", CTLTYPE_INT }, \ + { "hostuuid", CTLTYPE_STRING }, \ } /* |