zos: implement uv_available_parallelism() (#3650)
Implement uv_available_parallelism() for z/OS by reporting the number of online cpu using __get_num_online_cpus() from ZOSLIB.
This commit is contained in:
parent
8bcd689c04
commit
0b1c752b5c
@ -81,7 +81,8 @@ extern char** environ;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__MVS__)
|
#if defined(__MVS__)
|
||||||
#include <sys/ioctl.h>
|
# include <sys/ioctl.h>
|
||||||
|
# include "zos-sys-info.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
@ -1647,7 +1648,13 @@ unsigned int uv_available_parallelism(void) {
|
|||||||
|
|
||||||
return (unsigned) rc;
|
return (unsigned) rc;
|
||||||
#elif defined(__MVS__)
|
#elif defined(__MVS__)
|
||||||
return 1; /* TODO(bnoordhuis) Read from CSD_NUMBER_ONLINE_CPUS? */
|
int rc;
|
||||||
|
|
||||||
|
rc = __get_num_online_cpus();
|
||||||
|
if (rc < 1)
|
||||||
|
rc = 1;
|
||||||
|
|
||||||
|
return (unsigned) rc;
|
||||||
#else /* __linux__ */
|
#else /* __linux__ */
|
||||||
long rc;
|
long rc;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user