Skip to content

Commit 9d6eeea

Browse files
authored
Merge pull request #4513 from ChipKerchner/fixNumCoresAIX
Fix get_num_cores for AIX.
2 parents 99ef76f + bf23104 commit 9d6eeea

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

getarch.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9090
#include <sys/sysinfo.h>
9191
#include <unistd.h>
9292
#endif
93-
#if defined(AIX)
93+
#if defined(_AIX)
94+
#include <unistd.h>
95+
#include <sys/systemcfg.h>
9496
#include <sys/sysinfo.h>
9597
#endif
9698

@@ -1870,11 +1872,13 @@ static int get_num_cores(void) {
18701872

18711873
return count;
18721874

1873-
#elif defined(AIX)
1875+
#elif defined(_AIX)
18741876
//returns the number of processors which are currently online
18751877
count = sysconf(_SC_NPROCESSORS_ONLN);
18761878
if (count <= 0) count = 2;
1877-
1879+
1880+
return count;
1881+
18781882
#else
18791883
return 2;
18801884
#endif

0 commit comments

Comments
 (0)