Skip to content

Commit 326d394

Browse files
authored
Add get_num_procs implementation for AIX
(and copy HAIKU implementation to the non-TLS version of the code as well)
1 parent 76a66ea commit 326d394

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

driver/others/memory.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,16 @@ int get_num_procs(void) {
259259
}
260260
#endif
261261

262+
#ifdef OS_AIX
263+
int get_num_procs(void) {
264+
static int nums = 0;
265+
if (!nums) nums = sysconf(_SC_NPROCESSORS_CONF);
266+
return nums;
267+
}
268+
#endif
269+
270+
271+
262272
#ifdef OS_WINDOWS
263273

264274
int get_num_procs(void) {
@@ -1738,6 +1748,22 @@ int get_num_procs(void) {
17381748
return nums;
17391749
}
17401750
#endif
1751+
1752+
#ifdef OS_HAIKU
1753+
int get_num_procs(void) {
1754+
static int nums = 0;
1755+
if (!nums) nums = sysconf(_SC_NPROCESSORS_CONF);
1756+
return nums;
1757+
}
1758+
#endif
1759+
1760+
#ifdef OS_AIX
1761+
int get_num_procs(void) {
1762+
static int nums = 0;
1763+
if (!nums) nums = sysconf(_SC_NPROCESSORS_CONF);
1764+
return nums;
1765+
}
1766+
#endif
17411767

17421768
#ifdef OS_WINDOWS
17431769

0 commit comments

Comments
 (0)