f4980b6b6c5d0a3ffd262eb6e2ff2b0a41605a37
[mono.git] / mono / utils / mono-threads-linux.c
1 /**
2  * \file
3  */
4
5 #include <config.h>
6
7 #if (defined(__linux__) && !defined(PLATFORM_ANDROID)) || defined(__FreeBSD_kernel__)
8
9 #include <mono/utils/mono-threads.h>
10 #include <pthread.h>
11
12 void
13 mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize)
14 {
15         pthread_attr_t attr;
16
17         *staddr = NULL;
18         *stsize = (size_t)-1;
19
20         pthread_getattr_np (pthread_self (), &attr);
21         pthread_attr_getstack (&attr, (void**)staddr, stsize);
22         pthread_attr_destroy (&attr);
23 }
24
25 #endif