7 #if (defined(__linux__) && !defined(HOST_ANDROID)) || defined(__FreeBSD_kernel__)
9 #include <mono/utils/mono-threads.h>
13 mono_threads_platform_get_stack_bounds (guint8
**staddr
, size_t *stsize
)
21 res
= pthread_attr_init (&attr
);
22 if (G_UNLIKELY (res
!= 0))
23 g_error ("%s: pthread_attr_init failed with \"%s\" (%d)", __func__
, g_strerror (res
), res
);
25 res
= pthread_getattr_np (pthread_self (), &attr
);
26 if (G_UNLIKELY (res
!= 0))
27 g_error ("%s: pthread_getattr_np failed with \"%s\" (%d)", __func__
, g_strerror (res
), res
);
29 res
= pthread_attr_getstack (&attr
, (void**)staddr
, stsize
);
30 if (G_UNLIKELY (res
!= 0))
31 g_error ("%s: pthread_attr_getstack failed with \"%s\" (%d)", __func__
, g_strerror (res
), res
);
33 res
= pthread_attr_destroy (&attr
);
34 if (G_UNLIKELY (res
!= 0))
35 g_error ("%s: pthread_attr_destroy failed with \"%s\" (%d)", __func__
, g_strerror (res
), res
);