diff options
author | 2017-05-04 10:44:03 -0700 | |
---|---|---|
committer | 2017-05-04 10:44:03 -0700 | |
commit | c2ad372d43c1fd31d9e9dabb8a5481c641b9a81a (patch) | |
tree | 052dbd8af8d4d0b0f296185a329ad2336ca3db83 /src/core/lib/support/cpu_linux.c | |
parent | cbecd7260995383537bd63e91bf53939ddb6e3bf (diff) | |
parent | 46758c39101395a757a7883b4e8108b39193cafb (diff) |
Merge pull request #10912 from dgquintas/trying-to-fix-stuff
Upmerge from 1.3.0 to master
Diffstat (limited to 'src/core/lib/support/cpu_linux.c')
-rw-r--r-- | src/core/lib/support/cpu_linux.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/lib/support/cpu_linux.c b/src/core/lib/support/cpu_linux.c index 1e50f59823..b826dde160 100644 --- a/src/core/lib/support/cpu_linux.c +++ b/src/core/lib/support/cpu_linux.c @@ -67,16 +67,16 @@ unsigned gpr_cpu_num_cores(void) { } unsigned gpr_cpu_current_cpu(void) { -#ifdef __GLIBC__ +#ifdef GPR_MUSL_LIBC_COMPAT + // sched_getcpu() is undefined on musl + return 0; +#else int cpu = sched_getcpu(); if (cpu < 0) { gpr_log(GPR_ERROR, "Error determining current CPU: %s\n", strerror(errno)); return 0; } return (unsigned)cpu; -#else - // sched_getcpu() is undefined on musl - return 0; #endif } |