diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-06-19 15:58:23 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-06-19 16:12:45 +0200 |
commit | 22465796edbfd6f156ca2930f56b3345cc54b164 (patch) | |
tree | a463488dc43aa43c698bf806602ba54975890889 /newlib/libc/include/sys/signal.h | |
parent | 715ac1e872e495496f9a540a75e8b1f4cbcdf321 (diff) | |
download | cygnal-22465796edbfd6f156ca2930f56b3345cc54b164.tar.gz cygnal-22465796edbfd6f156ca2930f56b3345cc54b164.tar.bz2 cygnal-22465796edbfd6f156ca2930f56b3345cc54b164.zip |
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 'newlib/libc/include/sys/signal.h')
-rw-r--r-- | newlib/libc/include/sys/signal.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h index 6ff758ce7..f2087fe62 100644 --- a/newlib/libc/include/sys/signal.h +++ b/newlib/libc/include/sys/signal.h @@ -120,11 +120,6 @@ struct sigaction { #define SIGSTKSZ 8192 #endif -/* - * Possible values for ss_flags in stack_t below. - */ -#define SS_ONSTACK 0x1 -#define SS_DISABLE 0x2 #endif #elif defined(__CYGWIN__) @@ -143,6 +138,12 @@ struct sigaction #endif /* defined(__rtems__) */ /* + * Possible values for ss_flags in stack_t below. + */ +#define SS_ONSTACK 0x1 +#define SS_DISABLE 0x2 + +/* * Structure used in sigaltstack call. */ typedef struct sigaltstack { @@ -196,7 +197,7 @@ int _EXFUN(sigpending, (sigset_t *)); int _EXFUN(sigsuspend, (const sigset_t *)); int _EXFUN(sigpause, (int)); -#ifdef __rtems__ +#if defined(__CYGWIN__) || defined(__rtems__) #if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 int _EXFUN(sigaltstack, (const stack_t *__restrict, stack_t *__restrict)); #endif |