summaryrefslogtreecommitdiffstats
path: root/sys/compat/svr4
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-05-29 06:19:37 +0000
committerdelphij <delphij@FreeBSD.org>2009-05-29 06:19:37 +0000
commit10c7a249405a9dc8480c4ca23b6a36d4779d521f (patch)
treee093d1ab1e10d3636f594fcae93c0ee092cfac6c /sys/compat/svr4
parent0339972dd9c7ded02b0fb954b499fd942b918cad (diff)
downloadFreeBSD-src-10c7a249405a9dc8480c4ca23b6a36d4779d521f.zip
FreeBSD-src-10c7a249405a9dc8480c4ca23b6a36d4779d521f.tar.gz
Fix the sysinfo(SI_HW_SERIAL, emulation so that we actually get the
hostid of the machine rather than always getting "0". PR: kern/91293 Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD
Diffstat (limited to 'sys/compat/svr4')
-rw-r--r--sys/compat/svr4/svr4_stat.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c
index e7401a87..81a37f5 100644
--- a/sys/compat/svr4/svr4_stat.c
+++ b/sys/compat/svr4/svr4_stat.c
@@ -417,9 +417,10 @@ svr4_sys_systeminfo(td, uap)
int error = 0;
register_t *retval = td->td_retval;
size_t len = 0;
- char buf[1]; /* XXX NetBSD uses 256, but that seems
- like awfully excessive kstack usage
- for an empty string... */
+ char buf[11]; /* XXX NetBSD uses 256, but we use 11
+ here as that seems like awfully
+ excessive kstack usage for hostid
+ string... */
u_int rlen = uap->len;
switch (uap->what) {
@@ -448,7 +449,8 @@ svr4_sys_systeminfo(td, uap)
break;
case SVR4_SI_HW_SERIAL:
- str = "0";
+ snprintf(buf, sizeof(buf), "%lu", hostid);
+ str = buf;
break;
case SVR4_SI_HW_PROVIDER:
OpenPOWER on IntegriCloud