diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-06-19 16:58:23 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-06-19 17:12:45 +0300 |
commit | 22465796edbfd6f156ca2930f56b3345cc54b164 (patch) | |
tree | a463488dc43aa43c698bf806602ba54975890889 /winsup/cygwin/cygtls.cc | |
parent | 715ac1e872e495496f9a540a75e8b1f4cbcdf321 (diff) |
Preliminary infrastructure to implement alternate stack
* libc/include/sys/signal.h: Define SS_ONSTACK and SS_DISABLE
unconditionally.
(sigaltstack): Enable prototype on Cygwin.
* common.din (sigaltstack): Export.
* cygtls.cc (_cygtls::init_thread): Initialize altstack.
* cygtls.h (__tlsstack_t): Rename from __stack_t to distinguish
more clearly from stack_t. Accommodate throughout.
(_cygtls): Add altstack member.
* exceptions.cc (exception::handle): Set SIGSEGV handler to SIG_DFL
if we encounter a stack overflow, and no alternate stack has been
defined.
* include/cygwin/signal.h (MINSIGSTKSZ): Define
(SIGSTKSZ): Define.
(SA_ONSTACK): Define.
* signal.cc (sigaltstack): New function.
* tlsoffset.h: Regenerate.
* tlsoffset64.h: Ditto.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/cygtls.cc')
-rw-r--r-- | winsup/cygwin/cygtls.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc index 84170ca01..dc9a698f7 100644 --- a/winsup/cygwin/cygtls.cc +++ b/winsup/cygwin/cygtls.cc @@ -125,6 +125,7 @@ _cygtls::init_thread (void *x, DWORD (*func) (void *, void *)) memset (this, 0, sizeof (*this)); _REENT_INIT_PTR (&local_clib); stackptr = stack; + altstack.ss_flags = SS_DISABLE; if (_GLOBAL_REENT) { local_clib._stdin = _GLOBAL_REENT->_stdin; |