From caba4b0b065044add90c04bf641ed89ce819ec7e Mon Sep 17 00:00:00 2001 From: guenther <> Date: Sun, 16 Oct 2011 06:29:56 +0000 Subject: 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@ --- src/lib/libc/include/thread_private.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/libc/include/thread_private.h b/src/lib/libc/include/thread_private.h index 2d8913e482..673fb9c6a6 100644 --- a/src/lib/libc/include/thread_private.h +++ b/src/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 */ @@ -33,6 +33,21 @@ extern int __isthreaded; #define WEAK_PROTOTYPE(name) /* typeof() only in gcc */ #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 */ -- cgit v1.2.3-55-g6feb