mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 08:25:20 +08:00
[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:
1 parent
0440959f9a
commit
3e4497dab1
1 file changed
+5
Notes:
git
2026-10-26 03:43:18 +00:00
@@ -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
|
||||
|
||||
Reference in new issue
Block a user