From owner-svn-src-stable-9@FreeBSD.ORG Thu Jul 5 15:38:33 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FDAA1065703; Thu, 5 Jul 2012 15:38:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19D728FC1E; Thu, 5 Jul 2012 15:38:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q65FcWOZ081636; Thu, 5 Jul 2012 15:38:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q65FcWGA081633; Thu, 5 Jul 2012 15:38:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207051538.q65FcWGA081633@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 5 Jul 2012 15:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238136 - stable/9/lib/libc/gen X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2012 15:38:33 -0000 Author: kib Date: Thu Jul 5 15:38:32 2012 New Revision: 238136 URL: http://svn.freebsd.org/changeset/base/238136 Log: MFC r237660: Optimize the handling of SC_NPROCESSORS_CONF, by using auxv AT_NCPU value if present. Approved by: re (kensmith) Modified: stable/9/lib/libc/gen/sysconf.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/sysconf.c ============================================================================== --- stable/9/lib/libc/gen/sysconf.c Thu Jul 5 15:37:17 2012 (r238135) +++ stable/9/lib/libc/gen/sysconf.c Thu Jul 5 15:38:32 2012 (r238136) @@ -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;