X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fbsd-os.c;h=64aba2cd0a569f71d59b3fb0113af6780f9162f6;hb=2d4a0df3457bcd50916b33d374da592d8776db0a;hp=3e3cfb645c6a59e776ee7945118b2a26c340ce4c;hpb=833c031ec5dd8ee50dd2dbe003e7b2f398a8b699;p=sbcl.git diff --git a/src/runtime/bsd-os.c b/src/runtime/bsd-os.c index 3e3cfb6..64aba2c 100644 --- a/src/runtime/bsd-os.c +++ b/src/runtime/bsd-os.c @@ -34,7 +34,6 @@ #include #include /* #include */ -#include #include "validate.h" vm_size_t os_vm_page_size; @@ -263,6 +262,16 @@ struct thread *arch_os_get_current_thread() { return all_threads; } int arch_os_thread_init(struct thread *thread) { + stack_t sigstack; +#ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK + /* Signal handlers are run on the control stack, so if it is exhausted + * we had better use an alternate stack for whatever signal tells us + * we've exhausted it */ + sigstack.ss_sp=((void *) thread)+dynamic_values_bytes; + sigstack.ss_flags=0; + sigstack.ss_size = 32*SIGSTKSZ; + sigaltstack(&sigstack,0); +#endif return 1; /* success */ } int arch_os_thread_cleanup(struct thread *thread) {