Index: lib/tsan/tests/rtl/tsan_test_util_linux.cc =================================================================== --- lib/tsan/tests/rtl/tsan_test_util_linux.cc +++ lib/tsan/tests/rtl/tsan_test_util_linux.cc @@ -263,9 +263,14 @@ } } CHECK_NE(tsan_mop, 0); - errno = ECHRNG; +#if defined(__FreeBSD__) + const int ErrCode = ESOCKTNOSUPPORT; +#else + const int ErrCode = ECHRNG; +#endif + errno = ErrCode; tsan_mop(ev->ptr); - CHECK_EQ(errno, ECHRNG); // In no case must errno be changed. + CHECK_EQ(errno, ErrCode); // In no case must errno be changed. break; } case Event::VPTR_UPDATE: