summaryrefslogtreecommitdiffstats
path: root/lib/libc/include/namespace.h
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2016-05-07 19:05:21 +0000
committerguenther <guenther@openbsd.org>2016-05-07 19:05:21 +0000
commitfe38b55cb0aae270de3f844146814682e8cd345c (patch)
tree9825cc8aa96314e8e79ea1802ccbc9349772680b /lib/libc/include/namespace.h
parentImplement ACPI 5.0 GeneralPurposeIo OpRegion support. This basically allows (diff)
downloadwireguard-openbsd-fe38b55cb0aae270de3f844146814682e8cd345c.tar.xz
wireguard-openbsd-fe38b55cb0aae270de3f844146814682e8cd345c.zip
Use a Thread Information Block in both single and multi-threaded programs.
This stores errno, the cancelation flags, and related bits for each thread and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable! Make libpthread dlopen'able by moving the cancelation wrappers into libc and doing locking and fork/errno handling via callbacks that libpthread registers when it first initializes. 'errno' *must* be declared via <errno.h> now! Clean up libpthread's symbol exports like libc. On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec. Testing by various, particularly sthen@ and patrick@ ok kettenis@
Diffstat (limited to 'lib/libc/include/namespace.h')
-rw-r--r--lib/libc/include/namespace.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h
index 16d524f666f..980c1a8dd61 100644
--- a/lib/libc/include/namespace.h
+++ b/lib/libc/include/namespace.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: namespace.h,v 1.9 2016/04/05 04:28:32 guenther Exp $ */
+/* $OpenBSD: namespace.h,v 1.10 2016/05/07 19:05:22 guenther Exp $ */
#ifndef _LIBC_NAMESPACE_H_
#define _LIBC_NAMESPACE_H_
@@ -139,12 +139,14 @@
#define CANCEL(x) _libc_##x##_cancel
#define WRAP(x) _libc_##x##_wrap
#define HIDDEN_STRING(x) "_libc_" __STRING(x)
+#define CANCEL_STRING(x) "_libc_" __STRING(x) "_cancel"
#define WRAP_STRING(x) "_libc_" __STRING(x) "_wrap"
#define PROTO_NORMAL(x) __dso_hidden typeof(x) x asm(HIDDEN_STRING(x))
#define PROTO_STD_DEPRECATED(x) typeof(x) x __attribute__((deprecated))
#define PROTO_DEPRECATED(x) typeof(x) x __attribute__((deprecated, weak))
-#define PROTO_CANCEL(x) PROTO_NORMAL(x), CANCEL(x)
+#define PROTO_CANCEL(x) __dso_hidden typeof(x) HIDDEN(x), \
+ x asm(CANCEL_STRING(x))
#define PROTO_WRAP(x) PROTO_NORMAL(x), WRAP(x)
#define DEF_STRONG(x) __strong_alias(x, HIDDEN(x))