Rombobjörn

summaryrefslogtreecommitdiff
path: root/thread_wrapper/pthread_create_locator.c
diff options
context:
space:
mode:
authorBjörn Persson <bjorn@rombobjörn.se>2013-01-16 23:40:05 +0100
committerBjörn Persson <bjorn@rombobjörn.se>2013-01-16 23:40:05 +0100
commitab689196c9623c238cd7e3919be209001a37dc2a (patch)
treeb356d7350dd5273d13d380406f633a56a254901a /thread_wrapper/pthread_create_locator.c
parent526920ed5abdc31c4135fb34fcb617b3cf9320c3 (diff)
Added the thread wrapper module.
Diffstat (limited to 'thread_wrapper/pthread_create_locator.c')
-rw-r--r--thread_wrapper/pthread_create_locator.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/thread_wrapper/pthread_create_locator.c b/thread_wrapper/pthread_create_locator.c
new file mode 100644
index 0000000..df5eef7
--- /dev/null
+++ b/thread_wrapper/pthread_create_locator.c
@@ -0,0 +1,22 @@
+// Ada Milter API thread wrapper
+// Copyright 2013 B. Persson, Bjorn@Rombobeorn.se
+//
+// This library is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License version 3, as published
+// by the Free Software Foundation.
+
+
+// _GNU_SOURCE must be defined to make RTLD_NEXT available. Keeping this in a
+// separate file avoids any surprising effects that _GNU_SOURCE might have on
+// other header files that thread_wrapper.c includes.
+
+
+#include "pthread_create_locator.h"
+
+#define _GNU_SOURCE
+#include <dlfcn.h>
+
+
+void* dlsym_next_pthread_create() {
+ return dlsym(RTLD_NEXT, "pthread_create");
+}