Add support for sysconf(_SC_NPROCESSORS_CONF) and sysconf(_SC_NPROCESSORS_ONLN).
This API is supported in SVR4.0MP, Solaris, Linux, AIX and Tru64 Unix. PR: bin/27489 Submitted by: Arun Sharma <arun@sharma-home.net> Reviewed by: bde (prior version)
This commit is contained in:
parent
4f25b0aa46
commit
4d44f0b5a3
@ -83,6 +83,10 @@ and
|
||||
.Xr sendmsg 2 .
|
||||
.It Li _SC_NGROUPS_MAX
|
||||
The maximum number of supplemental groups.
|
||||
.It Li _SC_NPROCESSORS_CONF
|
||||
The number of processors configured.
|
||||
.It Li _SC_NPROCESSORS_ONLN
|
||||
The number of processors currently online.
|
||||
.It Li _SC_OPEN_MAX
|
||||
The maximum number of open files per user id.
|
||||
.It Li _SC_STREAM_MAX
|
||||
|
@ -290,6 +290,14 @@ sysconf(name)
|
||||
goto yesno;
|
||||
#endif /* _P1003_1B_VISIBLE */
|
||||
|
||||
#if defined(_SC_NPROCESSORS_CONF) && defined(_SC_NPROCESSORS_ONLN)
|
||||
case _SC_NPROCESSORS_CONF:
|
||||
case _SC_NPROCESSORS_ONLN:
|
||||
mib[0] = CTL_HW;
|
||||
mib[1] = HW_NCPU;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef _SC_IOV_MAX
|
||||
case _SC_IOV_MAX:
|
||||
mib[0] = CTL_KERN;
|
||||
|
@ -201,6 +201,11 @@
|
||||
#define _SC_IOV_MAX 56
|
||||
|
||||
#ifndef _POSIX_SOURCE
|
||||
|
||||
/* Linux/Solaris/AIX/SVR4.0MP API */
|
||||
#define _SC_NPROCESSORS_CONF 57
|
||||
#define _SC_NPROCESSORS_ONLN 58
|
||||
|
||||
/*
|
||||
* rfork() options.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user