7 #if (defined(__linux__) && !defined(HOST_ANDROID)) || defined(__FreeBSD_kernel__)
9 #include <mono/utils/mono-threads.h>
11 #include <sys/syscall.h>
14 mono_threads_platform_get_stack_bounds (guint8
**staddr
, size_t *stsize
)
22 res
= pthread_attr_init (&attr
);
23 if (G_UNLIKELY (res
!= 0))
24 g_error ("%s: pthread_attr_init failed with \"%s\" (%d)", __func__
, g_strerror (res
), res
);
26 res
= pthread_getattr_np (pthread_self (), &attr
);
27 if (G_UNLIKELY (res
!= 0))
28 g_error ("%s: pthread_getattr_np failed with \"%s\" (%d)", __func__
, g_strerror (res
), res
);
30 res
= pthread_attr_getstack (&attr
, (void**)staddr
, stsize
);
31 if (G_UNLIKELY (res
!= 0))
32 g_error ("%s: pthread_attr_getstack failed with \"%s\" (%d)", __func__
, g_strerror (res
), res
);
34 res
= pthread_attr_destroy (&attr
);
35 if (G_UNLIKELY (res
!= 0))
36 g_error ("%s: pthread_attr_destroy failed with \"%s\" (%d)", __func__
, g_strerror (res
), res
);
41 mono_native_thread_os_id_get (void)
43 return (guint64
)syscall (SYS_gettid
);
48 #include <mono/utils/mono-compiler.h>
50 MONO_EMPTY_SOURCE_FILE (mono_threads_linux
);