summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/thread_linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/thread_linux.c')
-rw-r--r--src/pkg/runtime/thread_linux.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/pkg/runtime/thread_linux.c b/src/pkg/runtime/thread_linux.c
index 6b428440e..858be7036 100644
--- a/src/pkg/runtime/thread_linux.c
+++ b/src/pkg/runtime/thread_linux.c
@@ -255,3 +255,23 @@ runtime·setprof(bool on)
{
USED(on);
}
+
+static int8 badcallback[] = "runtime: cgo callback on thread not created by Go.\n";
+
+// This runs on a foreign stack, without an m or a g. No stack split.
+#pragma textflag 7
+void
+runtime·badcallback(void)
+{
+ runtime·write(2, badcallback, sizeof badcallback - 1);
+}
+
+static int8 badsignal[] = "runtime: signal received on thread not created by Go.\n";
+
+// This runs on a foreign stack, without an m or a g. No stack split.
+#pragma textflag 7
+void
+runtime·badsignal(void)
+{
+ runtime·write(2, badsignal, sizeof badsignal - 1);
+}