diff options
author | 2011-10-16 06:29:56 +0000 | |
---|---|---|
committer | 2011-10-16 06:29:56 +0000 | |
commit | aaac0abe0a28be3acaaffdc7761bba18f946236b (patch) | |
tree | af437155ae30404f4283a857602a300c56507ec8 /lib/libc/include | |
parent | Add stubs and manpage for __{get,set}_tcb (diff) | |
download | wireguard-openbsd-aaac0abe0a28be3acaaffdc7761bba18f946236b.tar.xz wireguard-openbsd-aaac0abe0a28be3acaaffdc7761bba18f946236b.zip |
Make consistent the syscall stubs for the syscalls that got special
handling to fix up the alignment of 64bit arguments so that they do
the same dance where _thread_sys_FOO is the real stub and FOO is a
weak alias. For some of them, this is needed for cancellation handling.
From discussions with fgsch@, ok millert@
Diffstat (limited to 'lib/libc/include')
-rw-r--r-- | lib/libc/include/thread_private.h | 17 |
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) |