Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 May 2001 23:18:43 -0700 (PDT)
From:      arun@sharmas.dhs.org
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/27489: _SC_NPROCESSORS_CONF
Message-ID:  <200105210618.f4L6IhV47375@sharmas.dhs.org>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105210618.f4L6IhV47375>