[scudo][standalone] Allow sched_getaffinity to fail
authorKostya Kortchinsky <kostyak@google.com>
Mon, 20 Jan 2020 17:50:22 +0000 (09:50 -0800)
committerKostya Kortchinsky <kostyak@google.com>
Tue, 21 Jan 2020 19:18:18 +0000 (11:18 -0800)
commit561fa844777c1bd9c0c6937be272e6ea73ff94f6
treebb185d32a619c6df2bdcd217e7aee81e82b83e82
parent3ef169e586f4d14efe690c23c878d5aa92a80eb5
[scudo][standalone] Allow sched_getaffinity to fail

Summary:
In some configuration, `sched_getaffinity` can fail. Some reasons for
that being the lack of `CAP_SYS_NICE` capability or some syscall
filtering and so on.

This should not be fatal to the allocator, so in this situation, we
will fallback to the `MaxTSDCount` value specified in the allocator
configuration.

Reviewers: cferris, eugenis, hctim, morehouse, pcc

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D73055
compiler-rt/lib/scudo/standalone/common.h
compiler-rt/lib/scudo/standalone/linux.cpp
compiler-rt/lib/scudo/standalone/tsd_shared.h