From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 01:52:15 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CBC2106564A; Thu, 28 Jun 2012 01:52:15 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 554788FC0A; Thu, 28 Jun 2012 01:52:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q5S1qDoo024638; Thu, 28 Jun 2012 01:52:13 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4FEBB8C9.8070006@gmail.com> Date: Thu, 28 Jun 2012 09:52:09 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Konstantin Belousov References: <201206272032.q5RKWjvt031174@svn.freebsd.org> In-Reply-To: <201206272032.q5RKWjvt031174@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r237660 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 01:52:15 -0000 On 2012/6/28 4:32, Konstantin Belousov wrote: > Author: kib > Date: Wed Jun 27 20:32:45 2012 > New Revision: 237660 > URL: http://svn.freebsd.org/changeset/base/237660 > > Log: > Optimize the handling of SC_NPROCESSORS_CONF, by using auxv AT_NCPU > value if present. > > MFC after: 1 week > > Modified: > head/lib/libc/gen/sysconf.c > > Modified: head/lib/libc/gen/sysconf.c > ============================================================================== > --- head/lib/libc/gen/sysconf.c Wed Jun 27 20:24:25 2012 (r237659) > +++ head/lib/libc/gen/sysconf.c Wed Jun 27 20:32:45 2012 (r237660) > @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include > #include > #include > #include > @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); > > #include "../stdlib/atexit.h" > #include "tzfile.h" /* from ../../../contrib/tzcode/stdtime */ > +#include "libc_private.h" > > #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ > > @@ -585,6 +587,8 @@ yesno: > > case _SC_NPROCESSORS_CONF: > case _SC_NPROCESSORS_ONLN: > + if (_elf_aux_info(AT_NCPUS,&value, sizeof(value)) == 0) > + return ((long)value); > mib[0] = CTL_HW; > mib[1] = HW_NCPU; > break; > Will this make controlling the number of CPU online or CPU hotplug be impossible on FreeBSD ? Regards, David Xu