From owner-svn-src-head@FreeBSD.ORG Fri May 29 06:19:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC572106566B; Fri, 29 May 2009 06:19:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAE5D8FC13; Fri, 29 May 2009 06:19:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4T6Jbug061754; Fri, 29 May 2009 06:19:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4T6JbIg061753; Fri, 29 May 2009 06:19:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200905290619.n4T6JbIg061753@svn.freebsd.org> From: Xin LI Date: Fri, 29 May 2009 06:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193016 - head/sys/compat/svr4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2009 06:19:38 -0000 Author: delphij Date: Fri May 29 06:19:37 2009 New Revision: 193016 URL: http://svn.freebsd.org/changeset/base/193016 Log: 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" Obtained from: NetBSD Modified: head/sys/compat/svr4/svr4_stat.c Modified: head/sys/compat/svr4/svr4_stat.c ============================================================================== --- head/sys/compat/svr4/svr4_stat.c Fri May 29 06:04:26 2009 (r193015) +++ head/sys/compat/svr4/svr4_stat.c Fri May 29 06:19:37 2009 (r193016) @@ -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: