diff options
Diffstat (limited to 'js/src/jsnativestack.cpp')
-rw-r--r-- | js/src/jsnativestack.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/js/src/jsnativestack.cpp b/js/src/jsnativestack.cpp index 98f8fc741..4e96e01e8 100644 --- a/js/src/jsnativestack.cpp +++ b/js/src/jsnativestack.cpp @@ -26,11 +26,7 @@ # include <sys/syscall.h> # include <sys/types.h> # include <unistd.h> -static pid_t -gettid() -{ - return syscall(__NR_gettid); -} +# define gettid() static_cast<pid_t>(syscall(SYS_gettid)) # endif #else @@ -71,6 +67,20 @@ js::GetNativeStackBaseImpl() # endif } +#elif defined(XP_SOLARIS) + +#include <ucontext.h> + +JS_STATIC_ASSERT(JS_STACK_GROWTH_DIRECTION < 0); + +void* +js::GetNativeStackBaseImpl() +{ + stack_t st; + stack_getbounds(&st); + return static_cast<char*>(st.ss_sp) + st.ss_size; +} + #elif defined(XP_LINUX) && !defined(ANDROID) && defined(__GLIBC__) void* js::GetNativeStackBaseImpl() |