Skip to content
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
14 changes: 13 additions & 1 deletion src/coreclr/pal/src/thread/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,7 @@ CPalThread::ThreadEntry(
// vendor-modified Android kernels with strict SELinux policy) block
// sched_setaffinity even when passed a mask extracted via sched_getaffinity.
// Treat this as non-fatal — the thread will continue running on any
// available CPU rather than the originally affinitized one.
// available CPU rather than the originally affinitized one.
WARN("sched_setaffinity failed with EPERM/EACCES, ignoring\n");
}
else
Expand Down Expand Up @@ -2316,6 +2316,12 @@ CPalThread::GetStackBase()
#ifdef TARGET_APPLE
// This is a Mac specific method
stackBase = pthread_get_stackaddr_np(pthread_self());
#elif defined(TARGET_OPENBSD)
stack_t stack;
int status = pthread_stackseg_np(pthread_self(), &stack);
_ASSERT_MSG(status == 0, "pthread_stackseg_np call failed");

stackBase = stack.ss_sp;
#else
pthread_attr_t attr;
void* stackAddr;
Expand Down Expand Up @@ -2361,6 +2367,12 @@ CPalThread::GetStackLimit()
// This is a Mac specific method
stackLimit = ((BYTE *)pthread_get_stackaddr_np(pthread_self()) -
pthread_get_stacksize_np(pthread_self()));
#elif defined(TARGET_OPENBSD)
stack_t stack;
int status = pthread_stackseg_np(pthread_self(), &stack);
_ASSERT_MSG(status == 0, "pthread_stackseg_np call failed");

stackLimit = (void*)stack.ss_size;
#else
pthread_attr_t attr;
size_t stackSize;
Expand Down