Summary: MSVC will never be able to load VDSO, and doesn't even have dlopen, so just return `nullptr`, and let the fallback mechanisms handle it from there.
Closes #282
Reviewed By: @yfeldblum
Differential Revision:
D2307461
Pulled By: @sgolemon
#include <folly/detail/CacheLocality.h>
+#ifndef _MSC_VER
#define _GNU_SOURCE 1 // for RTLD_NOLOAD
#include <dlfcn.h>
+#endif
#include <fstream>
#include <folly/Conv.h>
/// Resolves the dynamically loaded symbol __vdso_getcpu, returning null
/// on failure
static Getcpu::Func loadVdsoGetcpu() {
+#ifdef _MSC_VER
+ return nullptr;
+#else
void* h = dlopen("linux-vdso.so.1", RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
if (h == nullptr) {
return nullptr;
}
return func;
+#endif
}
Getcpu::Func Getcpu::vdsoFunc() {