[Bug #20452] Take main thread address/size with rlimit if musl libc

Musl libc defines `pthread_getattr_np` but it can not get the correct
value of the main thread.
This commit is contained in:
Nobuyoshi Nakada authored and Yusuke Endoh committed 2026-10-26 12:42:46 +09:00
1 parent 0440959f9a
commit 3e4497dab1
1 file changed
+5
Notes: git 2026-10-26 03:43:18 +00:00
+5
View File
@@ -516,6 +516,11 @@ native_thread_destroy_self(struct rb_native_thread *nt)
#if defined HAVE_PTHREAD_GETATTR_NP || defined HAVE_PTHREAD_ATTR_GET_NP
#define STACKADDR_AVAILABLE 1
# if defined(__linux__) && !defined __GLIBC__
/* Musl libc defines `pthread_getattr_np` but it can not get the
* correct value of the main thread. */
# define MAINSTACKADDR_AVAILABLE 0
# endif
#elif defined HAVE_PTHREAD_GET_STACKADDR_NP && defined HAVE_PTHREAD_GET_STACKSIZE_NP
#define STACKADDR_AVAILABLE 1
#undef MAINSTACKADDR_AVAILABLE