Merge pull request #1266 from esdrubal/datetimenewformat
[mono.git] / mono / utils / mono-threads-openbsd.c
1 #include <config.h>
2
3 #if defined(__OpenBSD__)
4
5 #include <pthread.h>
6 #include <pthread_np.h>
7
8 void
9 mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize)
10 {
11         /* TODO :   Determine if this code is actually still needed. It may already be covered by the case above. */
12         pthread_attr_t attr;
13         guint8 *current = (guint8*)&attr;
14
15         *staddr = NULL;
16         *stsize = (size_t)-1;
17
18         pthread_attr_init (&attr);
19
20         stack_t ss;
21         int rslt;
22
23         rslt = pthread_stackseg_np (pthread_self (), &ss);
24         g_assert (rslt == 0);
25
26         *staddr = (guint8*)((size_t)ss.ss_sp - ss.ss_size);
27         *stsize = ss.ss_size;
28
29         pthread_attr_destroy (&attr);
30 }
31
32 #endif