Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat Fix the sysinfo(SI_HW_SERIAL, emulation so that w...



details:   https://anonhg.NetBSD.org/src/rev/dd3a4493b950
branches:  trunk
changeset: 565744:dd3a4493b950
user:      dmcmahill <dmcmahill%NetBSD.org@localhost>
date:      Mon Apr 19 02:55:40 2004 +0000

description:
Fix the sysinfo(SI_HW_SERIAL, emulation so that we actually get the
hostid of the machine rather than always getting "0".  Tested with
hostid(1) from solaris-2.8 and with lmhostid (part of FlexLM) for solaris.
Approved by atatat@.

diffstat:

 sys/compat/svr4/svr4_stat.c       |  7 ++++---
 sys/compat/svr4_32/svr4_32_stat.c |  7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diffs (56 lines):

diff -r a06c0e724b1c -r dd3a4493b950 sys/compat/svr4/svr4_stat.c
--- a/sys/compat/svr4/svr4_stat.c       Mon Apr 19 01:53:21 2004 +0000
+++ b/sys/compat/svr4/svr4_stat.c       Mon Apr 19 02:55:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_stat.c,v 1.50 2003/12/04 19:38:23 atatat Exp $     */
+/*     $NetBSD: svr4_stat.c,v 1.51 2004/04/19 02:55:40 dmcmahill Exp $  */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_stat.c,v 1.50 2003/12/04 19:38:23 atatat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_stat.c,v 1.51 2004/04/19 02:55:40 dmcmahill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -620,7 +620,8 @@
                break;
 
        case SVR4_SI_HW_SERIAL:
-               str = "0";
+               snprintf(buf, sizeof(buf), "%lu", hostid);
+               str = buf;
                break;
 
        case SVR4_SI_HW_PROVIDER:
diff -r a06c0e724b1c -r dd3a4493b950 sys/compat/svr4_32/svr4_32_stat.c
--- a/sys/compat/svr4_32/svr4_32_stat.c Mon Apr 19 01:53:21 2004 +0000
+++ b/sys/compat/svr4_32/svr4_32_stat.c Mon Apr 19 02:55:40 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_32_stat.c,v 1.13 2003/12/04 19:38:23 atatat Exp $  */
+/*     $NetBSD: svr4_32_stat.c,v 1.14 2004/04/19 02:55:40 dmcmahill Exp $       */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_32_stat.c,v 1.13 2003/12/04 19:38:23 atatat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_32_stat.c,v 1.14 2004/04/19 02:55:40 dmcmahill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -641,7 +641,8 @@
                break;
 
        case SVR4_SI_HW_SERIAL:
-               str = "0";
+               snprintf(buf, sizeof(buf), "%lu", hostid);
+               str = buf;
                break;
 
        case SVR4_SI_HW_PROVIDER:



Home | Main Index | Thread Index | Old Index