[interp] Remove unreachable code (#12411)
[mono-project.git] / mono / utils / mono-threads-aix.c
blob538f4d895fbf975e018e12e85a29982a9db787fb
1 /**
2 * \file
3 */
5 #include <config.h>
7 #if defined(_AIX)
9 #include <mono/utils/mono-threads.h>
10 #include <pthread.h>
12 void
13 mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize)
15 /* see GC_push_all_stacks in libgc/aix_irix_threads.c
16 for why we do this; pthread_getattr_np exists only
17 on some versions of AIX and not on PASE, so use a
18 legacy way to get the stack information */
19 struct __pthrdsinfo pi;
20 pthread_t pt;
21 int res, rbv, ps;
22 char rb[255];
24 pt = pthread_self();
25 ps = sizeof(pi);
26 rbv = sizeof(rb);
28 *staddr = NULL;
29 *stsize = (size_t)-1;
31 res = pthread_getthrds_np(&pt, PTHRDSINFO_QUERY_ALL, &pi, ps, rb, &rbv);
32 /* FIXME: are these the right values? */
33 *staddr = (void*)(pi.__pi_stackaddr);
35 * ruby doesn't use stacksize; see:
36 * github.com/ruby/ruby/commit/a2594be783c727c6034308f5294333752c3845bb
38 *stsize = pi.__pi_stackend - pi.__pi_stackaddr;
41 #endif