diff options
author | jkoshy <jkoshy@FreeBSD.org> | 2001-12-01 12:07:42 +0000 |
---|---|---|
committer | jkoshy <jkoshy@FreeBSD.org> | 2001-12-01 12:07:42 +0000 |
commit | 91903d036d9c96b55563a3ecb11525b5a3ddbf37 (patch) | |
tree | 9e51e74dbead2bdf793d0191265d6f721969553e /lib/libc/gen/sysconf.c | |
parent | c0aedffa21d0ffdb2d72beed00e2551bacca7927 (diff) | |
download | FreeBSD-src-91903d036d9c96b55563a3ecb11525b5a3ddbf37.zip FreeBSD-src-91903d036d9c96b55563a3ecb11525b5a3ddbf37.tar.gz |
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)
Diffstat (limited to 'lib/libc/gen/sysconf.c')
-rw-r--r-- | lib/libc/gen/sysconf.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index 5be1f3b..1aa761d 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -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; |