Update Haiku support (#15674)
[mono-project.git] / mono / utils / mono-threads-openbsd.c
blobfb2e3eb0f598a3ef505136645ba9028533c7576f
1 /**
2 * \file
3 */
5 #include <config.h>
7 #if defined(__OpenBSD__)
9 #include <mono/utils/mono-threads.h>
10 #include <pthread.h>
11 #include <pthread_np.h>
13 void
14 mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize)
16 stack_t ss;
17 int rslt;
19 rslt = pthread_stackseg_np (pthread_self (), &ss);
20 g_assert (rslt == 0);
22 *staddr = (void*)((size_t)ss.ss_sp - ss.ss_size);
23 *stsize = ss.ss_size;
26 guint64
27 mono_native_thread_os_id_get (void)
29 return (guint64)getthrid ();
32 #endif