Skip to content

Commit 44089c2

Browse files
authored
[compiler-rt] intercept sched_getaffinity on freebsd. (llvm#76509)
freebsd releases up to 13.1 are eol and sched_getaffinity wrapper is available since 13.1.
1 parent 6cd41dd commit 44089c2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compiler-rt/lib/msan/tests/msan_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3241,7 +3241,7 @@ TEST(MemorySanitizer, dlopenFailed) {
32413241

32423242
#endif // MSAN_TEST_DISABLE_DLOPEN
32433243

3244-
#if !defined(__FreeBSD__) && !defined(__NetBSD__)
3244+
#if !defined(__NetBSD__)
32453245
TEST(MemorySanitizer, sched_getaffinity) {
32463246
cpu_set_t mask;
32473247
if (sched_getaffinity(getpid(), sizeof(mask), &mask) == 0)

compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@
301301
#define SANITIZER_INTERCEPT_CANONICALIZE_FILE_NAME (SI_GLIBC || SI_SOLARIS)
302302
#define SANITIZER_INTERCEPT_CONFSTR \
303303
(SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID || SI_SOLARIS)
304-
#define SANITIZER_INTERCEPT_SCHED_GETAFFINITY SI_LINUX_NOT_ANDROID
304+
#define SANITIZER_INTERCEPT_SCHED_GETAFFINITY \
305+
(SI_LINUX_NOT_ANDROID || SI_FREEBSD)
305306
#define SANITIZER_INTERCEPT_SCHED_GETPARAM SI_LINUX_NOT_ANDROID || SI_SOLARIS
306307
#define SANITIZER_INTERCEPT_STRERROR SI_POSIX
307308
#define SANITIZER_INTERCEPT_STRERROR_R SI_POSIX

0 commit comments

Comments
 (0)