summaryrefslogtreecommitdiffstats
path: root/lib/libc/include/thread_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/include/thread_private.h')
-rw-r--r--lib/libc/include/thread_private.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/libc/include/thread_private.h b/lib/libc/include/thread_private.h
index 2d8913e482a..673fb9c6a69 100644
--- a/lib/libc/include/thread_private.h
+++ b/lib/libc/include/thread_private.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: thread_private.h,v 1.24 2008/06/14 15:43:43 otto Exp $ */
+/* $OpenBSD: thread_private.h,v 1.25 2011/10/16 06:29:56 guenther Exp $ */
/* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */
@@ -34,6 +34,21 @@ extern int __isthreaded;
#endif
/*
+ * Ditto for hand-written syscall stubs:
+ *
+ * Use STUB_NAME(n) to get the strong name of the stub: _thread_sys_n
+ * STUB_ALIAS(n) to generate the weak symbol n pointing to _thread_sys_n,
+ * STUB_PROTOTYPE(n) to generate a prototype for _thread_sys_n (based on n).
+ */
+#define STUB_NAME(name) __CONCAT(_thread_sys_,name)
+#define STUB_ALIAS(name) __weak_alias(name, STUB_NAME(name))
+#ifdef __GNUC__
+#define STUB_PROTOTYPE(name) __typeof__(name) STUB_NAME(name)
+#else
+#define STUB_PROTOTYPE(name) /* typeof() only in gcc */
+#endif
+
+/*
* helper macro to make unique names in the thread namespace
*/
#define __THREAD_NAME(name) __CONCAT(_thread_tagname_,name)