fix stack getting on linux, add test

This commit is contained in:
Michael Scire 2022-03-10 12:25:43 -08:00 committed by SciresM
parent 6aab36fc6a
commit a3865e721a
4 changed files with 243 additions and 1 deletions

View file

@ -36,7 +36,7 @@ namespace ams::os::impl {
/* Get the thread satck. */
void *base = nullptr;
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);
*out_stack = reinterpret_cast<uintptr_t>(base);