aboutsummaryrefslogtreecommitdiff
path: root/src/actual.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/actual.h')
-rw-r--r--src/actual.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/actual.h b/src/actual.h
index cb08d42..a860590 100644
--- a/src/actual.h
+++ b/src/actual.h
@@ -1,10 +1,10 @@
+#ifndef CHANGE_SRC_ACTUAL_FUNCTION_H_
+#define CHANGE_SRC_ACTUAL_FUNCTION_H_
+
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
-#ifndef CHANGE_SRC_ACTUAL_FUNCTION_H_
-#define CHANGE_SRC_ACTUAL_FUNCTION_H_
-
#include <dlfcn.h>
#include <sys/mman.h>
#include <sys/uio.h>
@@ -12,6 +12,8 @@
#include <memory>
#include <cstring>
+#include "init/alloc.h"
+
namespace actual {
template <class Result, typename... Arguments>
@@ -19,6 +21,8 @@ using ptr = Result(*)(Arguments...);
template <typename FunctionPtr>
FunctionPtr get_ptr(const std::string& symbol_name) {
+ init::dlsymContext guard;
+
const void* symbol_address{ dlsym(RTLD_NEXT, symbol_name.c_str()) };
FunctionPtr actual_function{};