summaryrefslogtreecommitdiff
path: root/lang/mono/patches/patch-mono_utils_mono-threads-netbsd.c
blob: 991fd4c7f397d3dad9522e1f65df79048bf57021 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$NetBSD: patch-mono_utils_mono-threads-netbsd.c,v 1.1 2014/11/30 08:40:51 spz Exp $

--- mono/utils/mono-threads-netbsd.c.orig	2014-11-29 21:20:20.000000000 +0000
+++ mono/utils/mono-threads-netbsd.c
@@ -0,0 +1,23 @@
+#include <config.h>
+
+#if defined(__NetBSD__)
+
+#include <mono/utils/mono-threads.h>
+#include <pthread.h>
+
+void
+mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize)
+{
+	pthread_attr_t attr;
+
+	*staddr = NULL;
+	*stsize = (size_t)-1;
+
+	pthread_attr_init (&attr);
+	pthread_attr_get_np (pthread_self (), &attr);
+
+	pthread_attr_getstack (&attr, (void**)staddr, stsize);
+	pthread_attr_destroy (&attr);
+}
+
+#endif