Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/core/thread.d
Original file line number Diff line number Diff line change
Expand Up @@ -3199,6 +3199,7 @@ extern (C) @nogc nothrow
version (NetBSD) int pthread_attr_get_np(pthread_t thread, pthread_attr_t* attr);
version (Solaris) int thr_stksegment(stack_t* stk);
version (CRuntime_Bionic) int pthread_getattr_np(pthread_t thid, pthread_attr_t* attr);
version (CRuntime_Musl) int pthread_getattr_np(pthread_t, pthread_attr_t*);
}


Expand Down Expand Up @@ -3285,6 +3286,16 @@ private void* getStackBottom() nothrow @nogc
pthread_attr_destroy(&attr);
return addr + size;
}
else version (CRuntime_Musl)
{
pthread_attr_t attr;
void* addr; size_t size;

pthread_getattr_np(pthread_self(), &attr);
pthread_attr_getstack(&attr, &addr, &size);
pthread_attr_destroy(&attr);
return addr + size;
}
else
static assert(false, "Platform not supported.");
}
Expand Down