From owner-freebsd-bugs Sun May 20 23:30: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B614237B43E for ; Sun, 20 May 2001 23:30:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f4L6U1B55313; Sun, 20 May 2001 23:30:01 -0700 (PDT) (envelope-from gnats) Received: from falcon.mail.pas.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by hub.freebsd.org (Postfix) with ESMTP id 611EC37B424 for ; Sun, 20 May 2001 23:25:35 -0700 (PDT) (envelope-from adsharma@sharmas.dhs.org) Received: from sharmas.dhs.org (cpe-66-1-147-119.ca.sprintbbd.net [66.1.147.119]) by falcon.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id XAA11124 for ; Sun, 20 May 2001 23:25:17 -0700 (PDT) Received: (from adsharma@localhost) by sharmas.dhs.org (8.11.3/8.11.3) id f4L6IhV47375; Sun, 20 May 2001 23:18:43 -0700 (PDT) (envelope-from adsharma) Message-Id: <200105210618.f4L6IhV47375@sharmas.dhs.org> Date: Sun, 20 May 2001 23:18:43 -0700 (PDT) From: arun@sharmas.dhs.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/27489: _SC_NPROCESSORS_CONF Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 27489 >Category: bin >Synopsis: patch for feature sysconf(_SC_NPROCESSORS_CONF) >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun May 20 23:30:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Arun Sharma >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD astra.mirabella.net 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Fri May 11 21:53:58 PDT 2001 root@astra:/usr.current/src/sys/compile/astra i386 >Description: >How-To-Repeat: >Fix: --- lib/libc/gen/sysconf.c- Sun May 20 22:09:14 2001 +++ lib/libc/gen/sysconf.c Sun May 20 22:11:05 2001 @@ -284,6 +284,10 @@ mib[1] = CTL_P1003_1B_TIMER_MAX; goto yesno; #endif /* _P1003_1B_VISIBLE */ + case _SC_NPROCESSORS_CONF: + mib[0] = CTL_HW; + mib[1] = HW_NCPU; + goto yesno; yesno: if (sysctl(mib, 2, &value, &len, NULL, 0) == -1) return (-1); --- lib/libc/gen/sysconf.3- Sun May 20 22:24:28 2001 +++ lib/libc/gen/sysconf.3 Sun May 20 22:26:48 2001 @@ -151,6 +151,8 @@ .It Li _SC_2_UPE Return 1 if the system supports the User Portability Utilities Option, otherwise \-1. +.It Li _SC_NPROCESSORS_CONF +Returns the number of processors in the system. .El .Sh RETURN VALUES If the call to --- sys/sys/unistd.h- Sun May 20 22:08:11 2001 +++ sys/sys/unistd.h Sun May 20 22:08:48 2001 @@ -190,6 +190,8 @@ #define _SC_SEM_VALUE_MAX 50 #define _SC_SIGQUEUE_MAX 51 #define _SC_TIMER_MAX 52 +#define _SC_NPROCESSORS_CONF 53 + /* POSIX.1B pathconf and fpathconf options */ #define _PC_ASYNC_IO 53 >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message