summaryrefslogtreecommitdiffstats
path: root/openmp
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2015-09-21 20:29:12 +0000
committerJoerg Sonnenberger <joerg@bec.de>2015-09-21 20:29:12 +0000
commit7649cd4389723896bc56c0fc17d04c7b2d05acb3 (patch)
tree7949f47225cd5764f8ae51ff4e529af14207201c /openmp
parent41681a5329ea53adc2e77f9fbaa6ecd2e908decc (diff)
downloadbcm5719-llvm-7649cd4389723896bc56c0fc17d04c7b2d05acb3.tar.gz
bcm5719-llvm-7649cd4389723896bc56c0fc17d04c7b2d05acb3.zip
Use sysconf for the number of cores on FreeBSD too.
llvm-svn: 248209
Diffstat (limited to 'openmp')
-rw-r--r--openmp/runtime/src/z_Linux_util.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/openmp/runtime/src/z_Linux_util.c b/openmp/runtime/src/z_Linux_util.c
index 0631ab5b197..8992733d7bb 100644
--- a/openmp/runtime/src/z_Linux_util.c
+++ b/openmp/runtime/src/z_Linux_util.c
@@ -51,7 +51,6 @@
# include <sys/sysctl.h>
# include <mach/mach.h>
#elif KMP_OS_FREEBSD
-# include <sys/sysctl.h>
# include <pthread_np.h>
#endif
@@ -2067,7 +2066,7 @@ __kmp_get_xproc( void ) {
int r = 0;
- #if KMP_OS_LINUX || KMP_OS_NETBSD
+ #if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD
r = sysconf( _SC_NPROCESSORS_ONLN );
@@ -2089,16 +2088,6 @@ __kmp_get_xproc( void ) {
KMP_INFORM( AssumedNumCPU );
}; // if
- #elif KMP_OS_FREEBSD
-
- int mib[] = { CTL_HW, HW_NCPU };
- size_t len = sizeof( r );
- if ( sysctl( mib, 2, &r, &len, NULL, 0 ) < 0 ) {
- r = 0;
- KMP_WARNING( CantGetNumAvailCPU );
- KMP_INFORM( AssumedNumCPU );
- }
-
#else
#error "Unknown or unsupported OS."
@@ -2275,7 +2264,7 @@ __kmp_is_address_mapped( void * addr ) {
int found = 0;
int rc;
- #if KMP_OS_LINUX
+ #if KMP_OS_LINUX || KMP_OS_FREEBSD
/*
On Linux* OS, read the /proc/<pid>/maps pseudo-file to get all the address ranges mapped
OpenPOWER on IntegriCloud