19 #include <sys/utsname.h>
31 #if (defined(__GNUC__) || defined(__clang__)) && !defined(__MINGW32__) && !defined(__MINGW64__)
32 #define KVIKIO_EXPORT __attribute__((visibility("default")))
33 #define KVIKIO_HIDDEN __attribute__((visibility("hidden")))
39 #define KVIKIO_STRINGIFY_DETAIL(x) #x
40 #define KVIKIO_STRINGIFY(x) KVIKIO_STRINGIFY_DETAIL(x)
48 void* load_library(std::string
const& name,
int mode = RTLD_LAZY | RTLD_LOCAL | RTLD_NODELETE);
56 void* load_library(std::vector<std::string>
const& names,
57 int mode = RTLD_LAZY | RTLD_LOCAL | RTLD_NODELETE);
68 void get_symbol(T& handle,
void* lib, std::string
const& name)
72 handle =
reinterpret_cast<T
>(::dlsym(lib, name.c_str()));
73 const char* err = ::dlerror();
74 if (err !=
nullptr) {
throw std::runtime_error(err); }
84 [[nodiscard]]
bool is_running_in_wsl() noexcept;
95 [[nodiscard]]
bool run_udev_readable() noexcept;