Add kern.hostuuid sysctl, which will be used to keep host's UUID.
Reviewed by: mlaier, rink, brooks, rwatson
This commit is contained in:
parent
0c6b66bd70
commit
82068fe7a9
@ -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
|
||||
|
@ -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];
|
||||
|
@ -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 }, \
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user