fix stack getting on linux, add test

This commit is contained in:
Michael Scire 2022-03-10 12:25:43 -08:00
parent 097e04ab54
commit d5b858f5ba

View File

@ -36,7 +36,7 @@ namespace ams::os::impl {
/* Get the thread satck. */ /* Get the thread satck. */
void *base = nullptr; void *base = nullptr;
size_t size = 0; size_t size = 0;
const auto getstack_res = pthread_getattr_np(pthread_self(), std::addressof(attr)); const auto getstack_res = pthread_attr_getstack(std::addressof(attr), std::addressof(base), std::addressof(size));
AMS_ABORT_UNLESS(getstack_res == 0); AMS_ABORT_UNLESS(getstack_res == 0);
*out_stack = reinterpret_cast<uintptr_t>(base); *out_stack = reinterpret_cast<uintptr_t>(base);